Is there anyway to pull the latest assignment from a user on a particular assignment using java? Currently, I'm working on a report that displays the votes of each user that has been assigned an assignment. However, when it get's re-subrouted, the code I have currently does not know which vote was the latest so it will display "old" votes.
I'm currently working on code that attempts to find the latest timestamp of an assignment's creation and use it but even that's becoming messy.
I did this slightly differently using eSignatures. Each time I loop through, signature history was cleared so there was only 1 set to find.
This was against a Change Notice. If you are using the esignature check box, those capture votes as well
You should be able to get user, role and date from this object. I hope this helps.
Hello @TWil24 ,
I needed to get comments similar way how you need the votes with users.
I wrote code for worflow transiction Start where I needed to show to user previous comments of users who wanted more information
I didn't sort the results because they follow that what is first in iterator is last
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 auditEvents0 = auditCol.persistableIterator();
//here I need to know how many times the Clarify transaction is done.
wt.workflow.engine.WfVotingEventAudit audit1 = (wt.workflow.engine.WfVotingEventAudit)auditEvents0.next();
if(audit1.getEventList().toString().equalsIgnoreCase("[Clarify]")) // string name of transation name
comentnumber = comentnumber +1;
java.util.Iterator auditEvents = auditCol.persistableIterator();
String comments = "";
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());
comments += comentnumber+ ". comment - " + audit.getUserRef().getName() + ": " + audit.getUserComment() + "\n"; // here you can use getEventList()
System.out.println("***Transition Expression: Complete Time = " + audit.getPersistInfo().getCreateStamp());
System.out.println("comments = " + comments);
String special_instructions1 = comments;
results in a task page in instructions: