How to set primitive values in IDfWorkflowEx???
Hi, i try to set primitive values but system dont take the changes. Any Help? , I put my code here.
DfId idw = new DfId("4d01e24080000686"); // Any running workflow.
IDfWorkflow wf = (IDfWorkflow) session.getObject(idw);
IDfWorkflowEx wfe = (IDfWorkflowEx) wf;
wfe.getPrimitiveVariableValue("Name"); // Returns -> Blank String (Default Value)
wfe.setPrimitiveObjectValue("Name", "Freddy") //It looks like fine
wfe.getPrimitiveVariableValue("Name"); //Returns -> Diego
Them when i go to WebTop the Process Variables don´t take change.
Comments
-
I've recently run into this issue myself. The trick is that Process Variables cannot be changed once the workflow is running (in fact, in the DfWorkflowEx class, there's a method that's supposed to throw an exception if you attempt to set variables on a workflow that's not dormant. Unfortunately, that method isn't called so you think everything's set when in fact, they're not). To ensure that your variables are set correctly, first init the workflow (this assumes you want to set the variables at the start of the workflow, not in the middle):
IDfId NewWorkflowId = workflowBuilder.initWorkflow();
then ,set the Process Variables (assumes you get a handle to the workflow first):
wfe.setPrimitiveObjectValue("Name", "Freddy")
then, run the workflow:
IDfId NewWorkflowId2 = workflowBuilder.runWorkflow();
That should be it!
Terence
0 -
My final code, as example, it will be helpful:
IDfWorkflowBuilder workflowBuilder = session.newWorkflowBuilder(id);
IDfId initWf = workflowBuilder.initWorkflow();
IDfWorkflowEx setVariables = (IDfWorkflowEx) session.getObject(initWf);
setVariables.setPrimitiveObjectValue("VARNAME1",value1);
setVariables.setPrimitiveObjectValue("VARNAME2",value2);
setVariables.setPrimitiveObjectValue("VARNAME3",value3);
IDfId idWf = workflowBuilder.runWorkflow();
return idWf;
Thank's, for all support !!
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax