10-01-2009 07:16 AM
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:parallelreview">
<swimlane name="initiator"></swimlane>
<start-state name="start">
<task name="wf:submitParallelReviewTask" swimlane="initiator"/>
<transition name="" to="startreview"/>
</start-state>
<node name="startreview">
<action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
<foreach>#{bpm_assignees}</foreach>
<var>reviewer</var>
</action>
<event type="node-enter">
<script>
<variable name="wf_approveCount" access="write" />
<expression>
wf_approveCount = 0;
</expression>
</script>
</event>
<transition name="review" to="review" />
</node>
<task-node name="review">
<task name="wf:reviewTask">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{reviewer}</actor>
</assignment>
</task>
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].setInheritsPermissions(false);
var permissions = bpm_package.children[i].permissions;
var acl=[];
for (var j=0; j < permissions.length; j++)
{
acl = permissions[j].split(";");
var perm=acl[2];
var grp=acl[1];
bpm_package.children[i].removePermission(perm,grp);
}
bpm_package.children[i].setPermission("Consumer", reviewer.properties["cm:userName"]);
}
var mail = actions.create("mail");
mail.parameters.to = "correo@correo.es";
mail.parameters.subject = "Notificacion de tarea asignada";
mail.parameters.from = "noreply@notasinternas.edu.gva.es";
mail.parameters.text = reviewer.properties["cm:userName"]+"No responda a este mensaje.Tiene una tarea ASIGNADA debe revisarla aqui http://notasinternas.edu.gva.es";
mail.execute(bpm_package);
</script>
</action>
</event>
<transition name="reject" to="endreview" />
<transition name="approve" to="endreview">
<script>
<variable name="wf_approveCount" access="read,write" />
<expression>
wf_approveCount = wf_approveCount +1;
</expression>
</script>
</transition>
</task-node>
<join name="endreview">
<transition to="isapproved" />
</join>
<decision name="isapproved">
<event type="node-enter">
<script>
<variable name="wf_reviewerCount" access="write"/>
<variable name="wf_requiredPercent" access="write"/>
<variable name="wf_actualPercent" access="write"/>
<expression>
wf_requiredPercent = wf_requiredApprovePercent;
wf_reviewerCount = bpm_assignees.size();
wf_actualPercent = ((wf_approveCount * 100) / wf_reviewerCount);
</expression>
</script>
</event>
<transition name="reject" to="rejected" />
<transition name="approve" to="approved">
<condition>#{wf_actualPercent >= wf_requiredApprovePercent}</condition>
</transition>
</decision>
<task-node name="rejected">
<transition to="end" />
</task-node>
<task-node name="approved">
<transition to="end" />
</task-node>
<end-state name="end"/>
</process-definition>
10-01-2009 07:53 AM
10-01-2009 08:01 AM
10-01-2009 09:20 AM
10-01-2009 10:13 AM
10-01-2009 10:32 AM
10-01-2009 11:33 AM
document.setInheritsPermissions(false);
var permissions = document.permissions;
var acl=[];
for (var j=0; j < permissions.length; j++)
{
acl = permissions[j].split(";");
var perm=acl[2];
var grp=acl[1];
document.removePermission(perm,grp);
}
document.setPermission("Consumer", "user1");
document.setPermission("Consumer", "user2");
document.save();
var mail = actions.create("mail");
mail.parameters.to="correo";
mail.parameters.subject = "Permisos";
mail.parameters.from = "noreply@notasiternas.edu.gva.es";
mail.parameters.text = "hola hola hola";
var doc=companyhome.childByNamePath("Data Dictionary/Email Templates/notify_user_email.ftl");
mail.execute(doc);
10-01-2009 11:40 AM
10-01-2009 11:52 AM
10-01-2009 12:01 PM
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.