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

Edit Promotion Request name in Workflow expression

vmcdaniel
12-Amethyst

Edit Promotion Request name in Workflow expression

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)

ACCEPTED SOLUTION

Accepted Solutions
satre-2
12-Amethyst
(To:vmcdaniel)

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

View solution in original post

2 REPLIES 2
satre-2
12-Amethyst
(To:vmcdaniel)

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);

Announcements


Top Tags