[jBPM] - Waiting for events to occur in a flow?
by Jim Beam
Jim Beam [https://community.jboss.org/people/jamesbeam] created the discussion
"Waiting for events to occur in a flow?"
To view the discussion, visit: https://community.jboss.org/message/762276#762276
--------------------------------------------------------------
I'm a flow noob (...obviously) using 5.3.
I have a few examples working and am trying to integrate some rules. I think I have a fundamental misunderstanding of rule tasks (maybe flow). Basically, I want to have a more complicated process and I want to only advance to the next node when a certain set of conditions are met.
To set up a simple test, I have a flow, *start node->rule task->script task (writes "Done")-> end node*. I don't want to get to the script task until the process receives a message with text='hi' or text='yo'. I set up the following ruleflow group (I have a Message and MessageB class):
rule "waitforit rule"
ruleflow-group "waitforMessage"
dialect "mvel"
when
not ($m : Message())
then
System.out.println("no message yet");
end;
rule "dotone"
ruleflow-group "waitforMessage"
dialect "mvel"
when
$m : Message(text=='hi' || text=='yo')
then
System.out.println("got message:"+$m.text);
end;
I tried:
1) I start the process and insert a MessageB object (i see hibernate update the session). I expected the first rule to fire, but it does not. Then I insert a Message object and the process/app just exits (WITHOUT) giving me the "Done" message (i have a thread.sleep after the insert - and no dispose).
2) So, I start the process and do a fireallrules, wait 10 seconds then insert a Message object. But, as soon as I fireallrules, I get the "no message yet" message AND the "Done" message. Nothing happens for 10 seconds and then the process ends.
So, I have just one question....in 6 parts:
a) in #1, why doesn't the first rule fire?
b) and Why/How does the process exit without a "Done" message? (I don't dispose of the ksession in my code)
c) in #2, why does the fireallrules immediatly trigger the "Done" message?
d) as I read it in the documentation, the rule task should keep the process from advancing until all of the rules are no longer active. However, I thought the first rule would ensure that the group was active until a Message arives. Is that wrong?
e) what is the right way to do this sort of thing?
f) Can someone clue me into what I am doing wrong? Am I thinking about this in the wrong way?
Thanks very much for your thoughts/comments.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/762276#762276]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months
[jBPM] - jbpm5 inside my own application
by barbosasalexand
barbosasalexand [https://community.jboss.org/people/barbosasalexand] created the discussion
"jbpm5 inside my own application"
To view the discussion, visit: https://community.jboss.org/message/733242#733242
--------------------------------------------------------------
Hi.
A few days ago I heard about jbpm5 and after reading some of the available documentation, I had some doubts on how to integrate jbpm5 in my own application.
The example I saw showed a preview of contents over Guvnor repository and showed too the editor/designer, in a specific web application (I think the example I saw was done in seam), but what Iwould like to know is how to integrate the process itself, eg, users make logging into the web application and see the tasks that need to run and clicking on them appears a form (form jbpm or something more specific of the application, for example with the graphical aspect of the same application) with the task information, fields to fill and instructions to perform in the step, etc... , as defined in the process.
Can anyone help me clarify this doubt.
Thank you.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/733242#733242]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months