0 votes
2.6k views
in Process Server by (120 points)
I have a running instance which is on step within linked process. Is there are any way to update private variable in linked process ?

1 Answer

0 votes
ago by (30.6k points)

A private variable of a linked process (a BPD started by a linked process activity) belongs to that child instance, so you change it on the child instance, not on the parent.

Find the child instance id - the parent knows it through the activity's execution; the simplest is the REST execution tree of the parent, which lists the child under the linked activity:

GET /rest/bpm/wle/v1/process/{parentPiid}?parts=executionTree
-> executionTree.root.children[...].name == "Approve order" (the linked process activity), .externalActivitySnapshotID / .createdTaskIDs
GET /rest/bpm/wle/v1/process?searchFilter=... (or search by instance name: linked instances are named after the child BPD)

Set the variable on the child (any BPM 8.5.x / BAW release):

PUT /rest/bpm/wle/v1/process/{childPiid}/variables
BPMCSRFToken: <token>
{ "approvalLimit": 5000, "requestor": { "name": "Ana", "id": "u123" } }

The variable does not have to be exposed as business data for this call; "private" only means it is not visible in searches. If the child is currently waiting on a task, the running coach will pick the new value up the next time the task is opened (the task input was copied when the task was created, so an open coach is not refreshed).

From a script in the parent (server side) you can do the same with BPMRESTRequest; there is no JavaScript API that writes another instance's variables directly.

If the requirement is recurring (operations want to correct data), consider adding an intermediate message event to the child BPD that receives a "correction" message and maps its payload into the private variables - that keeps the change inside the model and in the audit trail.

References

Related questions

0 votes
3 answers 4.7k views
0 votes
1 answer 1.2k views
0 votes
1 answer 3.1k views
0 votes
1 answer 1.4k views
0 votes
1 answer 1.6k views
0 votes
1 answer 2.4k views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...