Resuming a Workflow with a signal: how to set process data?
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."
_
Comments
-
Package is defined at the process template level (dm_process). Using GUI, you dont have to worry about whether the activities in the process has access to the package or not.
Basically, what I am trying to say is that I can answer your low-level API question, since most of my workflow development experience has always been using the GUI as much as possible. The only time I have to do low level coding is when I have to call server method in the WF to do backend processing - I have never had to "code" the actual workflow itself.
0 -
I think that you did the right thing by calling IDfWorkitem.addPackage, but you probably picked to wrong workitem. You should use the workitem that corresponds to the next activity which is triggered by the signal. I suppose you picked the workitem of the previous activity which performed the asynchronous call.
0 -
Right, and after you send the signal, get the new workitem and add the package.
0 -
You design the workflow. Make sure that activity is not automated otherwise it will indeed complete. It should be manual and you should complete it when you are ready to resume the workflow.
0
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 151 General Questions
- 147 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 181 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories