cancel
Showing results for 
Search instead for 
Did you mean: 

Send e-mail when person is assigned workflow

durrell
Champ in-the-making
Champ in-the-making
I've researched this and can't find a definitive answer. I'm sure it's fairly straight forward, but I just can't figure out the swimlanes and task events, blah blah blah.

Can anyone point me in the right direction? Basically I need:

Assign document to user for review > send user e-mail notifying them to check dashboard > click document from dashboard > accept or reject > end
47 REPLIES 47

durrell
Champ in-the-making
Champ in-the-making
I'm testing in Alfresco Explorer, but I plan to use it in both Explorer and Share.

lucille_arkenst
Champ in-the-making
Champ in-the-making
By any chance, do you know what files are supposed to be modified in order to display it in Share?

durrell
Champ in-the-making
Champ in-the-making
I'm pretty sure the workflow files are the same regardless. You won't ever see the option to e-mail in Explorer or Share, it will just happen once the workflow begins.

thomasberment
Champ in-the-making
Champ in-the-making
Hi, I will want to know if you have a solution to configure a proxy in Alfresco ?
I searched with no success …

thomasberment
Champ in-the-making
Champ in-the-making
Hey, finaly I have succesfully to send an Email with Alfresco. The problem was the proxy, I can't used the Gmail configuration. Now I use the configuration with the mail server of my company and it works very good.

vinaxwater
Champ in-the-making
Champ in-the-making
please, use small code send mail ( search google ^^ ) for check request to mail server. Firewall in alfresco server is stoped !!!

Regards

sanket
Champ on-the-rise
Champ on-the-rise
Hey guys,
Have u managed to just send an email ?
OR
Have u managed to send an email on start of a workflow ?

I am using Alfresco3.2r2, I have modifed the review_processDefinition.xml and its not working.
My email configuration is working fine. All other emails are received.

But its not working on start of a workflow.

thomasberment
Champ in-the-making
Champ in-the-making
I send an email on start of a workflow and on different tasks …

Can you display your start-state code?

sanket
Champ on-the-rise
Champ on-the-rise
Yes sure…
I have pasted the entire code…in case if I have made a mistake, you can spot it out.

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

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

        <swimlane name="initiator" />
        <start-state name="start">
            <task name="wf:submitReviewTask" swimlane="initiator"/>
             <transition name="" to="review" />
             <transition name="inReview" to="node1">
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                   <script>
                      <variable name="bpm_package" access="read" />
                      <expression>
                         bpm_package.children[0].properties["custom:statutdocument"] = "En relecture";
                         bpm_package.children[0].save();
                      </expression>
                   </script>
                </action>
             </transition>
        </start-state>

       <swimlane name="reviewer">
          <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
             <actor>#{bpm_assignee}</actor>
          </assignment>  
       </swimlane>
      
       <node name="node1">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
             <script>
                <variable name="bpm_package" access="read" />
                <variable name="bpm_assignee" access="read" />
                   <expression>
                      <!– Send a notification email to the reviewer–>
                    var mail = actions.create("mail");
                    mail.parameters.from = "sanket.mehta@mycompany.com";
                    mail.parameters.to = bpm_assignee.properties.email;
                    mail.parameters.subject = "New Review Task";
                    <!–mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/notify_user_email.ftl");–>
                    mail.parameters.text = "A document awaiting your approval at Alfresco";
                    mail.execute(bpm_package.children[0]);
                      </expression>
             </script>
          </action>
          <transition to="review"></transition>
       </node>   
      
        <task-node name="review">
            <task name="wf:reviewTask" swimlane="reviewer">
                <event type="task-create">
                  <script>
                     <variable name="bpm_package" access="read" />
                     <variable name="bpm_assignee" access="read" />
                     <expression>
                     if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                      if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                       </expression>
                </script>
                </event>
            </task>
          <transition name="reject" to="rejected">
          </transition>
          
            <transition name="approve" to="approved">
            </transition>
        </task-node>
      
        <task-node name="rejected">
            <task name="wf:rejectedTask" swimlane="initiator" />
            <transition name="" to="end">
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                   <variable name="bpm_package" access="read" />
                       <expression>
                          bpm_package.children[0].properties["custom:statutdocument"] = "Travail";
                             bpm_package.children[0].save();
                         </expression>
                </script>
             </action>
            </transition>
        </task-node>
      
        <task-node name="approved">
            <task name="wf:approvedTask" swimlane="initiator" />
            <transition name="" to="end">
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                   <variable name="bpm_package" access="read" />
                       <expression>
                          bpm_package.children[0].properties["custom:statutdocument"] = "Relu";
                             bpm_package.children[0].save();
                         </expression>
                </script>
             </action>
            </transition>
        </task-node>

        <end-state name="end" />

    </process-definition>

vinaxwater
Champ in-the-making
Champ in-the-making
Dear,
first: it run error or run not error but receive email?
second:
1. The tag <expression></expression> ought to use in <decision></decision>
Ex:

<decision name="isViewed">
      <event type="node-enter">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_reviewerCount" access="write"/>
                 <expression>people.getMembers(people.getGroup('GROUP_bom')).length;</expression>
              </script>
           </action>
        </event>
      <transition to="Rejected" name="isFalse">
         <condition>#{wf_approveCount == 0}</condition>
      </transition>
      <transition to="Approve" name="isTrue">
         <condition>#{wf_approveCount >= wf_reviewerCount}</condition>
      </transition>
</decision>
2. in tag <node></node> ought to use <script></script>
Ex:

<node name="HOApp">
      <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
            <foreach>#{people.getMembers(people.getGroup('GROUP_hoheads'))}</foreach>
            <var>hoheads</var>
        </action>
      <transition to="HOApproved">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                 <script>
                    if (wf_memoNotifyMe)
                    {
                       var mail = actions.create("mail");
                       mail.parameters.to = hoheads.properties.email;
                       mail.parameters.subject = "Memo Task " + bpm_workflowDescription;
                       mail.parameters.from = initiator.properties.email;
                       mail.parameters.text = "It's done";
                       mail.execute(bpm_package);
                    }
                 </script>
           </action>
      </transition>
</node>

Goodluck Regards
vinaxwater