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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Workflow activity rejection customization

SitanshuPrasad
1-Newbie

Workflow activity rejection customization

Hi,

I am trying to customize Promotion Request Approval Workflow. I need to customize it in such a way that the Workflow Approroval activities with multiple participants should wait until all of the participants provide vote, if 'All' is chosen as required in the template (This part is working fine). But if one of the approvers Reject, then activity should be completed and sent back to initiator without waiting for other approvers votes. Whereas it waits for all the approvers to vote if no one rejects. I am trying to use a sync robot with class based event for this customization. But its not working fine. Can any one please help me in doing this?

Thanks

Sitanshu

3 REPLIES 3

wt.properties

replace the property for StandardNmWorkItemService with a custom class that extends StandardNmWorkItemService.

override the complete method. You have access to the workitem/wfassignment/wfactivity/process/etc from here.

I don't want to write a new class. Is it possible to write custom java code in Workflows. Or is there anything we can configure in the workflow itself.

Please suggest.

Maybe you can write a synch robot that listens for class events on WorkItem?

In any case, it's not good practice to put a bunch of code in expressions. If you go that route, try calling a single class from the expression that checks all your conditions and does all the work.

Inevitably, you're going to want to change it. Either your conditions will change or business requirements will change. Don't get stuck with workflow expressions you don't know how to get rid of.

Edited:

I haven't touched synch robots in years but I'm assuming you'll have access to at least three things: WTObject primaryBusinessObject, ObjectReference self (the instance of the robot), and the event object. Pass those to your class and do what you need. If you don't need them now, that's fine, but it's better to have them and not need them than to need them and not have them. Again - If you don't know how, instances of workflow expressions can be very hard to change.

Top Tags