The jBPM-4.3 already support drools integartion. You could use RulesActivity directly.
If you want to let all the child executions of a forkActivity running parallel, you could set continue attribute like below:
<transition name="A" to="A"/>
<transition name="B" to="B"/>
<java name="A" continue="async"/>
<java name="B" continue="async"/>
Thank you for your reply. But as I am new to JBPM, can you please give an example of using drools from JBPM.
Regarding my requirement, the main process should start the subprocess and the main process should continue execution. I am not talking about parallely executing two subprocess.
And also the main criteria is, the main process should continue processing one main task untill and unless the two subprocess done the other two tasks.
Can you please let me know about this.
Thank You very much,
Felix K Jose
Of course, I can give you a sample with RulesActivity. I put the jpdl.xml and dsl files in attach. You can have a try.
By the way, I can't make sure what you want to do in process. You say the main process will start a sub process, but there is not a parallel gateway. Then the main process could still keep running and do some task(I don't known what task should be set here for you, human Task or Service Task?) At the end, the main process could using some technology to notice that both of sub process have been done( I can only see one sub process be created in above? Where is the other sub process comes from?). Because there is so many unclearly issues, I can't make a process for you, maybe you could show me more details.
And it is too late, I have to go to bed, see you next day.
Xu Hui Sheng
x15rule.zip 605 bytes
in addition to example given by Huisheng Xu you can find some interesting information about rules and rules decision activity in dev guide:
I am nit sure I got your point but in my opinion you could do it with fork and join. Meaning that to execute a subprocess and main process in pararell you use fork where one branch is the subprocess and the other is main path. After you join them and do it quite the same for second subprocess. That way execution will wait in join until both branches are finished.
Thank You very much Huisheng for the reply and for the attached drool sample.
And more about my requirement is as follows:
I am having a Research web page (html) in that there are 3 entities. The first entity is the primary entity and the other two entities are secondary entities.
In JBPM I am starting a process (i.e., the main process) that opens up the web page for researching the entities present in that. As the web page is having three entities. The research on the primary entity should execute with the main process and the research on the other two entities should execute with two sub process.
I have tried to execute them by using fork.
<fork name="researchFork" g="711,140,48,48">
<transition name="to primary entity research" to="primaryEntityResearch" g="660,164:-31,-18"/>----Main process node is primaryEntityResearch
<transition name="to first secondary entity research" to="firstSecondaryEntityResearch" g="860,164:-97,-23"/>----Subprocess1 is firstSecondaryEntityResearch
<transition name="to second secondary entity research" to="secondSecondaryEntityResearch" g="860,164:-97,-23"/>-----Subprocess2 is firstSecondaryEntityResearch
I have attached the process definition snippet with this.
But if we use fork then the completed processes will wait in the join of it for the other process to complete. But my aim is as soon as the two subprocesses get completed those should come to the primary entity research node (the main process node in the fork) and then only the main process node i.e., the primary entity research node should end.
Also can you please give me a solution how can we use fork without join so that the completed tasks don’t need to wait in the join to complete the other forked jobs(processes).
Also can you please give me some example of different usage of task node?
TEST_ddr request.jpdl.xml 1.9 KB
Thank you very much for the reply you have given and also please find the requiremnt I have given in the other reply. And please give me an answer for the same.
You want to let some branches of process executed parallel, when two sub processes has completed, they will tell the main process the results. Am I right?
So if main process are quicker than two sub processes, will the whole process ended or the main process will wait for two sub process completing then end the whole process?
If the main process must wait for two sub processes, you could use fork and join to implement this, otherwise, we have find another way to do this.
Yes, when two sub processes has completed, they should tell the main process the results. The main process will not quicker than the two sub processes.
So can you please give me some solution on the same?
Thank You Very much,
Felix K Jose
1 of 1 people found this helpful
Because of the complexity for implementing sending messages between difference executions, I suggest you using simple fork/join to implement your requirement.
If you don't want to use fork/join, then you can consider this solution.
Create a thread and store main process id and its sub process ids, then let the thread checks when sub process ends. Once the thread finds a sub processed had ended, it could send a message to main process. The problem is you must control thread's lifecycle all be yourself, and have to prepare to handle the exception occured on process executing. It is mostly like a real time monitor management system. If you really want to do this, please make a good plan first.
Thank you Huisheng for your reply. I will try your solution but it is a little difficult. And please let me know if anybody get anyother solution on this. PLease anybody please help as I am struggling with this for a long time.....
Thank You very much,
Felix K Jose