cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] email assignee when a task is complete

sihnu
Champ in-the-making
Champ in-the-making
Hello

I would like to implement a behaviour so that when a task is completed an email is sent to the assigned user. The same way as it is done in Adhoc workflow. Here is the javascript copied from Adhoc processdefinition:

if (tm_notifyMe)
   {
   var mail = actions.create("mail");
   mail.parameters.to = initiator.properties.email;
   mail.parameters.subject = "Toimenpide " + bpm_workflowDescription;
   mail.parameters.from = bpm_assignee.properties["cm:email"];
   mail.parameters.text = "Suoritettu";
   mail.execute(bpm_package);
}

But I get this error when trying to complete the task: "org.alfresco.service.cmr.workflow.WorkflowException: 03130022 Failed to signal transition null from workflow task jbpm$11.". The user whom the email should have been sent has a proper gmail address defined as to his email address.
4 REPLIES 4

vinaxwater
Champ in-the-making
Champ in-the-making
Dear friend,
You have this code:

<variable name="bpm_workflowDescription" access="read" />
<variable name="bpm_assignee" access="read" />
<variable name="bpm_package" access="read" />
If you haven that code. Maybe one in that code is null.

Goodluck.

sihnu
Champ in-the-making
Champ in-the-making
Thanks for the reply.


If you haven that code. Maybe one in that code is null.

I tested those variables by priniting them in workflow details. These are printed just after the start task and just before the task where the error occurs. And the results:

Message: test
Content Package: 560094d1-d5db-48f7-8cb4-c9038a9e40d0
Workflow Assignee: Administrator (admin)

So, none of those variables are null. I don't know how to refer to email property of the assignee in workflow-config or in any of the xml-files. I could print them and check if those are null. Anyway, I have defined email address for the user admin so I doubt that would be null. Any other ideas? I really would like to get this working.

sihnu
Champ in-the-making
Champ in-the-making
Hi, I solved my problem. I had to do configuration according to this article:

http://wiki.alfresco.com/wiki/Outbound_E-mail_Configuration

Hope this will help if anyone else sumbles on the same problem.

sans
Champ in-the-making
Champ in-the-making
Hi sihnu,
I tested those variables by priniting them in workflow details.
How did you print those variables in workflow details?
Because I am trying to modify task-list-min.js and want to print the variables, but I am not able to print them.
I am getting logger is undefined error.

Thanks!!