My workflow activity initiates a long asynchronous service call and completes. The next activity has a value in the field Trigger/"And when this signal arrives" .
After some time the remote service connects to my docbase and sends this signal.
Now, how to populate Process Data/Packages with the results of the service call?
I know the workitemId that called the service and I tried calling addPackage() on that workitem. However, the workitem is already completed and addPackage() fails with:
[DM_WORKFLOW_E_ACTION_NOT_ALLOWED]error: "This operation is not allowed when the state is 'finished' for workitem '4a01e2408000910d'
So I probably want to write directly to the workflow, but I can't find the method to add packages to a workflow.
IDfWorkflow has addPackage(), but it's intended for constructing a new workflow and expects the parameter startActivityName:
workflow
.addPackage(
"Join",
"Input:0",
"optional_b",
"dm_document",
null,
false,
asSingletonList(new DfId("0901e2408014d74f")));
_
[DM_WORKFLOW_E_INVALID_ACTIVITY_TYPE]error: "The activity, Join, is not a start activity."
_