AnsweredAssumed Answered

Couldn't get task by processInstanceId

Question asked by xuemzhan on Jul 27, 2016
Latest reply on Jul 27, 2016 by xuemzhan
Hi exports,

1. I created a activitiManager service class wrapped activiti api in SprintMVC service layer.
2. Started a new instance by key definition.
3. Get the current task by instance id which was created in step 2.
4. Submitted the task via formService.submitTaskFormData method.

So here is the problem, steps 2-4 are in the same method, I couldn't get the current task in step 2. But I could get it when I set a break point in debugging mode.

step 2. processInstanceId= activitiManager.instanceProcessByKey(INSTANCE_KEY, currentId.toString(), keyCode, variables);
step 3. curTask = activitiManager.getActiveTaskByProcessInstanceId(processInstanceId);