This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Workflow Process Variables

sherenegladysj - Thursday, June 4, 2009 8:02 AM:

Hello,

I have created a workflow with two activities say stage1 & stage2. I want to perform the following activities at Activity Completion Worksheet (ACW).

1. User1 attaches a document (say review record) at stage1 ACW. I want to view the same document (review record) at stage2 ACW for User2.

2. User1 enters few text fields and Votes for next activity. I want to retrieve all the field values at stage2 ACW as disabled field. I want to know how to update and retrieve values from the database.

I have tried a lot but nothing turned up. Can anyone pls. help me on this???

Thanks in advance.

Regards,

Sherene



ashu_vik - Thursday, September 10, 2009 12:59 AM:

Hi Sherene,

I am facing the same issue as yours. I want to retrieve the value of the variable set by the user during the ACW and on the basis of the value of the variable decide further flow of the workflow.

Were you able to get this? Any pointer will help.

Thanks Ashu



sherenegladysj - Thursday, September 10, 2009 2:48 AM:

Hello Ashu,

Yeah I was able to pass the variable values from one ACtivity to next Activity across the workflow. Two methods are there

Methiod 1:

 Add Activity Variable & Process Variable in Workflow Map.  Activity Variables can be accessed in Workflow Completion Worksheet. At Activity Stage1, On Submit Save the Activity Varaibles Value to Process Variable using method. At Activity Stage2, update the Activity Variable Value from the Process Variable using method.

Method2:

Modify "InBasket-VoteDialog.html" file to access the Process Varaible instead of Activity Variable. Because Process Variable can be accessed through out the workflow whereas Activity Variables are limited to a single activity.

~Sherene

 

 



ashu_vik - Tuesday, September 22, 2009 7:49 AM:

Hey Sherene,

Thanks for your response.

I tried to create the methods as per Method1 but failed miserably. Can you please give me sample code for the method to save the Activity Varaible Value to Process Variable?

For method 2, What changes are to be made in the "InBasket-VoteDialog.html" file?

-Ashu



sherenegladysj - Monday, October 19, 2009 5:49 AM:

Hi Ashu,

Here is the code for passing activity variables to process variables;

Dim wfProcess As Item = myInnov.newItem("Workflow Process","get")
Dim activity As Item = myInnov.newItem("Activity","get")
Dim wfProcAct As Item = myInnov.newItem("Workflow Process Activity","get")
wfProcAct.setProperty("related_id",actID)
wfProcAct.setAttribute("select","source_id")
wfProcess.addRelationship(wfProcAct)
 
Dim wfProcessFind As Item = wfProcess.apply()
Dim wfProcActItem As Item = wfProcessFind.getItemsByXPath("//Item[@type='Workflow Process Activity']").getItemByIndex(0)
Dim wfProcActSourID As String = wfProcActItem.getProperty("source_id")
 
' Getting the activity variable name
Dim actVar As Item = myInnov.newItem("Activity Variable","get")
actVar.setProperty("source_id", actID)
actVar.setProperty("name", "Variable Name")
actVar.setAttribute("select","id")
activity.addRelationship(actVar)
 
Dim activityFind As Item  = activity.apply()
Dim actVarIDItem As Item = activityFind.getItemsByXPath("//Item[@type='Activity Variable']").getItemByIndex(0)
Dim actVarID As String = actVarIDItem.getProperty("id")
 
Dim actAssign As Item = myInnov.newItem("Activity Assignment","get")
actAssign.setProperty("source_id", actID)
actAssign.setAttribute("select","id")
activity.addRelationship(actAssign)
 
Dim actVarValue As Item = myInnov.newItem("Activity Variable Value","get")
actVarValue.setProperty("variable",actVarID)
actVarValue.setAttribute("select","value")
actAssign.addRelationship(actVarValue)
 
Dim activityValueFind As Item = actAssign.apply()
Dim actVarValueItem As Item = activityValueFind.getItemsByXPath("//Item[@type='Activity Variable Value']").getItemByIndex(0)
Dim ActVarValue As String = actVarValueItem.getProperty("value")
 ' updating activity variable value to workflow process variable
Dim wfProcVar As Item = myInnov.newItem("Workflow Process Variable","get")
wfProcVar.setProperty("name","Variable Name")
wfProcVar.setProperty("source_id",wfProcActSourID)
wfProcVar.setAttribute("select","value")
wfProcess.addRelationship(wfProcVar)
 
wfProcessFind = wfProcess.apply()
Dim procVarItem As Item = wfProcessFind.getItemsByXPath("//Item[@type='Workflow Process Variable']").getItemByIndex(0)
Dim inValue As String = procVarItem.getProperty("value")
 
procVarItem.setAttribute("action","edit")
procVarItem.setProperty("value", ActVarValue)
procVarItem = procVarItem.apply()

 



Nikul Patel - Friday, December 3, 2010 3:22 AM:

Hi,

I want know " how we can add a file in workflow process as variable or any other way?". Please help me..

 

Thanks,

Nikul Patel