The old Teamworks portal URL for token injection (/portal/jsp/injectToken...) is gone; token injection in BPM 8.5+ / BAW is done with the REST API or the JavaScript API on the instance, and a sub-process (B, C) is not a separate instance - it is part of the parent's execution tree. So "create a (c) task under (a)" means: create a token at the activity that produces the (c) task.
- Find the flow object id of the target step (the activity inside sub-process (a) that creates (c) tasks) - the execution tree / diagram of the instance lists them:
GET /rest/bpm/wle/v1/process/{piid}?parts=executionTree,diagram
-> executionTree.root.children[...] (tokens: tokenId, flowObjectId, name)
-> diagram.step[...] (every step with ID = flowObjectId, incl. steps inside sub-processes)- Create the token there. There is no "add token" operation; you move an existing token or use a parallel path. Options:
# move the token that sits at (b) to the step that creates (c) (keeps a single token)
POST /rest/bpm/wle/v1/process/{piid}?action=moveToken&tokenId={tokenAtB}&target={flowObjectIdOfC}&resume=true&parts=none
# JavaScript API equivalent (service flow / script):
var pi = tw.system.findProcessInstanceByID(tw.local.piid);
pi.moveToken(tokenId, targetFlowObjectId, true);If (b) must keep running and (c) must start, the model needs to allow it: a parallel gateway that leads to both, or an intermediate message event on the sub-process (a) (or an event sub-process) that starts the path to (c) when a message arrives - then "inject" = POST /process?action=sendMessage with the correlation key. That is the supported way to add work to a running instance; token surgery is for recovery only (question 2572).
References