how do i set the variables in the class MyAssignmentHandler
<userTask id="task1" name="My task" >
<extensionElements>
<activiti:taskListener event="create" class="org.activiti.MyAssignmentHandler" />
</extensionElements>
</userTask>
@Override
public void notify(DelegateTask delegateTask) {
delegateTask.setDescription("Purchase Order Task");
delegateTask.createVariableLocal("NumberAttribute1",delegateTask.getExecution().getVariable("puchaseOrderId"));
}
But this doesnt seem to work because my test case is not able to retrieve the task based on the variable set.
List<Task> taskList = taskService.createTaskQuery()//.list();
.taskVariableValueEquals("NumberAttribute1", purchaseOrderId).list();
This does not give me any results.
But if I do
List<Task> taskList = taskService.createTaskQuery().list();
It gives me the task created…
Any advice is welcome??