Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Programmatically find latest votes for user on change task


Programmatically find latest votes for user on change task

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.

22-Sapphire I

I did this slightly differently using eSignatures. Each time I loop through, signature history was cleared so there was only 1 set to find.

QueryResult result=PersistenceHelper.manager.navigate(ecn,SignatureLink.SIGNATURE_ROLE,SignatureLink.class,false);

This was against a Change Notice. If you are using the esignature check box, those capture votes as well

SignatureLink link=null;
while(result.hasMoreElements()) {


You should be able to get user, role and date from this object. I hope this helps.

21-Topaz II

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)((, null, null, null);
System.out.println("***Transition Expression: Audit = " + auditCol.toString());
Integer comentnumber=0;
java.util.Iterator auditEvents0 = auditCol.persistableIterator();
//here I need to know how many times the Clarify transaction is done.
while( auditEvents0.hasNext())
wt.workflow.engine.WfVotingEventAudit audit1 = (wt.workflow.engine.WfVotingEventAudit);
if(audit1.getEventList().toString().equalsIgnoreCase("[Clarify]")) // string name of transation name
comentnumber = comentnumber +1;
java.util.Iterator auditEvents = auditCol.persistableIterator();
String comments = "";
while( auditEvents.hasNext())
wt.workflow.engine.WfVotingEventAudit audit = (wt.workflow.engine.WfVotingEventAudit);
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:




Top Tags