As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
taskService.complete(taskId, vars);
Workaround: - Use taskService.setvariablesLocal() or delegateTask.setVariableLocal() to ensure task-id is used in history, instead of passing the when calling "completeTask" - THe variables passed in taskService.complete are written to the process-instance indeed, this is normal behavior. By default (not using setVariableLocal) If there is no variable present for a given key in the task/execution, the parent is checked. If the value key is present on the parent it's set there. This goes on until the root of the execution-tree. If process-instance is reached and no child-executions contained the variable already, it's set on the process-instance.