Business key to uniquely access process instance

cancel
Showing results for 
Search instead for 
Did you mean: 
sonalik
Member II

Business key to uniquely access process instance

Hi Team,

I am using Activiti-REST API's (5.22.0).

I have created a process definition and deployed successfully.

I want to start a new instance every time when the request comes. While starting the instance i also want to uniquely name the instance, which can be done using business key.

The instance gets created successfully. Now i want to do following API calls using business-key and not using process-instance id: (few i am able to do successfully which i have listed)

1) Suspend/Activate a process instance using business key ?

2) Get running instance using business key- Please confirm whether correct?

   activiti-rest/service/runtime/process-instances?businessKey=process_V2 

3) Get Diagram?

4) Get active task -  Please confirm whether correct?

   activiti-rest/service/runtime/tasks?processInstanceBusinessKey=process_V2 

5) Completing a task?

6) Add Users/Groups to process instance/definition ?

Looking forward for your support as always.

Thanks in advance.

1 Reply
gdharley
Intermediate

Re: Business key to uniquely access process instance

You are missing the point of the business key.

It is a generic metadata element that is NOT guaranteed to be unique per instance.

Meaning, it means what you want it to mean in your solution.

Therefore, there are no API's available to act on individual instances by business key.

That said, you can achieve all of what you need, but not with a single API call.

Your options:

1. Use standard query API's (for instances or tasks) which accept business key as an argument.

then....

2. Use the returned results to do what you choose (suspend, activate etc).

OR....

Extend the API to create custom calls that "assume" business key is unique.

G