cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to pass workflow information in E-mail

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

I want to pass filename, file path, start date of the work flow, description through mail, as a part of e-mail notification through workflow.

Can any1 help me?!!!!!!!!!!!!!


Smiley Sad
1 REPLY 1

pettazz
Champ in-the-making
Champ in-the-making
You need to have the fields you want defined in the workflow model for the tasks that need to have access to them. Then you can handle all that with Javascript.

Like mine. Say for my "myWorkflow" task, I define

            <property name="mywf:Name">
               <title>Name</title>
               <type>d:text</type>
            </property>
in the model. Then in the processdefinition, I can do this in the "myWorkflow" task:
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               var mail = actions.create("mail");
                   mail.parameters.to = bpm_assignee.properties["cm:email"];
                   mail.parameters.subject = "Hey Buddy";
                   mail.parameters.from = initiator.properties["cm:email"];
                   mail.parameters.text = "Dear " + mywf_Name + ", \n\n" + initiator.properties.firstName + " " + initiator.properties.lastName + " Says hello!";
                   mail.execute(bpm_package);
            </script>
         </action>

You can access these properties using namespace + _ + property name and do whatever you want with them in Javascript.