[rules-users] Event-based Drools jBPM example?

dunnlow dunnlow at yahoo.com
Mon Oct 22 11:10:52 EDT 2012


Hi, 

I am struggling with using a process with *rule-based* flow.  I have seen
looked at the canned ("evaluation") example but it is not rule-based.  The
other examples I have found are really simple (like a print "HELLO" example)
where they just set up the "process," issue a fireallrules, then the node
triggers and process ends (basically just making a *decision *vice *process
*diagram -- but I could do that just using a few rules (rather than relying
on a process).

I envision setting up a true, event-based process flow to track a long
running business process.  Basically, a system generates events, sends them
to a jBPM process and that state (active node?) of that process changes as
appropriate.  (I will be making queries to determine the state of the
process - also will probably use jBPM console)

This seems like an obvious use-case, but I have been unable to find a simple
example of a *rule based* jBPM process that uses ONLY events.  For example

start ->  wait for event Message where message text = "HELLO", print "HELLO
received"  
        -> wait for event Message where message text = "THERE", print "THERE
received" 
        -> wait for event Message where message text = "JOE", print "JOE
received" 
        -> print "DONE"

Thus, I'd have a start and end node and three intermediate business rule
nodes.   I want this to be a true sequential process such that the second
node (ie the printing of "THERE") is not reached (doesn't activate?) before
an event is received where the text="HELLO".

I've tried setting this up and got an earlier recommendation of using a
"condition" in the metadata - but this seems a bit like a kludge when a
Business Rule node exists  (https://community.jboss.org/thread/205952). 
Also, in reality I'd like to be able to have some slightly complex business
rules in those nodes.

Can someone PLEASE point me to an example of this (or make a suggestion on
how to implement it)?

I'm also confused about how the fireallrules works.  When my system sends an
event and I insert it into my process, doesn't fireallnodes do just that -
send to all nodes thus basically breaking the whole "process flow"
methodology?

I thought I could add a rule that would ensure that the rule node was
"active" (thus per documentation not allowing the process to continue) by
putting a rule on node1 with a condition like 
   "when Message(text!="HELLO")"
But that still doesn't keep the second node from firing.

Sorry for the lengthy post.  Any other information/writeup about using rules
with a process I'd GREATLY appreciate.  (Obviously, I've been through the
JBoss web site documentation, 10 min tutorials, etc etc.)

Thanks!
-J









--
View this message in context: http://drools.46999.n3.nabble.com/Event-based-Drools-jBPM-example-tp4020421.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list