cancel
Showing results for 
Search instead for 
Did you mean: 

Overide UserTask with default complete status programmatical

prasad1
Champ in-the-making
Champ in-the-making
I am required to implement user task in an activiti workflow programmatically.  Is it possible to implement the user task with default success status and go ahead with execution of further tasks?  For instance: there are 2 tasks: START ->USERTASK->SERVICE->END
I want the usertask should not block the execution, instead it should return a default complete status and go ahead with the execution of service task.
2 REPLIES 2

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Look at the examples and testcases. Especially the testcases/examples for the usertasks. Most will be 'completed' programatically.

mgriffith
Champ in-the-making
Champ in-the-making
If you have a reference to the taskId and the TaskService, you can simply mark the task complete:

TaskService taskService= processEngine.getTaskService();
Task task = taskService.createTaskQuery().processVariableValueEquals("taskId", taskId).singleResult();
taskService.complete(task.getId());