Set Priority when starting a processinstance

Showing results for 
Search instead for 
Did you mean: 
Member II

Set Priority when starting a processinstance

The way the process start is a list of objects and each object has a single process and the flow starts with a service task.

Map variableMap = new HashMap();

ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("imageProcess", variableMap);

How can i use this priority to set the priority of the task, As my first step is a service task and the second user task is based on the priority
1 Reply
Senior Member II

Re: Set Priority when starting a processinstance

Assuming that you are talking about the priority attribute on a User Task, you can set the priority using expression. An example below..


<userTask id="user-task" activiti:assignee="assignee" activitiSmiley Tongueriority="${priority}">

You can also do this programmatically using listeners such as event listener, task listener etc upon task creation