cancel
Showing results for 
Search instead for 
Did you mean: 

How to store and retrieve process instance variable values in explorer tasks ?

hari
Star Contributor
Star Contributor
All,

I would like to know
1) How I can store the value to a process instance variable from a user task ?
2) How I can show the value of a process instance variable in a user task ?

I am using activiti explorer only. We are not implementing any custom forms or inboxes at this moment for our customer.

Thanks in advance.

Regards,
Hari.
5 REPLIES 5

hari
Star Contributor
Star Contributor
3) To add to the above questions, I also want to understand how I can add process instance variables to my process which will be started by a user in the activiti explorer itself.

What I meant by questions 1 and 2 is when I have the process instance variables available in bpm, how I can store and retrieve values from them in explorer forms built using form properties.

Thanks,
Hari.

hari
Star Contributor
Star Contributor
I found answer to my 2nd and 3rd questions. I have added a service task and have added the below code to it.

public void execute(DelegateExecution execution) throws Exception {
  execution.setVariable("hari", "Hari");
}
This way I was able to show the process variable information on the activiti-explorer.

I am still trying to find answer to my question#1.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Hari,

have a look on org.activiti.engine.test.api.task.TaskServiceTest#testCompleteWithParametersTaskin activiti source.

Regards
Martin

hari
Star Contributor
Star Contributor
Hi Martin,

The task will be completed by the user in activiti-explorer.
My goal is to capture the users input into a process instance variable.

Thanks,
Hari.

jbarrez
Star Contributor
Star Contributor
All form values are stored as process variables, so putting them on the form automatically makes it a process variable.