Human Task in jBPM using Guvnor

Hello all here is my post on jBPM Human Task using Guvnor.
1. After you have installed the complete setup of jBPM 5.4 please run “ant start.demo.noeclipse”.
2. Open browser and create “http://localhost:8080/drools-guvnor/”.
3. In the “KnowledgeBase” please create jBPM process file in the “default package”.

HumanTask

I used two Script Tasks to set the variables and two User Tasks.Script tasks are necessary because a Human Task can have only a single input parameter, “Content”.To pass multiple variables “Content” must be set to a map that contains all the variables.

In the first scipt task code the following content.

map = new java.util.HashMap();
kcontext.setVariable("map",map);
kcontext.setVariable("itemNumber",itemNumber);
kcontext.setVariable("quantity",quantity);
kcontext.setVariable("unitPrice", unitPrice);
kcontext.setVariable("requestedDate",requestedDate);

4. Set ActorId to “krisv”.(this means we are assigning the human task to krisv)
5. Parameter = “Content”, Value = “map”
6. declare the dataOutVariables and assign them to global variables.
This will allow us to use variables inside the Human Task Form.Open the result mapping editor and add a mapping of the returned values.

7.In the next HumanTask assign this to “john” to review and accept the order raised by “krisv” once the order is approved it will be closed and instance is destroyed automatically.

watch the video tutorial on http://youtu.be/Q3MHdtI9Jh0

Happy coding and jBPM 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s