Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi,
I'm striking out on finding a solution already posted for this. I have found posts on the customization of the initial name of the PR, but I'm looking for something different.
I'd like to edit the Promotion Request name in a Workflow expression, I'd like to add the value of a workflow variable to the Promotion Request name; so in the users task list the task Subject tells them the variable name.
Can anyone point me to a post on this, or have a solution to share?
Thanks!
Vaughn (WC10.1 M040)
Solved! Go to Solution.
you can use below expression in workflow to change the Promotion Request Name
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice) primaryBusinessObject;
wt.maturity.PromotionNoticeIdentity promotionNoticeIdentity = (wt.maturity.PromotionNoticeIdentity) pn.getIdentificationObject();
// instead of newName you can use variable from workflow
promotionNoticeIdentity.setName("newName");
wt.fc.IdentityHelper.service.changeIdentity(pn, promotionNoticeIdentity);
Hope this helps !!!
Thanks,
Shreyas
you can use below expression in workflow to change the Promotion Request Name
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice) primaryBusinessObject;
wt.maturity.PromotionNoticeIdentity promotionNoticeIdentity = (wt.maturity.PromotionNoticeIdentity) pn.getIdentificationObject();
// instead of newName you can use variable from workflow
promotionNoticeIdentity.setName("newName");
wt.fc.IdentityHelper.service.changeIdentity(pn, promotionNoticeIdentity);
Hope this helps !!!
Thanks,
Shreyas
For Activity Name:
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
taskName = pn.getName().toString();
wt.workflow.engine.WfActivity myActivity = (wt.workflow.engine.WfActivity)self.getObject();
myActivity.setName ("Approve Promotion Request - " + taskName);
myActivity = (wt.workflow.engine.WfActivity) wt.fc.PersistenceHelper.manager.save(myActivity);