How can i pass values to parameters of user tasks?

cancel
Showing results for 
Search instead for 
Did you mean: 
vamsinipun
Established Member

How can i pass values to parameters of user tasks?

Hi Team,

     I designed a simple process like as below. here we have two user tasks. each task has frame with some fields.

     

     

I am using this process in spring framework. i started the process by using 

runtimeService.startProcessInstanceByKey("additionJavaExample");

at start event.

In my spring controller, display the page for user inputs ( taking two numbers for addition ) when the process started. after getting inputs for first user task, how can i pass those values to that?

I am new to activiti framework here please help me out this.

2 Replies
fegor
Senior Member

Re: How can i pass values to parameters of user tasks?

Hi!, 

Use a script task with the calculous, p.e.:

In Script Task (javascript):

var n1 = execution.getVariable("numberone");
var n2 = execution.getVariable("numbertwo");
var res = parseInt(n1) + parseInt(n2);

execution.setVariable("varRes", res.toString());

In form Result:

Best regards,

fegor

vamsinipun
Established Member

Re: How can i pass values to parameters of user tasks?

Thank you for your reply