cancel
Showing results for 
Search instead for 
Did you mean: 

Document Review not working

iantopanto
Champ in-the-making
Champ in-the-making
If i select 'Start Advanced Workflow' for a doc and then select 'Review and Approve', why doesnt the reviewer get an email notification for them to review a document + no emails are sent on approval/rejection. 

The reviewer at the moment would have to login to see that they have a review task to complete….

Is this by design?

How can I make this send the required emails?

Thanks,
Ian
3 REPLIES 3

gravitonian
Star Collaborator
Star Collaborator
Task assignment Email notification is not supported out of the box.

You would have to use the Mail action, for example :

        <event type="node-enter">
            <!– If in sub-process then it is important that the companyhome process variable is passed into the subprocess
                from the parent job process, otherwise you get companyhome is undefined script error –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    var template = companyhome.childByNamePath("Data Dictionary/Email Templates/task-assigned-email.ftl");
                    var args = [];
                    args["someArg"] = mymodel_arg1;
                    args["someOtherArg"] = mymodel_arg2;

                    var txtMail = bpm_package.children[0].processTemplate(template, args);

                    var mail = actions.create("mail");
                    mail.parameters.to = reveiwer.properties.email;
                    mail.parameters.from = "alfresco@somecompany.com";
                    mail.parameters.subject = "A task has been assigned to you";
                    mail.parameters.text = txtMail;
                    mail.execute(bpm_package);
                </script>
            </action>


Do not forget to configure SMTP server. Also I do not think you can use the JBPM email syntax such as <task … notify="yes" as it uses different identity model than Alfresco.

quasar
Champ in-the-making
Champ in-the-making
Thanks a lot for advice! But one more question - where to put this script?

gravitonian
Star Collaborator
Star Collaborator
It can be put in a lot of different places, have a look here for an example: http://wiki.alfresco.com/wiki/WorkflowAdministration#Step_3:_Add_Behaviour_to_the_Process_Definition