Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi All
I want to get review comments and store it into a variable
and it need to the person in task at the time of performing rework
Please suggest me how can I do
Hi @RS_10128209
Same question has been answered today for voting so it is same.
here is example from a task
wt.fc.collections.WTArrayList auditCol = (wt.fc.collections.WTArrayList) wt.workflow.engine.WfEngineHelper.service.getVotingEvents((wt.workflow.engine.WfProcess) ((wt.workflow.work.WfAssignedActivity) self.getObject()).getParentProcess(), null, null, null);
System.out.println("***Transition Expression: Audit = " + auditCol.toString());
java.util.Iterator auditEvents = auditCol.persistableIterator();
String comments = "";
while (auditEvents.hasNext())
{
wt.workflow.engine.WfVotingEventAudit audit = (wt.workflow.engine.WfVotingEventAudit) auditEvents.next();
System.out.println("***Transition Expression: User vote = " + audit.getEventList());
System.out.println("***Transition Expression: User comment = " + audit.getUserComment());
}
PetrH
Hey @HelesicPetr Thanks for the reply
My object is Disposition Action
Internal name is wt.change2.disposition.DispositionAction action = (wt.change2.disposition.DispositionAction)primaryBusinessObject;
Pls refer screenshot highlighted comment I want to get
Could you please tell what changes I need to made in above code which you shred
Hi @RS_10128209
If the comment is from workflow you don't need to do any changes.
the comment is saved on the workflow event not the DispositionAction
You just need to run the code from the workflow task, not the workflow robot.
If you need to run the code from workflow robot, you need to change a first row
wt.fc.collections.WTArrayList auditCol = (wt.fc.collections.WTArrayList) wt.workflow.engine.WfEngineHelper.service.getVotingEvents((wt.workflow.engine.WfProcess)self.getObject(), null, null, null);
remove the .getParentProcess()
PetrH