Skip to main content
1-Visitor
January 27, 2014
Solved

Edit Promotion Request name in Workflow expression

  • January 27, 2014
  • 2 replies
  • 1284 views

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)

Best answer by satre-2

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

2 replies

satre-21-VisitorAnswer
1-Visitor
January 27, 2014

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

vmcdaniel1-VisitorAuthor
1-Visitor
January 27, 2014

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