Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created 
the discussion

"Re: Waiting for events to occur in a flow?"

To view the discussion, visit: https://community.jboss.org/message/762449#762449

--------------------------------------------------------------
First of all, how do you run the process - jbpm-console, unit test, custom 
application?

In general, to activate a rule you need to insert/update/retract facts to/from 
the session. Once rule is activated you can fire it using firellRules. 
> Jim Beam wrote:
>     a) in #1, why doesn't the first rule fire?  
> 
> 
I believe nothing was added to session so no activation took place so nothing 
to fire
> Jim Beam wrote:
>     b)   and Why/How does the process exit without a "Done" message?  (I 
> don't dispose of the ksession in my code)
> 
That depends on how you run the process - are you sure that process is 
completed? I think it resides in business rule task...


> Jim Beam wrote:
>     c) in #2, why does the fireallrules immediatly trigger the "Done" message?
This is the answer to part 2, as soon as you fire rules it will trigger 
business rule task to continue


> Jim Beam wrote:
>     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?
As far as I know business rule task does not wait for a condition to be met, it 
simply executes rules that are active at the time when rule task was executed.


> Jim Beam wrote:
>     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? 
> 
If you are looking for way of putting process instance into wait state until 
condition is met you should use intermediate conditional event instead of rule 
task. Conditional event will wait until defined condition is met and move on 
only when that condition is met. Take a look at the example  
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventCondition.bpmn2
 here.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/762449#762449]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to