[JBoss jBPM] - exception in the last node of the process
by daviddev
Hi guy,
I have a small problem when I execute a jbpm process within my application.
my process is relatively simple and consists of:
| ----| ----| ----|
| |(signal) |(signal) |(signal)
| start-state --> node1 --> node2 --> node3 --> waiting(state) --> node4 --> waiting (state) --> node5 --> node6 --> end-state
|
node1 and node2: persists some data within my database
node3: send a message to an external appliation through JMS and wait for the reponse (through JMS too)
node4: persists some data in my database and send a message to an external application through JMS message and wait for the reponse (through JMS too)
node5 and node 6: persists some data in my database
the process instance is started in this way (see code below)
| public void startProcess(String processName, Map<String, Object> variables) throws Exception{
|
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
|
| try{
| ProcessInstance pInstance = null;
| pInstance = jbpmContext.newProcessInstanceForUpdate( processName );
| pInstance = jbpmContext.getProcessInstanceForUpdate( pInstance.getId() );
|
| Token token = pInstance.getRootToken();
| token.signal();
|
| }catch( JpdlException e ){
| ...
| }catch( Exception e ){
| ...
| }finally{
| jbpmContext.close();
| }
| }
|
all nodes has at the end of the execute() method a call to the leavenode() method
| public void execute(ExecutionContext ctx) throws Exception {
| //my code here
| ctx.leaveNode();
| }
|
when the response from the external application arrives I resume the process (see the code below) in this way
| public void resumeProcess( Long processId ) throws Exception{
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
|
| try{
|
| ProcessInstance pInstance = jbpmContext.getProcessInstanceForUpdate( processId );
| pInstance.signal();
|
| }catch( Exception e ){
| String msg = "Impossible to resume process. an error occured during the resuming operation. ";
| log.debug( msg, e );
| throw new Exception( msg, e );
| }finally{
| jbpmContext.close();
| }
|
the process is running well meaning that each node is visited and the process is resumed (in both waiting state) when I received the response to my request through JMS message.
However I get an exception (see below) when leave the last node (i.e. node6) just before the end-state of the process.
| 15:33:07,827 ERROR [JmsServerSession] org.jboss.resource.adapter.jms.inflow.JmsServerSession@1a68649 failed to commit/rollback
| javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
| at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1401)
| at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
| at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:494)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
| at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
| at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
| at java.lang.Thread.run(Unknown Source)
| Caused by: org.hibernate.QueryParameterException: could not locate named parameter [processInstance]
| at org.hibernate.engine.query.ParameterMetadata.getNamedParameterDescriptor(ParameterMetadata.java:75)
| at org.hibernate.engine.query.ParameterMetadata.getNamedParameterExpectedType(ParameterMetadata.java:81)
| at org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:413)
| at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:383)
| at org.jbpm.db.JobSession$DeleteJobsSynchronization.beforeCompletion(JobSession.java:191)
| at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
| at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
| at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
| at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
| at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
| ... 8 more
|
If I remove the call to the leaveNode() method in the node6.
I do not have this exception but obviously my process instance is never ended.
I do not understand what wrong in my code.
Could you give me a hand to understand this issue and solve it.
many thanks
regards
DSE
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244680#4244680
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244680
16 years, 8 months
[JBoss jBPM] - JBPM 3 Concurrent Process Instances
by postal
I was trying to run a very simple continuous workflow and verify that process instances that run at the same time run in parallel, but my testing so far seems to indicate they always run in sequence.
Example:
Process instance steps through Node1, Node2, Node3 and then ends. Multiple process instances can be run in parallel with eachother.
Each node makes a call to an external system via a node(currently just outputting the Node's name and a counter ~50 times), but when I do this with my current configuration the output is always sequential.
Output - A1,A2,A3,A4,B1,B2,B3,B4
Expected - A1,A2,B1,A3,B2,A4,B3,B4 (or similar)
Currently I'm using MYSQL as my backend with 5 JobExecutorThreads and <transaction-isolation>REPEATABLE_READ</transaction-isolation>.
Is what I'm trying to do possible? Or are there more configurations I need to make. Thanks in advance.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244657#4244657
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244657
16 years, 8 months
[JBoss jBPM] - Re: JBPM 3.2.2 Timer Example
by csplrj
The XML is not being displayed properly and so the correct XML is
<task-node name="legalDept">
| <task name="task3">
| <assignment class="com.process.jbpm.ActorAssignmentHandler"></assignment>
| </task>
| <event type="task-assign">
| <action class="com.process.jbpm.JbpmActionListener">
| <actionListener>
| com.zycus.contract.authoring.process.ContractStageUpdateEvent1
| </actionListener>
| </action>
| </event>
| <timer name="timer1" transition="LegalApprove" duedate="3 business minutes">
| <script>
| System.out.println("Timer Fired");
| </script>
| </timer>
| <transition to="join2" name="LegalApprove">
| <action class="com.process.jbpm.JbpmPollingActionListener"></action>
| </transition>
| <transition to="join2" name="raiseSomeConcern">
| <action class="com.process.jbpm.JbpmPollingActionListener"></action>
| </transition>
| </task-node>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244639#4244639
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244639
16 years, 8 months
[JBoss jBPM] - Re: JBPM 4 task form examples
by manishh
Thanks kukeltje for pointing that out. I tried implementing it but I am getting the error "Task form resource 'task1.ftl' does not exists. The ftl file (task1.ftl) is in the same package as process definition file.
I tried importing the file in 2 different ways :
- <task g="338,58,177,52" name="...." swimlane="..." form="task1.ftl"> ...
- <task g="338,58,177,52" name="...." swimlane="..." form="com/test/jbpm/process/task1.ftl"> ...
but I am getting the same error in both the cases.
I believe that the process definition and the content of the ftl file are stored in the jbpm4_lob table (at the time of the deployment of the process) in the form of a blob. But in my case only the process definition is getting stored in the jbpm4_lob table.
Do you have any idea on what could be the reason behind the form resource file not getting loaded?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244627#4244627
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244627
16 years, 8 months