Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I have a custom utility on Promotion Notice and I want to retrieve all task data like name, number, role, assignee, activity name, vote, and comments as well. So, I retrieved below data but i am I am STRUGGLING to get user comments and assignee name while performing the "approve" task. of Poomotion Notice
I need a java API so that I can use it in my utility where I am getting other details .
I know that i ill get required info from this class WfVotingEventAudit but How can i get this from Promotion Notice
I used below code in wf but getting class cast exception :
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());
I did this slightly differently since I was using eSignature. This object has everything but you must enable the task to have signature required which forces users to have to enter password to complete. In my workflow, I use this code to copy the comments to a discussion forum associated with the promotion request or change object.
QueryResult result = PersistenceHelper.manager.navigate(promotion, SignatureLink.SIGNATURE_ROLE,SignatureLink.class,false);
LOGGER.debug("Read in: " + result.size() + " Signatures");
SignatureLink link = null;
//Loop through the signatures
while(result.hasMoreElements()) {
link = (SignatureLink) result.nextElement();
LOGGER.debug("Found " + link.getComments() + " comments");
//Get user from signature
QueryResult userLink = PersistenceHelper.manager.navigate(link.getSignature(),UserElectronicIDLink.USER_ROLE,UserElectronicIDLink.class);
WTUser user = (WTUser)userLink.nextElement();
LOGGER.debug("Got user: " + user.getFullName());
//Get Comments
String comments = link.getComments();
if ((comments == null)||(comments.trim().isEmpty()))
{
LOGGER.debug("Caught case of no comments");
comments = "No comments entered.";
}
//Get Vote
String vote = link.getVote();
LOGGER.debug("Got vote: " + link.getVote());
//Get Role
LOGGER.debug("Got role: " + link.getRole());
String role = link.getRole();
Hello @@_1647,
It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Community Moderation Team.