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

Community Tip - You can change your system assigned username to something more personal in your community settings. 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)
4 REPLIES 4

Thanks Jennifer!

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


Thanks Shreyas!

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


Thanks Jennifer!

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


If that tasks goes through a rework, you'll want to put a check in or the task name will get the taskName appended each time.

Vaughn,



Not sure if I understood your question correctly. However you can use below expression in workflow to change 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

Announcements


Top Tags