Re: [rules-users] How to use Drools Flow?

2010-08-03 Thread Mauricio Salatino
Hi guys,
You can accomplish your use case following the steps that diego mention.
Take a look at the documentation and at the Human Task module to see how to
use it.
If your process will run for long periods, you will need to take a look on
persistence configuration also.
Greetings.

On Mon, Aug 2, 2010 at 11:28 PM, XiaoMiTang dingyongch...@hotmail.comwrote:


 hi diego,thank u for your reply.

 As far as I understand, we start the work flow using the code:

 session.startProcess(……);

 Once it starts,it runs from Start node to End node~

 User A runs the code session.startProcess(……),the work flow starts,runs
 step by step:

 (1)Human Task assigned to user A   what you will do with this? create
 a new task and add it to DB?

 (2)Action1

 (3) now,it must be stopped,because of the remaining work should be done by
 user B,so user A log out.



 Several days later,user B log in,he completes the task ,can the work flow
 be
 finished automatically?

 if can not ,how do I make the rest the workflow can be completed?

 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Drools-Flow-tp1014591p1017862.html
 Sent from the Drools - User mailing list archive at Nabble.com.

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use Drools Flow?

2010-08-03 Thread sony . john
Hi Xiao ,
Could you explain to me also how done the workflow , becuase iam also
looking same solutions.
If you have sample code please update tha too.
Regards
Sony John


   
 XiaoMiTang
 dingyongch...@ho 
 tmail.com To 
 Sent by:  rules-users@lists.jboss.org 
 rules-users-bounc  cc 
 e...@lists.jboss.or 
 g Subject 
   Re: [rules-users] How to use Drools 
   Flow?   
 08/04/2010 09:38  
 AM
   
   
 Please respond to 
 Rules Users List  
 rules-us...@list 
   s.jboss.org
   
   





I have omitted DefaultProcessEventListener,so the workflow can not be
finished automatically when user B finished the task.
now all is ok,thank you~
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Drools-Flow-tp1014591p1021025.html

Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__


Information in this e-mail is intended solely for the person(s) to whom it is 
addressed and may contain confidential information. If you are not the intended 
recipient, please notify the sender and delete this e-mail message and any 
other record of it from your system immediately. You should not disclose or 
disseminate the information to any person, use it for any purpose or store or 
copy the information in any form or manner.  
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use Drools Flow?

2010-08-03 Thread XiaoMiTang

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.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use Drools Flow?

2010-08-02 Thread XiaoMiTang

I have taken a look at the Human Task ,but i can not understand it.
The ruleflow.rf  file should be split into two ?
=  ruleflow.rf  = 
Start---Action1(need user A to do it)Action2(need user B to do
it)--Email--End 
==

sub1.rf:  Start---Action1(need user A to do it)End
sub2.rf:  Start---Action2(need user B to do it)--Email--End 

User A log in , execute the code:
session.startProcess(com.sample.sub1); 
In action1,create a task by Human task management component:
Task task1 = new Task();
……
client.addTask(task1, null, addTaskResponseHandler);

Then, user B log in,execute:
session.startProcess(com.sample.sub2); 
in action2,do something like this:
client.start(task.getId(), user B, operationResponseHandler);
……
client.complete(task.getId(), user B, null, operationResponseHandler);

 Maybe this can work out the problem,but it is too clumsy.
How to use a Human Task node in the *.rf file? is there an example?


-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Drools-Flow-tp1014591p1014882.html
Sent from the Drools - User mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use Drools Flow?

2010-08-02 Thread Diego López León
On Mon, Aug 2, 2010 at 6:45 AM, XiaoMiTang dingyongch...@hotmail.com wrote:

 I have taken a look at the Human Task ,but i can not understand it.
 The ruleflow.rf  file should be split into two ?
 =  ruleflow.rf  =
 Start---Action1(need user A to do it)Action2(need user B to do
 it)--Email--End
 ==

 sub1.rf:  Start---Action1(need user A to do it)End
 sub2.rf:  Start---Action2(need user B to do it)--Email--End

 User A log in , execute the code:
 session.startProcess(com.sample.sub1);
 In action1,create a task by Human task management component:
 Task task1 = new Task();
 ……
 client.addTask(task1, null, addTaskResponseHandler);

 Then, user B log in,execute:
 session.startProcess(com.sample.sub2);
 in action2,do something like this:
 client.start(task.getId(), user B, operationResponseHandler);
 ……
 client.complete(task.getId(), user B, null, operationResponseHandler);

  Maybe this can work out the problem,but it is too clumsy.
 How to use a Human Task node in the *.rf file? is there an example?


I would do something like

Start---Human Task assigned to user A---Action1Human Task
assigned to user B---Action2--Email--End

wdyt?

-- 
diego

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use Drools Flow?

2010-08-02 Thread XiaoMiTang

hi diego,thank u for your reply.

As far as I understand, we start the work flow using the code:

session.startProcess(……);

Once it starts,it runs from Start node to End node~

User A runs the code session.startProcess(……),the work flow starts,runs
step by step:

(1)Human Task assigned to user A   what you will do with this? create
a new task and add it to DB?

(2)Action1

(3) now,it must be stopped,because of the remaining work should be done by
user B,so user A log out.



Several days later,user B log in,he completes the task ,can the work flow be
finished automatically?

if can not ,how do I make the rest the workflow can be completed?

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Drools-Flow-tp1014591p1017862.html
Sent from the Drools - User mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to use Drools Flow?

2010-08-01 Thread XiaoMiTang

Hi, I am tring to use Drools Flow in a B/S project,but get in trouble.
a simple ruleflow.rf  file like this:
===Start
Start--Action-Email-End
End==

User A log in the system by a browser,press a button,execute the code below:

StatefulKnowledgeSession session = 
session.startProcess(com.sample.ruleflow);

it works ok. the Action has been done,the Email has been sent, the whole
of flow was finished.


the problem is how to do with the .rf file like this?
==
Start---Action1(need user A to do it)Action2(need user B to do
it)--Email--End
==

Can anyone please give me an idea ?
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-use-Drools-Flow-tp1014591p1014591.html
Sent from the Drools - User mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use Drools Flow?

2010-08-01 Thread Diego López León
On Mon, Aug 2, 2010 at 12:37 AM, XiaoMiTang dingyongch...@hotmail.com wrote:

 Hi, I am tring to use Drools Flow in a B/S project,but get in trouble.
 a simple ruleflow.rf  file like this:
 ===Start
 Start--Action-Email-End
 End==

 User A log in the system by a browser,press a button,execute the code below:
 
 StatefulKnowledgeSession session = 
 session.startProcess(com.sample.ruleflow);
 
 it works ok. the Action has been done,the Email has been sent, the whole
 of flow was finished.


 the problem is how to do with the .rf file like this?
 ==
 Start---Action1(need user A to do it)Action2(need user B to do
 it)--Email--End
 ==

 Can anyone please give me an idea ?

Hi Xiao,
have you taken a look at the Human Task concept in BPMs?
The official documentation[0] has a whole chapter explaining the way
Flow handles it.

Hope it helps.

[0]: 
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html/ch.Human_Tasks.html

-- 
diego

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users