Skip to main content
Nov 14, 2018 10:12 PM UTC
Question

Workflow email robot - include activity (task) info

So I built a notification loop in the promotion request workflow to daily remind the assigned individual that they have an open task.  Can anyone offer suggestions on how to retrieve the active task name and corresponding hyperlink so I can include them in the email robot's message text?  The email template for tasks already includes this information but the email template the robot uses is different and does not include this information since it's not tied to a particular task.  How do I retrieve that information?  Thanks.

 

Workflow Email Loop.png

- Email message for green boxes should be very similar, if not identical.

4 replies

Nov 15, 2018 12:21 PM UTC
if (pbo instanceof WTChangeActivity2) {
changeActivity = (WTChangeActivity2) pbo;
}

NmOid changeActivityOid = new NmOid(PersistenceHelper.getObjectIdentifier(pbo));
NmAction changeActivityInfoPageAction = NmActionServiceHelper.service.getAction("object", "view");
changeActivityInfoPageAction.setContextObject(changeActivityOid);
changeActivityInfoPageAction.setIcon(null);
String changeActivityLink = changeActivityInfoPageAction.getActionUrlExternal();
String changeActivityName = changeActivity.getName();
TomUAuthor
Nov 15, 2018 1:25 PM UTC

Will this work for promotion requests or only change objects (tasks/notices/requests)?

Nov 15, 2018 1:30 PM UTC

It should work for all persistables (NmOid and NmAction).