I am currently evaluating Camunda for use within our organisation and I am experimenting and evaluating different ways of using the application.
I would like to be able to interrogate a given process instance - through the RestAPI - such that I can find the current task (or activity) and then execute that task. Is this possible and/or a sensible way to use Camunda?
Thanks very much for the prompt response. Seems a little convoluted to achieve what I need to achieve? I can interrogate a process instance and through its activity instance receive the current “child task” using:
Indeed if you’re using theGet Tasks call it will return any user tasks that match whatever criteria you’ve added. In the case where you specify no criteria it will return all currently active user task. The only reason it would be return nothing is if there are not active user tasks or the criteria doesn’t match any.
You don’t need to query for a task matching a specific ID, instead if you use the above rest call you’ll get an ID in return and then you can use it to complete the task via Rest.
Tx very much for your response. So if I call Get Tasks with a specific process instance id I will get the active task(s) for that specific process instance?
Correct - although it’s generally better practice to use a business key when searching for tasks.
You can start a process with a key (any string that makes sense for you use case) and then use that same key to query for tasks. One of reasons why this is a better idea is because if you use a sub process within your process, it will have a difference process instance id - but you can pass a business key to a sub process.