Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
How can the actitvy comments be retrived in a variable. Since i require to send these comments in notification mail in a workflow.
Solved! Go to Solution.
1. In the Workflow, define a global String variable. example: eeComment.
2. In the Assigned Activity task:
a) define a String variable. example: eeComment. "Copy into" and "Initialize From" the global variable defined in step 1. Only select "Resetable"
b) within the desired "Transitions" use this java code:
wt.workflow.work.WfAssignedActivity activity = (wt.workflow.work.WfAssignedActivity) self.getObject();
wt.workflow.engine.ProcessData actData = activity.getContext();
eeComments = actData.getTaskComments();
c) Click on "Check Syntax"
3. The global String variable, populated in step 2, shall be available in the "Notification Robot". Be sure to select the variable using the "Variable" comand button located on the "Message" tab in the Notification Robot.
I hope this make sense...
I would love to know this answer as well. Someone please reply...
1. In the Workflow, define a global String variable. example: eeComment.
2. In the Assigned Activity task:
a) define a String variable. example: eeComment. "Copy into" and "Initialize From" the global variable defined in step 1. Only select "Resetable"
b) within the desired "Transitions" use this java code:
wt.workflow.work.WfAssignedActivity activity = (wt.workflow.work.WfAssignedActivity) self.getObject();
wt.workflow.engine.ProcessData actData = activity.getContext();
eeComments = actData.getTaskComments();
c) Click on "Check Syntax"
3. The global String variable, populated in step 2, shall be available in the "Notification Robot". Be sure to select the variable using the "Variable" comand button located on the "Message" tab in the Notification Robot.
I hope this make sense...
Thanks a lot...... Have tried it and it works fine......
How do you define a global variable? I have a variable defined in an expression robot, but that isn't showing up where I can initialize from and copy to. I believe that is the reason my conditional has a syntax error of not finding the variable.
In my expression robot, I have
String state = "New";
boolean test;
I have test defined in an Activity, with a default of Yes, but initialize from and copy to are blank because I don't see test.
Later on in a conditional block, I use-
if(test="Yes")
result="R&D";
else
result="Released";
-with R&D and Released as the the routing.
Edit: Please excuse my ignorance, I am really new to this.
Message was edited by: Shawn Pete
In WC10 open “Workflow Template Administrator”.
Edit the workflow to be changed.
Click on the “Properties” hyperlink.
Click “Variables” tab.
Click “Create”
Populate the Create Variable form accordingly.
At the end of this sequence of steps, you have a global variable available for use within your workflow.
In this example I’ve created the “ExampleVarABC” global variable. This global variable is now available to be used in your expression robot.
Example of the use of the global variable in an expression robot.
wt.doc.WTDocument pbo = (wt.doc.WTDocument)primaryBusinessObject;
ExampleVarABC = pbo.getDescription();
If this is not helpful, PTC has a tutorial available on the Workflow admin tool.
Good Luck,
Mike E.
This works fine for a single commenter, but you have more than one person commenting, it only records the last person's comment.
Any way to change the code to capture everyone's comment? I am an admin from the engineering side and not much of a programmer beyond "Hello World."
-marc
Are you talking about a single task that a bunch of people vote on? Or are you talking about a bunch of individual tasks that each person gets?
Individual tasks. I would like to collate all the comments from those tasks into a single email notification.
In that case you just need to have a unique variable for each task, then in the next activity task gather each of those variables.
The variable has to exist in the workflow properties, the source task and the destination task. Making each of the tasks have its own unique variable should let you gather all the variables into the next task down the line and put them into the notification.