0
votes

We are using Camunda REST-API.

Suppose there is a process-definition with work-flow as follows :
Start Event --> User-Task A --> User-Task B --> User-Task C --> End Event

Say, one of my process-instance is at user-Task B.

Is there any possible way (by calling Camunda REST-API) to know :

  1. Completed tasks for a process-instance (User-Task A in the above case).
  2. All the tasks that are part of the process-definition (User-Task A, User-Task B, User-Task C in the above case).


What I'm aware of:

  1. One can get the bpm xml file and accordingly parse it to fetch ALL the tasks.
  2. BPMN Model API can help us achieve the above same thing.
  3. One can get current task using Task REST API.

Thanks.

1

1 Answers

2
votes

Answering my own question since its encouraged...Note that community version has been used. One can get the list of completed tasks through History REST API (/history/task) provided by Camunda using processinstanceid and finished (set to true) as query parameters. History REST API offers many functionalities which can be explored further.

However, listing all the tasks can only be possible using Model API but they shall be unordered. Its not wise to order tasks since hard-coding the order itself defeats the use of BPM. Algorithms like depth-first/breadth-first search, since the adjacency matrix shall need ordering of tasks wrt row/columns, would not help neither it would be wise to rely on topological sorting if graphs are cyclic.

Hope this helps somebody.