What is the diffrent bettween the UserTask.complete() method and FormService.submitUserTask() method

As the descriptions of the methos says they are can do the same thing to complete a userTask.
But thats make me confused why there are two way to complete a user task?

What is the different ?

Thaks you all.

complete() : Complete a task and update process variables.

submitUserTask() : Complete a task and update process variables using a form submit. There are two difference between this method and the complete method:

  • If the task is in state PENDING - ie. has been delegated before, it is not completed but resolved. Otherwise it will be completed.

  • If the task has Form Field Metadata defined, the process engine will perform backend validation for any form fields which have validators defined.

1 Like

Thank you.