[jBPM] - jBPM noob questions
by Viktor Alexandrov
Viktor Alexandrov [https://community.jboss.org/people/synclpz] created the discussion
"jBPM noob questions"
To view the discussion, visit: https://community.jboss.org/message/825487#825487
--------------------------------------------------------------
Hello, all. I got some noob (maybe) questions concerning implementing existing scenarios in jBPM. I got some proprietary workflow manager runtime (running on AS7) and tooling to define workflows via graphical editor. The workflows are rather simple and consist of nodes (with in/out parameters) and arrows pointing to the next node (or nodes if current node makes some decisions). Every node is a simple java class that allows to perform some operation: math operations, database lookups/stores, invoke HTTP GET's, log, start another workflows, some proprietary actions and so on.
Now I want to migrate existing service logic to jBPM (actually may be to SwitchYard with jBPM as process orchestrator). Beacause of almost no knowledge in "perfect" BPMN I'm afraid of making wrong architectural decisions :)
I would be very glad if someone could propose me the right solutions or just post some links to the right places to read!
My simple process looks like this:
1. Log some input vars
2. Prepare (map) some additional parameters
3. Query some application properties (config)
4. Query DB with request based on prepared data
5. Modify data (e.g. update modification time)
6. Update data in DB
7. Invoke some sub-process
8. Execute some action through, for example, HTTP or other (proprietary) interface
9. If everything ok, commit data in DB, else rollback and write log
10. Map some paramerers for output
11. Finish
I cannot understand clearly how this should be implemented using jBPM tools. As I could imagine, logging and parameter mapping and runtime bean fileds updating could be performed via Script Node with java expressions, but may be I should use some other tools for it? I cannot find how do I query DB, update DB: is it only done through custom Service Node? Is there a possibility (examples) to use ORM for domain-specific data model? How could I invoke sub-process with, for example, process name and parameters derived in run-time? If someone could supply any more or less complex examples of jBPM usage: with custom data model or custom services invocations, it would be very appreciated.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/825487#825487]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[JBoss Messaging] - Spring JMS error with JBoss 7.1.1-Final
by Marcio B.
Marcio B. [https://community.jboss.org/people/romarcio] created the discussion
"Spring JMS error with JBoss 7.1.1-Final"
To view the discussion, visit: https://community.jboss.org/message/730037#730037
--------------------------------------------------------------
Hello!
I am trying to configure a JMS Listener with Spring 3.1 in JBoss 7.1.1-Final.
But this exception is thrown:
21:05:20,184 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-12) MSC00001: Failed to start service jboss.deployment.unit."jms-receiver.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jms-receiver.war".PARSE: Failed to process phase PARSE of deployment "jms-receiver.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011666: Could not parse file C:\jboss-as-7.1.1.Final\standalone\tmp\vfs\temp22a1673201a833b9\jms-receiver.war-1a83767da3f83ba\WEB-INF\spring-jms.xml
at org.jboss.as.messaging.deployment.MessagingXmlParsingDeploymentUnitProcessor.deploy(MessagingXmlParsingDeploymentUnitProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011666: Could not parse file C:\jboss-as-7.1.1.Final\standalone\tmp\vfs\temp22a1673201a833b9\jms-receiver.war-1a83767da3f83ba\WEB-INF\spring-jms.xml
at org.jboss.as.messaging.deployment.MessagingXmlParsingDeploymentUnitProcessor.deploy(MessagingXmlParsingDeploymentUnitProcessor.java:73)
... 6 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
Message: Unexpected element '{ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans}beans'
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.messaging.deployment.MessagingXmlParsingDeploymentUnitProcessor.deploy(MessagingXmlParsingDeploymentUnitProcessor.java:67)
... 6 more
21:05:20,198 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "jms-receiver.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jms-receiver.war\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jms-receiver.war\".PARSE: Failed to process phase PARSE of deployment \"jms-receiver.war\""}}
21:05:20,351 INFO [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015877: Stopped deployment jms-receiver.war in 153ms
21:05:20,352 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."jms-receiver.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jms-receiver.war".PARSE: Failed to process phase PARSE of deployment "jms-receiver.war"
File spring-jms.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory</prop>
<prop key="java.naming.provider.url">remote://localhost:4447</prop>
<prop key="java.naming.security.principal">user</prop>
<prop key="java.naming.security.credentials">pass</prop>
</props>
</property>
</bean>
<bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jms/RemoteConnectionFactory"/>
<property name="jndiTemplate" ref="jndiTemplate"/>
</bean>
<bean id="secureConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="queueConnectionFactory"/>
<property name="username" value="user"/>
<property name="password" value="pass"/>
</bean>
<bean id="queueName" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jms/queue/test"/>
<property name="jndiTemplate" ref="jndiTemplate"/>
</bean>
<bean id="messageListener" class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class="com.tecnoil.consumer.jms.JMSConsumer"/>
</constructor-arg>
<property name="messageConverter">
<null/>
</property>
</bean>
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="secureConnectionFactory"/>
<property name="destination" ref="queueName"/>
<property name="sessionAcknowledgeModeName" value="AUTO_ACKNOWLEDGE"/>
<property name="messageListener" ref="messageListener"/>
<property name="receiveTimeout" value="1000"/>
</bean>
</beans>
What is the solution?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/730037#730037]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - jBPM 5.4, Persistence, and Safe-Points
by Franco Gasperino
Franco Gasperino [https://community.jboss.org/people/franco.gasperino] created the discussion
"jBPM 5.4, Persistence, and Safe-Points"
To view the discussion, visit: https://community.jboss.org/message/825366#825366
--------------------------------------------------------------
Community,
Excuse the long-winded post. I'm trying to debug an issue with an integration project with the following components:
* jBPM 5.4 final, Drools 5.5 final
* Spring 3.2.x
* Bitronix 2.1.x
The core jBPM engine is heavily integrated with a custom stack allowing process instances to be created and run via all sorts of connectivity. The custom layer will take the process id & input parameters, delegate to a thread in an executor, which will:
1. Instantiate the drools environment (with JTA support).
2. Create the knowledge session.
3. Create a custom WorkItemHandler, associate each custom service task with this handler.
4. Create and associate the event handlers.
5. Create and start the process instance.
Everything executes as-expected, the JTA is performing commits and I can see the Hibernate activity inserting, updating, and deleting records from the Derby XA database.
However, when testing a process instance which *should* trigger a safe-point, i see unexpected behavior. In this case:
* Script "Hello" is a java/groovy/whatever script task.
* ServiceTask "MockAsyncTask" is a java class, which is associated / registered with the custom WorkItemHandler. * executeWorkItem() does NOT call completeWorkItem()
* Returns control to the jBPM engine, which should trigger a safe-point.
* Causes return of startProcessInstance(), which will exit the worker thread in the executor.
* Script "Bye" is a java/groovy/whatever script task.
The workflow: Start -> Hello -> MockAsyncTask -> Bye -> End
As expected, I see the behavior. I see that the ProcessInstance object associated has a state field of "2", which is active. Howevever, the hibernate update statements on the ProcessInstanceInfo table always have a state value of '0'. This is the breaking behavior.
When I attempt to call the adapter layer with the session id, process instance id, work item id, and a payload:
1. Instantiate the drools environment (JTA support).
2. Load the existing knowledge session.
3. Create a custom WorkItemHandler, associate each custom service task with this handler.
4. Create and associate event handlers.
5. Call completeWorkItem().
The workItem does complete, and i see it deleted from the WorkItemInfo table. However, since the process instance state has been reloaded with a value of '0', the "Bye" script task is never fired.
Any ideas? A full code dump would be huge, but I'm happy to inject some loggers if it would assist troubleshooting.
Thanks!
Franco
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/825366#825366]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[JBoss Tools] - JBosstoolsVisualEditorFAQ
by Yahor Radtsevich
Yahor Radtsevich [https://community.jboss.org/people/yradtsevich] modified the document:
"JBosstoolsVisualEditorFAQ"
To view the document, visit: https://community.jboss.org/docs/DOC-10862
--------------------------------------------------------------
*Q: Which platforms are supported by* *Visual Editor?*
*A:* The list of supported platforms (and their IDs):
* Windows with Java 32-bit (win32.win32.x86)
* Windows with Java 64-bit (win32.win32.x86_64) - Experimental support is available in JBoss Tools 4.1.0.Beta1/JBoss Developer Studio 7.0.0.Beta1 and above. To enable it, you need to install XULRunner from this update site:* http://download.jboss.org/jbosstools/updates/integration/kepler/core/xulr... http://download.jboss.org/jbosstools/updates/integration/kepler/core/xulr...
* If you cannot start Eclipse after this installation, you may use –Dorg.jboss.tools.vpe.loadxulrunner=false option as described in the next question.
Please comment in https://issues.jboss.org/browse/JBIDE-2720 JBIDE-2720 if something went wrong.
* Linux x86 (gtk.linux.x86)
* Linux x86-64 (gtk.linux.x86_64)
* Mac OS X Cocoa with Java 32-bit (cocoa.macosx.x86)
* Mac OS X Carbon with Java 32-bit (carbon.macosx.x86) [not supported by JBoss Tools 3.3.0 and later, JBDS 5.0 and later]
In brief, Java 64-bit is supported on Linux only, on all other systems Visual Editor requires Java 32-bit.
*Q: Eclipse crashes when I use Visual Editor, what can I do?*
*A:* This may happen in JBoss Tools 3.3.0.M2 and above with Eclipse 3.7.0 due to https://issues.jboss.org/browse/JBIDE-9144 the WebKit and XULRunner conflict. You can disable Visual Editor by adding the option –Dorg.jboss.tools.vpe.loadxulrunner=false to the eclipse.ini (or jbdevstudio.ini if you use JBoss Developer Studio).
*Q: Visual Editor does not start under Linux*
*A:* Linux users may need to do the following to get the visual editor to work correctly on their machines.
* The Visual Page Editor (before JBoss Tools 3.1.0.M4) requires the library libstdc++.so.5. This library is contained in the compat-libstdc++-33.i386 package.
* To install this package on Fedora Core or Red Hat Enterprise Linux run the following command:
yum install compat-libstdc++-33.i386
** On any other rpm based distributions download libstdc++.so.5 and run the following command:
rpm -Uvh compat-libstdc++-33.i386
** On Debian and Debian based distributions (e.g. Ubuntu) run the following command:
apt-get install libstdc++5
* In case you have the library installed and you still have issue with starting the visual page editor then close all browser views/editors and leave one visual page editor open and restart eclipse. This should force a load of the right XULRunner viewer.
*Q: Visual Editor doesn't start at any platform and shows message 'The VPE editor can't be run because your system environment needs to be changed slightly'*
*A:* Check if you version of JBoss Developer Studio/JBoss Tools is compatible with you version of Eclipse, see the compatibility matrix https://community.jboss.org/docs/DOC-14297 http://www.jboss.org/community/wiki/Matrixofsupportedplatformsruntimesand...
*Q: Visual Editor starts OK, but the following message dialog appears:*
https://community.jboss.org/servlet/JiveServlet/showImage/102-10862-53-19... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-10862-5...
*A:* Some functionality of Visual Editor may not work if a project doesn't have org.jboss.tools.jsf.jsfnature or org.jboss.tools.jst.web.kb.kbnature in .project configuration. To fix this problem and turn off the message box execute next steps:
* Right mouse button click on a project in Package Explorer.
* Select +Configure -> Add JSF Capabilities+ from the context menu.
* Configure your project using +Add JSF Capabilities+ wizard and press Finish.
*P.S.* If you are sure that your project does not need JSF capabilities, just disable this message box by checking "+Do not show this dialog again!+" checkbox.
*Q: Visual Part doesn't start and "XPCOM error -2147467259" is shown*
*A:* Something bad happened with buildin xulrunner. To check it you should:
* Go to Eclipse -> Help -> About -> Installation Details... -> Configuration
* find +org.eclipse.swt.browser.XULRunnerPath+ and open this path in terminal
* try xulrunner.exe -version or ./xulrunner -version and it should show what is needed for XR to work
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-10862]
Create a new document in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 5 months
[JBoss Tools] - JBosstoolsVisualEditorFAQ
by Nick Boldt
Nick Boldt [https://community.jboss.org/people/nickboldt] modified the document:
"JBosstoolsVisualEditorFAQ"
To view the document, visit: https://community.jboss.org/docs/DOC-10862
--------------------------------------------------------------
*Q: Which platforms are supported by* *Visual Editor?*
*A:* The list of supported platforms (and their IDs):
* Windows with Java 32-bit (win32.win32.x86)
* Windows with Java 64-bit (win32.win32.x86_64) - Experimental support is available in JBoss Tools 4.1.0.Beta1/2 and JBoss Developer Studio 7.0.0.Beta1/2. To enable it, you need to install XULRunner from this update site:* http://download.jboss.org/jbosstools/updates/integration/kepler/core/xulr... http://download.jboss.org/jbosstools/updates/integration/kepler/core/xulr... (previously http://download.jboss.org/jbosstools/builds/staging/xulrunner-1.9.2_win64... http://download.jboss.org/jbosstools/builds/staging/xulrunner-1.9.2_win64... )
* If you cannot start Eclipse after this installation, you may use –Dorg.jboss.tools.vpe.loadxulrunner=false option as described in the next question.
Please comment in https://issues.jboss.org/browse/JBIDE-2720 JBIDE-2720 if something went wrong.
* Linux x86 (gtk.linux.x86)
* Linux x86-64 (gtk.linux.x86_64)
* Mac OS X Cocoa with Java 32-bit (cocoa.macosx.x86)
* Mac OS X Carbon with Java 32-bit (carbon.macosx.x86) [not supported by JBoss Tools 3.3.0 and later, JBDS 5.0 and later]
In brief, Java 64-bit is supported on Linux only, on all other systems Visual Editor requires Java 32-bit.
*Q: Eclipse crashes when I use Visual Editor, what can I do?*
*A:* This may happen in JBoss Tools 3.3.0.M2 and above with Eclipse 3.7.0 due to https://issues.jboss.org/browse/JBIDE-9144 the WebKit and XULRunner conflict. You can disable Visual Editor by adding the option –Dorg.jboss.tools.vpe.loadxulrunner=false to the eclipse.ini (or jbdevstudio.ini if you use JBoss Developer Studio).
*Q: Visual Editor does not start under Linux*
*A:* Linux users may need to do the following to get the visual editor to work correctly on their machines.
* The Visual Page Editor (before JBoss Tools 3.1.0.M4) requires the library libstdc++.so.5. This library is contained in the compat-libstdc++-33.i386 package.
* To install this package on Fedora Core or Red Hat Enterprise Linux run the following command:
yum install compat-libstdc++-33.i386
** On any other rpm based distributions download libstdc++.so.5 and run the following command:
rpm -Uvh compat-libstdc++-33.i386
** On Debian and Debian based distributions (e.g. Ubuntu) run the following command:
apt-get install libstdc++5
* In case you have the library installed and you still have issue with starting the visual page editor then close all browser views/editors and leave one visual page editor open and restart eclipse. This should force a load of the right XULRunner viewer.
*Q: Visual Editor doesn't start at any platform and shows message 'The VPE editor can't be run because your system environment needs to be changed slightly'*
*A:* Check if you version of JBoss Developer Studio/JBoss Tools is compatible with you version of Eclipse, see the compatibility matrix https://community.jboss.org/docs/DOC-14297 http://www.jboss.org/community/wiki/Matrixofsupportedplatformsruntimesand...
*Q: Visual Editor starts OK, but the following message dialog appears:*
https://community.jboss.org/servlet/JiveServlet/showImage/102-10862-52-19... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-10862-5...
*A:* Some functionality of Visual Editor may not work if a project doesn't have org.jboss.tools.jsf.jsfnature or org.jboss.tools.jst.web.kb.kbnature in .project configuration. To fix this problem and turn off the message box execute next steps:
* Right mouse button click on a project in Package Explorer.
* Select +Configure -> Add JSF Capabilities+ from the context menu.
* Configure your project using +Add JSF Capabilities+ wizard and press Finish.
*P.S.* If you are sure that your project does not need JSF capabilities, just disable this message box by checking "+Do not show this dialog again!+" checkbox.
*Q: Visual Part doesn't start and "XPCOM error -2147467259" is shown*
*A:* Something bad happened with buildin xulrunner. To check it you should:
* Go to Eclipse -> Help -> About -> Installation Details... -> Configuration
* find +org.eclipse.swt.browser.XULRunnerPath+ and open this path in terminal
* try xulrunner.exe -version or ./xulrunner -version and it should show what is needed for XR to work
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-10862]
Create a new document in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 5 months