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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Unable to get user comments and votes while approving the promotion request or approve tasks.

@_1647
13-Aquamarine

Unable to get user comments and votes while approving the promotion request or approve tasks.

Hi Sumit,

 

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 all the data but I am STRUGGLING to get user comments and votes while approving the promotion request or while performing the "approve" task.

If you have sent a snap of code then it would be highly appreciated.

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:@_1647)

Hi @_1647 

You may run the code in wrong place 😄 getParent just return WF process, in your case there is assignedActivity so you need to solve it.

Check what the method getParentProcess returns. It should be WfProcess

I suggest you to use IDE and test class function to test a code, not just run it in the workflow...

For example run http url to run your method and see if it works or not.

PetrH

View solution in original post

7 REPLIES 7
HelesicPetr
22-Sapphire I
(To:@_1647)

Hi @_1647 

If you need a help can you share your code where you try to get that information? 

PetrH

@_1647
13-Aquamarine
(To:HelesicPetr)

I have pbo as promotion notice and i got the other detail as below but comments and Assignee Name is not getting as who is approver or reviewer not getting :

Vote Getting as Null

System.out.println("workitem activityName is :

((wt.workflow.work.WfAssignedActivity) workitem.getSource().getObject()).getName());

System.out.println("workitem role is :" + workitem.getRole().getFullDisplay());

System.out.println("workitem vote is :" + workitem.getEventSet().toString());

System.out.println("WorkItem owner is :" + workitem.getOwnership().getOwner().getFullName());

System.out.println("WorkItem getCompletedBy is :" + workitem.getCompletedBy());

HelesicPetr
22-Sapphire I
(To:@_1647)

Hi @_1647 

You need to get WfVotingEventAudit  object

 

// (wt.workflow.work.WfAssignedActivity)activity 
wt.fc.collections.WTArrayList auditCol = (wt.fc.collections.WTArrayList) wt.workflow.engine.WfEngineHelper.service.getVotingEvents((wt.workflow.engine.WfProcess) activity.getParentProcess(), null, null, null);

PetrH

 

@_1647
13-Aquamarine
(To:HelesicPetr)

Yes I want that but I am not getting an API. I will try your shared one 

@_1647
13-Aquamarine
(To:HelesicPetr)

getting error on BGMS : Caused by: java.lang.ClassCastException: class wt.workflow.engine.WfProcess cannot be cast to class wt.workflow.work.WfAssignedActivity (wt.workflow.engine.WfProcess and wt.workflow.work.WfAssignedActivity are in unnamed module of loader 'app') 

HelesicPetr
22-Sapphire I
(To:@_1647)

Hi @_1647 

You may run the code in wrong place 😄 getParent just return WF process, in your case there is assignedActivity so you need to solve it.

Check what the method getParentProcess returns. It should be WfProcess

I suggest you to use IDE and test class function to test a code, not just run it in the workflow...

For example run http url to run your method and see if it works or not.

PetrH

Hello @@_1647

 

It looks like you have some responses from a community member. If any of these replies helped you solve your question please mark the appropriate 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.

Announcements

Top Tags