JBoss Community

Re: Waiting for events to occur in a flow?

created by Maciej Swiderski in jBPM - View the full discussion

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 here.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community