I'm using flowable and I have this process:
I would like to know, how can I programatically end Task A and then invoke Task B? Is there a way to do that?
P.S. Sorry, very new to using Flowable!
I'm using flowable and I have this process:
I would like to know, how can I programatically end Task A and then invoke Task B? Is there a way to do that?
P.S. Sorry, very new to using Flowable!
In order to programatically complete a task in Flowable you can use the TaskService
.
You can query for a task using the TaskQuery
through TaskService#createTaskQuery
and then use TaskService#complete(taskId, variables)
e.g.
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).taskName("Task A").singleResult();
Map<String, Object> variables = new HashMap<>();
taskService.complete(task.getId(), variables);
task = taskService.createTaskQuery().processInstanceId(processInstanceId).taskName("Task B").singleResult();
variables = new HashMap<>();
taskService.complete(task.getId(), variables);
You can to use API REST out-to-box of Flowable to do this! or create your custom API to call this services.