07-29-2015 10:53 AM
mail.parameters.to_many = ['ageorge', 'GROUP_DOCUMENT_TEST'];
mail.execute(bpm_package.children[0].nodeRef);
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="docWorkflow" isExecutable="true">
<startEvent id="start" activiti:initiator="initiatorUserName" activiti:formKey="docWorkflow:start">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[/*Script to set execution variables here*/]]></activiti:string>
</activiti:field>
</activiti:executionListener>
<activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[var mail = actions.create("mail");
mail.parameters.to_many = GROUP_DOCUMENT_TEST;
mail.parameters.subject = "Alfresco: " + person.properties.firstName + " " + person.properties.lastName + " has sent you an item";
mail.parameters.from = "alfresco-noReply@cdotech.com";
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/Send Document Notification/send_document_notification.html.ftl");
mail.parameters.text = "The email template failed to load. Please contact the Alfresco administrator.";
// Execute mail package
mail.execute(bpm_package.children[0].nodeRef);]]></activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</startEvent>
<sequenceFlow id="sequenceFlow1" sourceRef="start" targetRef="intermediateEvent1"></sequenceFlow>
<intermediateCatchEvent id="intermediateEvent1" name="Delay step">
<timerEventDefinition>
<timeDuration>PT1S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<endEvent id="end">
</endEvent>
<sequenceFlow id="sequenceFlow2" sourceRef="intermediateEvent1" targetRef="end"></sequenceFlow>
</process>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="docWorkflow:model">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0'/>
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0'/>
<import prefix="bpm" uri="http://www.alfresco.org/model/bpm/1.0'/>
</imports>
<namespaces>
<namespace prefix="docWorkflow" uri="http://www.alfresco.org/model/dynamic-workflow/docWorkflow/1.0'/>
</namespaces>
<types>
<type name="docWorkflow:start">
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>docWorkflow:selectpeople</aspect>
<aspect>docWorkflow:selectgroup</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="docWorkflow:selectpeople">
<associations>
<association name="docWorkflow:selectpeople">
<title>Select People</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:person</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</aspect>
<aspect name="docWorkflow:selectgroup">
<associations>
<association name="docWorkflow:selectgroup">
<title>Select Group(s)</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:authorityContainer</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</aspect>
</aspects>
</model>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alfresco-configuration>
<config condition="docWorkflow:start" evaluator="task-type">
<forms>
<form>
<field-visibility>
<show id="docWorkflow:selectpeople"/>
<show id="docWorkflow:selectgroup"/>
<show id="packageItems"/>
<show id="transitions"/>
</field-visibility>
<appearance>
<set appearance="title" label-id="Recipients" id="info"/>
<field set="info" label-id="Select People" id="docWorkflow:selectpeople"/>
<field set="info" label-id="Select Group(s)" id="docWorkflow:selectgroup"/>
<set appearance="title" label-id="Document(s)" id="documents"/>
<field set="documents" label-id="Files" id="packageItems"/>
<set id="response"/>
<field set="response" id="transitions"/>
</appearance>
</form>
</forms>
</config>
<config condition="activiti$docWorkflow" evaluator="string-compare">
<forms>
<form>
<field-visibility>
<show id="docWorkflow:selectpeople"/>
<show id="docWorkflow:selectgroup"/>
<show id="packageItems"/>
<show id="transitions"/>
</field-visibility>
<appearance>
<set appearance="title" label-id="Recipients" id="info"/>
<field set="info" label-id="Select People" id="docWorkflow:selectpeople"/>
<field set="info" label-id="Select Group(s)" id="docWorkflow:selectgroup"/>
<set appearance="title" label-id="Document(s)" id="documents"/>
<field set="documents" label-id="Files" id="packageItems"/>
<set id="response"/>
<field set="response" id="transitions"/>
</appearance>
</form>
</forms>
</config>
</alfresco-configuration>
<html>
<head>
<style type="text/css"><!–
body
{
font-family: Arial, sans-serif;
font-size: 14px;
color: #4c4c4c;
}
a, a:visited
{
color: #0072cf;
}
–></style>
</head>
<body bgcolor="#dddddd">
<table width="100%" cellpadding="20" cellspacing="0" border="0" bgcolor="#dddddd">
<tr>
<td width="100%" align="center">
<table width="70%" cellpadding="0" cellspacing="0" bgcolor="white" style="background-color: white; border: 1px solid #aaaaaa;">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding: 10px 30px 0px;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<img src="${shareUrl}/res/components/images/page-64.png" alt="" width="64" height="64" border="0" style="padding-right: 20px;" />
</td>
<td>
<div style="font-size: 22px; padding-bottom: 4px;">
${person.properties.firstName} <#if person.properties.lastName?exists> ${person.properties.lastName}</#if> has sent you a new content item, ${document.name}, in the ${document.siteShortName!""} site
</div>
<div style="font-size: 13px;">
${date?datetime?string.full}
</div>
</td>
</tr>
</table>
<div style="font-size: 14px; margin: 12px 0px 24px 0px; padding-top: 10px; border-top: 1px solid #aaaaaa;">
<p>Hi,</p>
<p>${person.properties.firstName}
<#if person.properties.lastName?exists> ${person.properties.lastName}</#if>
has sent you a new content item, ${document.name}, in the ${document.siteShortName!""} site.
<p>Click this link to view the item:<br />
<br />${document.shareUrl}</p>
<p>Sincerely,<br />
Alfresco</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div style="border-bottom: 1px solid #aaaaaa;"> </div>
</td>
</tr>
<tr>
<td style="padding: 10px 30px;">
<img src="${shareUrl}/themes/default/images/app-logo.png" alt="" width="117" height="48" border="0" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
05-25-2017 07:41 AM
Hi,
I am also having same requirement. Does anyone has any idea to achieve this?
Thanks,
Prasobhraj
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.