05-01-2012 10:06 PM
<?xml version="1.0" encoding="UTF-8"?>But when I run this code, my workflow is fail. I think the problem is this :
<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" />
</start-state>
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{bpm_assignee}</actor>
</assignment>
</swimlane>
<task-node name="review">
<task name="wf:reviewTask" swimlane="reviewer">
<event type="task-create">
<script>
if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
</script>
</event>
<event type="task-assign">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<expression>
var doc1 = userhome.createFile("transform_me1.txt");
doc1.mimetype = "text/plain";
doc1.content = "This is plain text";
var mail = actions.create("mail");
mail.parameters.to = "destinationemail.com";
mail.parameters.subject = "New Alfresco workflow submission: ";
mail.parameters.from = "email.com";
mail.parameters.template = root.childByNamePath("Company Home/Data Dictionary/Email Templates/notify_user_email.ftl");
mail.parameters.text = "some text, in case template is not found";
mail.execute(doc1);
</expression>
</script>
</action>
</event>
</task>
<transition name="approve" to="approved" />
<transition name="reject" to="rejected" />
</task-node>
<task-node name="rejected">
<task name="wf:rejectedTask" swimlane="initiator" />
<transition name="" to="end" />
</task-node>
<task-node name="approved">
<task name="wf:approvedTask" swimlane="initiator" />
<transition name="" to="end" />
</task-node>
<end-state name="end" />
</process-definition>
mail.parameters.template = root.childByNamePath("Company Home/Data Dictionary/Email Templates/notify_user_email.ftl");
cause when I remove this line, the workflow works perfectly. Can anyone help me with this?05-01-2012 10:12 PM
05-23-2012 03:49 PM
06-27-2012 04:11 AM
06-27-2012 04:33 AM
if (wf_notifyMe)
{
var mail = actions.create("mail");
var template = "Dizionario dei dati/Modelli di e-mail/Modelli di e-mail di notifica/notify_user_assigned_task_email.ftl";
mail.parameters.to = bpm_assignee.properties.email;
mail.parameters.subject = "Compito: " + bpm_workflowDescription;
mail.parameters.from = initiator.properties.email;
mail.parameters.template = companyhome.childByNamePath(template);
mail.execute(bpm_package);
}
<html>
<head>
<style type="text/css"><!–
body
{
font-family: Arial, sans-serif;
font-size: 14px;
color: #4c4c4c;
}
a, a:visited
{
color: #0072cf;
}
.activity a
{
text-decoration: none;
}
.activity a:hover
{
text-decoration: underline;
}
–></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: 20px 30px 0px;">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td><div style="font-size: 22px; padding-bottom: 4px;">
Nuova attivita' da svolgere
</div><div style="font-size: 14px; margin: 18px 0px 24px 0px; padding-top: 18px; border-top: 1px solid #aaaaaa;">
<div class="activity">
<br></br><br></br>
Attivita' assegnata da ${person.properties.firstName}<#if person.properties.lastName?exists> ${person.properties.lastName}</#if>.
<br></br>
<br></br></div>
<div style="font-size: 11px; padding: 4px 0px 12px 0px;">
</div></div></td></tr></table></td></tr><tr>
<td><div style="border-top: 1px solid #aaaaaa;"> </div>
</td></tr><tr><td style="padding: 0px 30px; font-size: 13px;">
Controlla i tuoi compiti sul tuo pannello di controllo:
<a href="http://xxxxxx.yyyyy.zz:8080/share">Pannello di Controllo di Alfresco Share</a>
</td></tr><tr><td><div style="border-bottom: 1px solid #aaaaaa;"> </div>
</td></tr><tr><td style="padding: 10px 30px;">
<img src="http://xxxxxx.yyyyy.zz:8080/themes/default/images/logo.png" alt="" width="117" height="48" border="0" />
</td></tr></table></td></tr></table></td></tr></table></body>
</html>
06-27-2012 05:18 AM
ttivita' assegnata da ${person.properties.firstName}<#if person.properties.lastName?exists> ${person.properties.lastName}</#if>.
But in the process definition you don't set the mail.parameters.template_model variable.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.