1

I'm using flowable and I have this process: enter image description here

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!

Jan Galinski
  • 11,768
  • 8
  • 54
  • 77
code_learner93
  • 571
  • 5
  • 12

2 Answers2

2

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);
Filip
  • 19,269
  • 7
  • 51
  • 60
0

You can to use API REST out-to-box of Flowable to do this! or create your custom API to call this services.

LINK TO API REST FLOWABLE

horelvis
  • 125
  • 5