-
1. Re: How to do automatic transition from one state node to any other node
rebody Apr 22, 2010 8:23 PM (in response to felixkjose)Hi Felix,
If you want to make execution go through next actvity automaticly, why not use a automaticActivity like JavaScript or ScriptActivity. The StateActivity is used to wait a external message from outside of the process engine. What are you waiting for in this scenario?
-
2. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 23, 2010 12:27 AM (in response to rebody)Hi Huisheng,
I have to maintain the different states(open, being review, research, reviewed, completed,rejected, closed) in my workflow. Without state nodes how can I maintain the states? That is the reason behind using state nodes.
If you have any clues on this please let me know.
Thank you very much,
With Regards,
Felix K Jose
-
3. Re: How to do automatic transition from one state node to any other node
rebody Apr 23, 2010 12:54 AM (in response to felixkjose)1 of 1 people found this helpfulHi Felix,
OK, I know you want to use jBPM as a FSM. But the StateActivity is not a place to change the state of business information. You should understand the usage of StateActivity, it is used to wait for a external message from outside the process engine.
If you want to maintain the state of business information, you could use the JavaActivity or ScriptActivity, both of them can do what you want, and they can go on execute.
-
4. Re: How to do automatic transition from one state node to any other node
rebody Apr 23, 2010 1:07 AM (in response to felixkjose)Hi Felix,
I guess the key of problem is What you really want to do? You never tell us that, just ask where is the ActionHandler, how could we use ActionHandler to let process go on execute. If we still focus on how to implement a operation, I am afraid we could never find a solution.
From your description, I think you would better use TaskActivity to replace StateActivity. Because in fact, what you want to do is let a document or a contract or something else to be reviewed, to be researched, to be completed or to be closed. There must have someone to do these jobs. So we could use TaskActivity to create a task to these people and let process waiting for people operations. When the people complete his task, related process will be signal to the next step.
-
5. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 23, 2010 5:42 AM (in response to rebody)Hi Huisheng,
Whatever you have told is correct. My requirement is to verify a form(web page) And I am having 3 actors 1. User(who creates this form) , 2. Analyst (who analysing the page), 3. Reviwer( who reviews the page)
So when a User submits a page then it should assign to an Analyst and the Analyst should do the analysis (some business logic)and he can send it to either review or reject. When Analyst send it to Review then the page should assign to a Reviewer. And the reviewer should start review the page (some business logic) and the if he needs more information again send it to Analyst who can give the additional information andf then again it should send to Reviewer.In the other hand the Reviewer can either close(end) or reject the review.
So as you told I have to maintain the states also here( like open, being reviewed, reviewed, completed, etc..). So for doing this which node we can use either state, task or java or custom.
I think now you got my requiremnt and so please lhelp me on the solution.
Thank you Huisheng for your patience. And I am expecting some more help from you .
With Regads,
Felix K Jose
-
6. Re: How to do automatic transition from one state node to any other node
rebody Apr 23, 2010 6:05 AM (in response to felixkjose)Hi Felix,
It is clearly enough. I make a process definition to demostrate your requirement. You can see it in the attach.
-
process.png 9.9 KB
-
process.jpdl.xml 735 bytes
-
-
7. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 23, 2010 6:25 AM (in response to rebody)Hi Huisheng,
Thank you for the reply.Very sorry to disturb you. As I mentioned how can the states maintain? And also for transition from one task node to another we need some signaling,right? How can we obtain that?
Thank you and Regards,
Felix Jose
-
8. Re: How to do automatic transition from one state node to any other node
swiderski.maciej Apr 23, 2010 7:33 AM (in response to felixkjose)Hi,
in general when we are talking about task nodes, transition will be taken as soon as user (assigned to it) will complete the task.
To keep state information you can use task/process variables.
To make automatic transition from wait state to any other you can user timer transition.
HTH
Maciej
-
9. Re: How to do automatic transition from one state node to any other node
rebody Apr 23, 2010 7:42 AM (in response to felixkjose)Hi Felix,
Here is the TestCase for you to understand how TaskActivity work.
And I suggest you to watch this demo video, to understand how a process work.
-
process.png 9.9 KB
-
process.jpdl.xml 791 bytes
-
ProcessTest.java.zip 683 bytes
-
-
10. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 24, 2010 2:05 PM (in response to rebody)Hi Huisheng,
Thank you so much for your answer. My requirement almost got answered. But I am having one more doubt, how can we have the business logic (that should be in java classes) with task nodes? My doubt is how we have business logic in task nodes?
I really worried to ask so much questions but I think with you peoples help only I can understan JBPM in depth and complete my project successfully.
Once again thank you,
Thank you very much ,
WithRegards,
Felix K Jose
-
11. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 24, 2010 2:08 PM (in response to swiderski.maciej)Hi Maceij,
Thanks alot for you reply. And please send some links if available regarding the task nodes. And some tough samples that using task nodes.
Thank you and Regards,
Felix K Jose
-
12. Re: How to do automatic transition from one state node to any other node
rebody Apr 24, 2010 10:54 PM (in response to felixkjose)Hi Felix,
You shouldn't put business logic into process engine. You could handle business logic in your class, then invoke the process engine to continue the process. Also you should handle the state of document in your class, not process engine. The only job of process engine is running through the graphic, when it arrived a TaskActivity, it will create a task, then you could do some related operation. Show these tasks to end users, when end users complete a task, you could do some business logic, like save data into database, then invoke the api of process engine, let process engine know which next step we will take.
-
13. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 25, 2010 2:14 AM (in response to rebody)Hi Huisheng,
Thanks alot. One thing can you please send me a sample application that is having atleast one task node which is having the end user assinged(swimlane) and the java classes which are doing some business logic (as you mentioned). A simple standalone program. Please help me.
Thank you and Regards,
Felix K Jose
-
14. Re: How to do automatic transition from one state node to any other node
felixkjose Apr 26, 2010 1:57 AM (in response to rebody)Hi Huisheng,
When the control comes in the task node "analyse" from "create form" how come the business logic(eg.: Analyser.java) get executed?
For example:
<task g='93,93,90,50' name='create form' assignee="publisher">
<transition to='analyse'/>
</task>
<task g='213,93,90,50' name='analyse' assignee="analyzer">
<transition name='review' g='-21,-22' to='review'/>
<transition name='reject' g='258,42:56,-2' to='end 2'/>
</task>
when the control flow comes in the analyse task we need execute some business logic (eg.: Analyser.java)to analyse the form.
How can I do that. Which will call Analyser.java class? Once the execution of that class gets over how the transition occurs to the next task?
Analyser.java
public class Analyser{
public String analyse()
{
String country = form.getCountry();
if(null!=country||""!=country)
{
return "review"
}
else
{
return "reject"
}
}
Can you please give a reply an answer to the same as soon as possible? Please..
Thank You very much,
With Regards,
Felix K Jose