cancel
Showing results for 
Search instead for 
Did you mean: 

E-mail notification not working in workflow

roxanne
Champ in-the-making
Champ in-the-making
Hi,

Assuming I have to include the email notification into the process definition, what I think I have to do is add the following to each task_node in the workflow in order for a mail to be sent automatically to the owner of the task as each task is initiated.

Does we need to do any other configuration?


<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wft:review">

    <swimlane name="initiator"></swimlane>

    <start-state name="start">
        <task name="wft:submitReviewTask" swimlane="initiator" />
        <transition name="" to="review">
       <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
         var mail = actions.create('mail');
         mail.parameters.to = 'shakeeb@hydhtc75657.com'; // or maybe person.properties["cm:email"];
         mail.parameters.from = 'shakeeb@hydhtc75657.com';
         mail.parameters.subject = 'Please Review this Document';
         mail.parameters.text = 'Blah blah blah\n\n';
         mail.parameters.text += 'Doc: http://www.srv.com/alfresco/d/a/workspace/SpacesStore/a9...fd/doc.pdf';
         mail.execute(document);
         
           </script>
         </action>
       </transition>
    </start-state>

<swimlane name="assignee">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{bpm_assignee}</actor>
      </assignment>
   </swimlane>
    <task-node name="review">

        <task name="wft:reviewTask" swimlane="assignee">
          
        </task>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approved">
           
        </transition>
    </task-node>          
    <task-node name="rejected">
        <task name="wft:rejectedTask" swimlane="initiator" />
        <transition to="end" />
    </task-node>

    <task-node name="approved">
        <task name="wft:approvedTask" swimlane="initiator" />
        <transition to="submitted" />
    </task-node>

<task-node name="submitted">
        <event type="node-enter">
           <action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
           <action class="org.alfresco.repo.avm.wf.AVMDeployHandler"/>
        </event>
        <task name="wft:submittedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>
    <end-state name="end"/>

</process-definition>






Thanks!
Please reply soon!!!!!!!!!!!
Rox
2 REPLIES 2

roxanne
Champ in-the-making
Champ in-the-making
Hi Bel,

i have  given following  entry in repository.properties placed at C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco

# Email configuration
mail.host=servername
mail.port=2511
mail.username=admin
mail.password=admin
# Set this value to UTF-8 or similar for encoding of email messages as required
mail.encoding=UTF-8
# Set this value to 7bit or similar for Asian encoding of email headers as required
mail.header=
mail.from.default=email id

But still i am not getting email notification working in process_definition.xml .

Thanks
Rox

pettazz
Champ in-the-making
Champ in-the-making
I don't really know what this refers to, but in my processdefinition, the last line of the mail block for the Javascript is mail.execute(bpm_package); instead of mail.execute(document);

Try that?