-
1. Re: fork problem. How execute fork-state completely?
bgrissom Oct 10, 2005 7:29 PM (in response to postponed)Hi,
I may not fully understand your problem, but I have run into something similar. Do your transitions all branch from a single state? If you have a node with multiple exiting transitions then you will observe the behavior you described. You need to use a fork node. In that case multiple tokens will be created and your graph will be traversed correctly. I hope that helps. If not can you illistrate your graph or show your XML?
B Grissom -
2. Re: fork problem. How execute fork-state completely?
postponed Oct 11, 2005 3:18 AM (in response to postponed)no, I'm using fork-node! part of process-def-n here:
<start-state name="start-state"> <transition to="fork" > </transition> </start-state> <fork name="fork"> <transition name="to logging" to="logging" /> <transition name="to authority" to="authority"/> </fork> <state name="logging" > <transition name = "to join" to="join"> <action class="org.jbpm.billing.LoggingHandler"/> </transition> </state> <state name="authority"> <transition to="rating process"> <action class="org.jbpm.billing.AuthorityHandler"/> </transition> </state> <state name="rating process"> ....
Then, in my application I create a jbpmSession, etc. :... JbpmSession jbpmSession = JbpmSessionFactory.getInstance().openJbpmSession(); ProcessDefinition processDefinition = jbpmSession.getGraphSession().findLatestProcessDefinition("some process"); ProcessInstance processInstance = new ProcessInstance(processDefinition); ContextInstance contextInstance = processInstance.getContextInstance(); contextInstance.addVariables((Map) map); while(!processInstance.hasEnded()) { processInstance.signal(); System.out.println("signal");} jbpmSession.close();
- with this code I receive to stdout a small of this messages about signal. - Only for start-tate.then fork. Logging. join. an so on in this branch of
fork. while not receive end-state. But not branch with "authority" and so
on! AuthorityHandler is not executed!:(
Maybe I just dont understand jpdl..((
Thank you for answer. ) -
3. Re: fork problem. How execute fork-state completely?
postponed Oct 12, 2005 3:52 AM (in response to postponed)please somebody help me!..
it's my last hope -this forum -
4. Re: fork problem. How execute fork-state completely?
kukeltje Oct 12, 2005 9:28 AM (in response to postponed)look at the testcase for forks. You'll see there that in a fork multiple tokens are created and you have to signal each of them individually.
-
5. Re: fork problem. How execute fork-state completely?
postponed Oct 12, 2005 3:11 PM (in response to postponed)ok.and what else about process-state? ammm.. decision also didn't work.. - all of this write by hands? Why? jbpm2 has this ability -
...invocationLog.getProcessInstance(); beanName.endOfState...
Why in last version of product I have to write it "individually"?%) I dont want think about it) I want to have simple method which can signals all of the child tokens.. and so on..
I write it just as ordinary user.. i'm sorry if it seems crude -
6. Re: fork problem. How execute fork-state completely?
kukeltje Oct 12, 2005 3:19 PM (in response to postponed)Since it is not 'common' to have a fork and with one trigger signal all sister/brother tokens. If you want a simple method to signal all tokens, create a class, where you pass a token, get the parent token and iterate over all child tokens. You only have to write it once.
I do not understand your remark about decision? You want to signal the decision? -
7. Re: fork problem. How execute fork-state completely?
postponed Oct 13, 2005 2:34 AM (in response to postponed)yes.. execution of desicion state has troubles too - when I just signal it. And process-state of cource too. Transition is chosen in handler, but token didnt "go" to it.
My question was: why didnt You "write it once more"? Cause it's not common task?
but for me (and maybe for other users) it isn't "common" .. -
8. Re: fork problem. How execute fork-state completely?
kukeltje Oct 13, 2005 4:54 AM (in response to postponed)"postponed" wrote:
but for me (and maybe for other users) it isn't "common" ..
I think you mean it *is* common? right?
Can you give an example where you want to have a fork and signal all parallel nodes at once from the outside? Maybe there are other ways of modelling this. -
9. Re: fork problem. How execute fork-state completely?
aparna.krishna Nov 4, 2005 9:38 AM (in response to postponed)Hi
Were you able to solve the fork problem? I am in a similar situation too. I want all the child nodes (from the fork) to be traversed.
Thanks in advance.. -
10. Re: fork problem. How execute fork-state completely?
dharraj Nov 4, 2005 6:50 PM (in response to postponed)Hello,
Did anybody have a good solution to this problem?
Please reply.
Thanks -
11. Re: fork problem. How execute fork-state completely?
tom.baeyens Nov 5, 2005 3:05 AM (in response to postponed)i didn't read the whole thread so ignore if it was already solved. just replying to the original problem.
the problem is that jbpm does not throw an exception when you signal a token that is in a fork. in that case the parent token will take the first leaving transition (maybe we should reconsider and throw an exception instead). you should add an extra check: if there are unfinished child-tokens, you should signal those and not the parent...
does this help ?
regards, tom.