I think I spot a bug in Activiti Engine (still present in the latest version to date, 5.16.3).
The javadoc says "resolveTask" can only be done for task whose delegation state is pending. Here the excerpt:
"void resolveTask(String taskId) Marks that the assignee is done with this task and that it can be send back to the owner. Can only be called when this task is DelegationState.PENDING delegation. After this method returns, the delegationState is set to DelegationState.RESOLVED."
But, when I tried this (using REST API) on a task whose delegationState is null, it returned, without error:
And I could see the delegationStatus of the task is now set to "resolved" (plus, the "assignee" field is set to the same value as the owner. Originally it was null).
Based on the javadoc, I was expecting a different behaviour (I was expecting that the "resolve" action would fail).
Yes that's not correct. Right now it's not checked if the delegation state is actually pending. We should do that. Could you raise a JIRA issue for this?