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.
TaskService
You can query for a task using the TaskQuery through TaskService#createTaskQuery and then use TaskService#complete(taskId, variables)
TaskQuery
TaskService#createTaskQuery
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);
If you embed flowable engine in your spring boot, you will use flowable SDK to update status (see Filip's reply)
If you deploy flowable as standalone server, you will use REST API to update status (See horelvis' reply)
Copyright © 2021 Jogjafile Inc.
In order to programatically complete a task in Flowable you can use the
TaskService
.You can query for a task using the
TaskQuery
throughTaskService#createTaskQuery
and then useTaskService#complete(taskId, variables)
e.g.