Skip to main content
12-Amethyst
November 23, 2023
Question

How to get Review Comments in workflow

  • November 23, 2023
  • 1 reply
  • 1667 views

RS_10128209_0-1700723840928.png

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

1 reply

22-Sapphire II
November 23, 2023

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

12-Amethyst
November 23, 2023

Hey @HelesicPetr Thanks for the reply

 

My object is Disposition Action

Internal name is wt.change2.disposition.DispositionAction action = (wt.change2.disposition.DispositionAction)primaryBusinessObject;

RS_10128209_2-1700730183952.png

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

 

 

22-Sapphire II
November 23, 2023

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