you could use this method from TaskService:
<code>
/**
* Called when the task is successfully executed,
* and the required task parameters are given by the end-user.
* @param taskId the id of the task to complete, cannot be null.
* @param variables task parameters. May be null or empty.
* @throws ActivitiObjectNotFoundException when no task exists with the given id.
*/
void complete(String taskId, Map<String, Object> variables);
</code>