[JBoss jBPM] - async fork
by popel
Hi,
I've got a problem to get async nodes right. I read on JIRA ther once was an issue with this but got resolved. So I wonder where my mistake is.
JBPM Version is 3.2.3
The process definition:
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition xmlns="" name="TestThreadSkript">
| <start-state name="start-state1">
| <transition to="fork1"></transition>
| </start-state>
| <fork name="fork1">
| <transition to="node1" name="to node1"></transition>
| <transition to="node2" name="to node2"></transition>
| <transition to="node3" name="to node3"></transition>
| </fork>
| <node name="node1" async="true">
| <script name="do it1">
| <expression>
| String nodename=executionContext.getNode().getName();
| for(int i=0;i<=7;i++){
| Thread.currentThread().sleep(1000);
| System.out.println(nodename + " is waiting (" +i+")");
| }
| System.out.println("loop done");
|
| executionContext.leaveNode();
| </expression>
| </script>
| <transition to="join1"></transition>
| </node>
|
| <node name="node2" async="true">
| <script name="do it2">
| <expression>
| String nodename=executionContext.getNode().getName();
|
| for(int i=0;i<=7;i++){
| Thread.currentThread().sleep(1000);
| System.out.println(nodename + " is waiting (" +i+")");
| }
| System.out.println("loop done");
|
| executionContext.leaveNode();
| </expression>
| </script>
| <transition to="join1"></transition>
| </node>
|
| <node name="node3" async="true">
| <script name="do it3">
| <expression>
| String nodename=executionContext.getNode().getName();
|
| for(int i=0;i<=7;i++){
| Thread.currentThread().sleep(1000);
| System.out.println(nodename + " is waiting (" +i+")");
| }
| System.out.println("loop done");
|
| executionContext.leaveNode();
| </expression>
| </script>
| <transition to="join1"></transition>
| </node>
|
|
| <join name="join1" >
| <transition to="end-state1"></transition>
| </join>
|
| <end-state name="end-state1"></end-state>
|
| </process-definition>
|
|
This throws an exception
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
This happens when the second thread enters the join node and hibernate tries to update a token.
I tested this with MYSQL and transaction-isolation = REPEATABLE-READ and READ-COMMITTED but nothing helped.
Where am I wrong?
Thanks for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172823#4172823
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172823
15 years, 9 months
[JBoss jBPM] - Re: question regarding some 'dates' in task instance
by memius
At this moment, I am trying to implement 'suspend until' like this (note, I will call this method in some kind of service class, so not in an ActionHandler) :
public void suspendTaskInstanceUntil(final TaskInstance taskInstance, final String suspendUntilDate){
|
| taskInstance.suspend();
| CreateTimerAction cta = new CreateTimerAction();
| cta.setName("suspendUntilTimer");
| cta.setDueDate(suspendUntilDate);
| Action action = null;
| String actionName = "resume action";
| Delegation delegation = new Delegation("foo.bar.ResumeAction"); // will call taskInstance.resume()
|
| delegation.setProcessDefinition(taskInstance.getProcessInstance().getProcessDefinition());
| action= new Action(delegation);
| action.setName(actionName);
| cta.setTimerAction(action);
| try {
| cta.execute(ExecutionContext.currentExecutionContext());
|
| } catch (Exception e) {
| throw new RuntimeException(e);
| // e.printStackTrace();
| }
| jbpmContext.save(taskInstance);
|
| }
I saw sth like this (as a poc) in an actionhandler and wanted a similar behaviour (but without the action handler )
My problem is now : ExecutionContext.currentExecutionContext() returns null...
So what I am trying to do does not work
Could anyone suggest a fix / alternative / workaround for this ?
(btw : the similar resume task method, would first kill the dynamic timer (if existing) and then resume the task
Sincerely,
Dieter D'haeyere.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172781#4172781
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172781
15 years, 9 months
[JBoss jBPM] - problem with the MailNode:transition doesn't have destinatio
by jalovic
Hi everybody,
I have a problem with the method signal().
Here is my processdefintion(where i want to test the email notification)
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="" name="conge_workflow">
|
|
| <start-state name="saisie_demande">
| <transition to="mail-node1" name="test"></transition>
| </start-state>
|
|
| <fork name="fork1">
| <transition to="notifier_SH_refus_DH"></transition>
| <transition to="notifier_initiateur_refus_DH" name=""></transition>
| </fork>
|
| <join name="join1">
| <transition to="refus_conge"></transition>
| </join>
|
| <state name="approbation_SH">
| <transition to="notifier_initiateur_refus_SH" name="NO"></transition>
| <transition to="validation_DH" name="OK"></transition>
| </state>
|
| <state name="validation_DH">
| <transition to="fork1" name="NO"></transition>
| <transition to="notifier_initiateur_accept" name="OK"></transition>
| </state>
|
| <state name="notifier_initiateur_refus_SH">
| <transition to="refus_conge"></transition>
| </state>
|
| <state name="notifier_SH_refus_DH">
| <transition to="join1"></transition>
| </state>
|
| <state name="notifier_initiateur_refus_DH">
| <transition to="join1"></transition>
| </state>
|
| <state name="notifier_initiateur_accept">
| <transition to="acceptation_conge"></transition>
| </state>
|
| <mail-node name="mail-node1">
| <transition to="approbation_SH"></transition>
| </mail-node>
|
|
| <end-state name="acceptation_conge"></end-state>
|
| <end-state name="refus_conge"></end-state>
|
|
| </process-definition>
|
When i try to move to a mailnode,It returns the following error:
| "transition 'test' doesn't have destination. check your processdefinition.xml"
|
I've searched in the forum and found that's a problem of libs, but i already use the following jars:
jbpm-3.1.4.jar
jbpm-identity-3.2.3.jar
jbpm-jpdl-3.2.3.jar
I would be thankful for any suggestion.
Please help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172774#4172774
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172774
15 years, 9 months