[rules-users] How to use Drools Flow?

XiaoMiTang dingyongchang at hotmail.com
Tue Aug 3 23:13:26 EDT 2010


Hi, Sony John:
My English is not good,so i can not explain well.
According to the previous mails,you can understand my confusion point.
If a work flow requires more than one person to finish it,like this:
(1)user A ask for a day's leave;
(2)user B approval it;
(3) An E-mail send to user A;
you can creat a *.rf file like this:

Start--->Action1--->Human Task--->Email--->End

In Action1,you can new an application form and add it to the DB using Java
code(this is your business logic,not Drools Flow's)

user A log in the system,run the code:
session.startProcess("……");
the work flow starts,an application form will be created and added to
DB,then,the flow reach the Human Task node, a task will be created and added
to DB.
user A log out.

user B log in.
user B claim and complete the task using Drools Flow's API:
client.claim(task.getId()…………)
//here,do something to approve the application form(your business logic),eg.
change the application form's
// state from 'wait' to 'approved' in DB or something else.
client.complete(task.getId()…………);
then,the work flow will go on,the email will be send automatically……

I just learned Drools a few days,can not guarantee that my understanding is
correct.
You can get some help here:
http://www.packtpub.com/article/drools-jboss-rules-5.0-flow-part2
http://www.packtpub.com/article/drools-jboss-rules-5.0-flow-part2 

You can also get some useful code here:
https://www.packtpub.com/support?nid=4009
https://www.packtpub.com/support?nid=4009 
Please notice the src under
\5647_Code\5647_Code\parent-1.0-examples\parent-1.0-examples\droolsBookParent\droolsFlow
Good luck~
XiaoMiTang
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Drools-Flow-tp1014591p1021183.html
Sent from the Drools - User mailing list archive at Nabble.com.




More information about the rules-users mailing list