Conditional start event explanations

451 views
Skip to first unread message

amart...@fbk.eu

unread,
Jul 15, 2016, 5:04:02 AM7/15/16
to jBPM Usage
Hi everybody,
  using Jbpm 6.4.0 Final and eclipse based modeler I'm trying to find a way to configure a conditional start event.

In particular using as condition for start this script, using a variable defined inside the process as condition to start or not the process

if (processVar1.equals("A")) {
return true;
}  else {
return false;
}

I've added the process, thanks for anyone want to help me !

I've tried to find any clues on that conditional start on documentation, with any luck, if there is a section about it, I'm ready to read and learn from it!
subProcess.bpmn2

Maciej Swiderski

unread,
Jul 15, 2016, 6:14:08 AM7/15/16
to amart...@fbk.eu, jBPM Usage
conditional events depends on external change in ksession. For example you can have a conditional start event that will start whenever new fact (e.g. Person) is added to working memory. You can’t rely on process variables because process variable does not exist as process instance is not there yet.

Maciej
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/f5f18482-f7f2-4676-9c0c-d3088121522e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<subProcess.bpmn2>

amart...@fbk.eu

unread,
Jul 15, 2016, 7:53:51 AM7/15/16
to jBPM Usage, amart...@fbk.eu
Thanks Maciej for quick explanation.

There is a tutorial/example on how compose a conditional start and add a new fact to working memory  ?

Maciej Swiderski

unread,
Jul 18, 2016, 5:27:13 AM7/18/16
to amart...@fbk.eu, jBPM Usage
I am not aware of any tutorial for it but it’s actually drools rule that needs to be matched. in conditional event definition you specify rule condition in (drl - drools rule language) that is then “monitoring” the working memory - ksession. So once you insert facts into that ksession when rule matches it will the start new process instance.

There are few test cases that you can take a look at:
this process starts whenever there is a new Person with name john found in working memory:

Maciej
Reply all
Reply to author
Forward
0 new messages