Get vote from WorkItem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Get vote from WorkItem
Is there any API or workaround to get the vote from a WorkItem?
Solved! Go to Solution.
- Labels:
-
API
-
Business Logic Customization
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You have to do so. The information is not stored in the WorkItem
You have to get the voting events and drill the information from that.
PetrH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @OP_11714882,
Thank you for your question.
I’d like to recommend to bring more details and context to your initial inquiry.
- What version of Windchill are you using?
- What is the desired outcome or next step after retrieving the vote from the WorkItem? How will this information be used?
- Have you tried any existing methods or APIs in Windchill to retrieve this information? If so, what were the results?
- Are there any specific challenges or obstacles you have encountered while trying to get the vote from the WorkItem?
It also helps to have screenshot(s) to better understand what you are trying to do in your process.
This will increase your chances to receive meaningful help from other Community members.
Best Regards,
Vivek N
Community Moderation Team.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
My Windchill version is 12.1.2.11
I want to create a custom REST endpoint in which I want to add the vote of a WorkItem
I tried using the following way but is there any another way to get the vote from the workitem
WfAssignment wfa = (WfAssignment) workitem.getParentWA().getObject();
WfAssignedActivity wfaa = (WfAssignedActivity) wfa.getSource().getObject();
WTArrayList auditCol = (WTArrayList) WfEngineHelper.service.getVotingEvents((WfProcess) wfaa.getParentProcess(),
null, null, null);
Iterator auditEvents = auditCol.persistableIterator();
while (auditEvents.hasNext()) {
WfVotingEventAudit audit = (WfVotingEventAudit) auditEvents.next();
System.out.println(" Activity Name = " + audit.getActivityName());
System.out.println(" Vote = " + audit.getEventList());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @OP_11714882
You could have tried to search.
input key words the vote and workitem
Unable to get user comments and votes while approving the promotion request or approve tasks.
Solution is mentioned in the link.
getVotingEvents
PetrH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
wt.fc.collections.WTArrayList auditCol = (wt.fc.collections.WTArrayList) wt.workflow.engine.WfEngineHelper.service.getVotingEvents((wt.workflow.engine.WfProcess) activity.getParentProcess(), null, null, null);
But here if I use the getParentProcess() method I get all the Tasks in the WTArrayList, Im getting other values like Name, Status etc. directly from the WorkItem so I don't want to backtrack and again run a loop on the WTArrayList. I want to retrieve the selected voting option from a WorkItem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Understood. Thanks
