Hi Ramakrishnan,
One option might be to store a unique custom business key as a process variable. For example, you could set a variable my-business-key
with value xyz
.
Then, it’s possible to use the operate rest api to find variables. For example, you could find the variables for instance id 123 like this:
POST <operate-url>/api/process-instances/123/variables
(with payload of {“scopeId”:“123"}
)
… the result would look something like …
[
{
"id": "123-my-business-key",
"name": "My Business Key",
"value": "\"xyz\"",
"isPreview": false,
"hasActiveOperation": false,
"isFirst": true,
}
]
Now that you have the value of my-business-key
, search for all tasks with something like this (via tasklist graphql api):
{
tasks(query: {taskDefinitionId: "my_user_task"}) {
id
name
taskDefinitionId
variables {
id
name
value
}
}
}
And then filter the results to find the task with the variable named my-business-key
and value xyz
{
"data": {
"tasks": [
{
"name": "My User Task",
"id": "2251799813685261",
"taskDefinitionId": "my_user_task",
"variables": [
{
"id": "123-my-business-key",
"name": "My Business Key",
"value": "\"xyz\""
}
]
}
]
}
}
I’ll reply to this thread if I find a better way, but that’s the best I can find for now. Hope that helps!