Can you recover the task's workflow creator in the Notification template

Hi,

Is there a way/variable to recover who is assigning you a task when creating a workflow, so as to write it in the notification email?

For example:

A task on the document ${htmlEscape(docTitle)} was assigned to you or to a group you belong to by ${someVariableNameForTaskCreator.name}. You can consult the document following this link: : <a href=“${docUrl}“>${htmlEscape(docTitle)}</a>

0 votes

2 answers

2212 views

ANSWER



Hi,

Looks like you could use nodeLastActor (cf. rhz help section when you are in the Studio and in a template):

${nodeLastActor} => gives the login (for example “john”) ${Fn.getPrincipal(workflowInitiator) .firstName} ${Fn.getPrincipal(workflowInitiator) .lastName}

=> Give first/last name (for example "John Doe")

Thibaud

2 votes



Not using studio and on Nuxeo 5.5.

nodeLastActor is undefined here. Is there another way?

03/22/2013


Ah ok.

You then probably can use a context variable that you set to the current user in the chain before using in your mail:

[…previous actions…]
Execution Context > Set Context Variable
    name:  theCurrentUser
    value: @{CurrentUser.name}

Notification  Send E-Mail
[…next actions…]

In your eMail, you can then use the theCurrentUser variable filled with the login. So, you can get first/last name if you prefer:

[...]
A task [...] assigned to you by ${Fn.getPrincipal(theCurrentUser).firstName} ${Fn.getPrincipal(theCurrentUser).lastName}.
[...]

Thibaud

0 votes



I'm not using a custom chain or anything beside modifying the template with extension "org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="templates" and extension "org.nuxeo.ecm.platform.ec.notification.service.NotificationService" point="notifications"

I'm trying to figure out what I can put in my .ftl files so I can inform the person receiving the email who started the workflow.

03/22/2013

Ah. Actually, There was no easy way - unless I missed something in the original question - to detect in the question that it was about version 5.5, without using a chain or the Studio.

Maybe you can try to use the Session object, something like…

${Session.getPrincipal().getName()}

…should return the login of the current user.. Still, it is not always the one who started the workflow.

Unfortunately, I don't know what was available or not in this version.

Thibaud

From my iPad

03/22/2013