Re: [jboss-user] [jBPM] - Failure in ignaling a state in a process which has timer
by Soheil Dowlatshahi
Soheil Dowlatshahi [http://community.jboss.org/people/soheildowlatshahi] replied to the discussion
"Failure in ignaling a state in a process which has timer"
To view the discussion, visit: http://community.jboss.org/message/553192#553192
--------------------------------------------------------------
Dear http://community.jboss.org/people/swiderski.maciej Maciej Swiderski
I have changed my code as you had suggested alreay and I tried to signal the execution Id of the wait state activity instead of signaling the process itself and it didn't throw any exception. At first it seams that it works but later I have noticied that the no transtion in wait state is traveresed and the state of the process isn't changed.
you can see part of my process definition here:
<state name="*activity.investor.registeration.inquiry.suspend*" >
<transition name="investor.inquiry.replied" to="activity.investor.registeration.inquiry.evaluate"/>
<transition name="investor.inquiry.timeout" to="activity.investor.registeration.inquiry.check">
<timer duedate="50 minutes" />
</transition>
</state>
and here is my code for signaling the above mentioned wait state:
processInstance = executionService.findProcessInstanceById(processId);
// it is not null and have a value
if (processInstance != null) {
String executionId = processInstance.findActiveExecutionIn("*activity.investor.registeration.inquiry.suspend*").getId();
// the executionId is also not null and have the value.
if (executionId != null) {
executionService.signalExecutionById(executionId, getProcessVariables(parameters));
}
}
log.info("signal process state succeed!");
Neither *investor.inquiry.replied* nor *investor.inquiry.timeout* is not called and traversed by the workflow engine and the process remains again at "activity.investor.registeration.inquiry.suspend" state.
I should again notified that if there is not a timer in the wait state , on can signal it by the following code without any problem and it works:
executionService.signalExecutionById(processId, getProcessVariables(parameters));
But if there is timer in the wait state activity (like one that mentioned aboved) the calling of this method causes an exception and the message of due to this error that the current status of the process is *inactive-scope*.
Thanks
Soheil
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/553192#553192]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
Re: [jboss-user] [jBPM] - How to start/spawn 'n' subprocesses for 'n' users using JBPM-4.3.
by Maciej Swiderski
Maciej Swiderski [http://community.jboss.org/people/swiderski.maciej] replied to the discussion
"How to start/spawn 'n' subprocesses for 'n' users using JBPM-4.3."
To view the discussion, visit: http://community.jboss.org/message/553185#553185
--------------------------------------------------------------
You are looking for something like for-each activity that is of type multi instance. It is part of 4.4 release that is coming out in few days.
Based on the input (given as list, array, etc) it will create new instances of the activity which is following the for-each. Below you can find a code snippet that illustrates it:
<foreach var="department" in="#{departments}" g="111,60,48,48" name="foreach">
<transition to="Collect data"/>
</foreach>
<task candidate-groups="#{department}" g="201,58,92,52" name="Collect data">
<transition to="join1"/>
</task>
<join g="343,59,48,48" multiplicity="#{quorum}" name="join">
<transition to="end1"/>
</join>
In the example there will be a variable of type list available on runtime, let's assume that there will be four departments involved. Foreach will create 4 tasks, one for each department. At the and (join) you can use multiplicity attribute to control the flow, for instance you can say that once 3 departments did collect all data it is enough and process should not wait for the last one.
P.S.
Search development forum for some details about for each activity
HTH
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/553185#553185]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months