03-03-2009 07:59 AM
<timer name="sendMail" duedate="#{bpm_workflowDueDate} - 1 business days"> or
<timer name="sendMail" duedate="#{bpm_workflowDueDate} - 1 days">
Caused by: org.alfresco.service.cmr.workflow.WorkflowException: duedate expression must evaluate to a date
03-03-2009 08:20 AM
<variable name="theDate" access="read,write"/>
<expression>
// build your date theDate right here in JS;
</expression>
03-03-2009 08:23 AM
Maybe you should try to define the date with a script / variable as
<variable name="theDate" access="read,write"/>
<expression>
// build your date theDate right here in JS;
</expression>
<variable name="theDate" access="read,write"/>
<expression>
bpm_workflowDueDate + 1;
</expression>
03-03-2009 08:31 AM
var theDate = new Date();
theDate.setDate(bpm_workflowDueDate.getDate() + 1); // 1 means 1 day
03-03-2009 08:38 AM
03-03-2009 08:39 AM
03-03-2009 10:33 AM
<swimlane name="initiator"></swimlane>
<start-state name="start">
<task name="wf:submitGroupReviewTask" swimlane="initiator" />
<transition name="" to="startreview"/>
</start-state>
<node name="startreview">
<action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
<foreach>#{people.getMembers(bpm_groupAssignee)}</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>
<!– This is the code added on your recommendation. But it doesnt work and am still getting errors–>
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="theDate" access="read,write"/>
<expression>
var theDate = new Date();
theDate.setDate(bpm_workflowDueDate.getDate()-1);
</expression>
</script>
</action>
</event>
<timer name="sendMail" duedate="theDate">
<action name="sendMail" class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var mail = actions.create("mail");
var template = companyhome.childByNamePath("…");
var txtMail = bpm_package.children[0].processTemplate(template);
mail.parameters.to = reviewer.properties.email;
mail.parameters.from = "alfresco@alfresco.com";
mail.parameters.subject = "Please Review this Document";
mail.parameters.text=txtMail;
mail.execute(bpm_package);
</script>
</action>
</timer>
<timer name="OverdueApprove" duedate="#{bpm_workflowDueDate}" transition="approve">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
if (logger.isLoggingEnabled())
logger.log("Timer expired - approving");
</script>
</action>
</timer>
<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-end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_assignee" access="write"/>
<expression>
if (taskInstance.actorId != null)
people.getPerson(taskInstance.actorId);
else
person;
</expression>
</script>
</action>
</event>
</task>
<transition name="reject" to="endreview" ></transition>
<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">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="wf_reviewerCount" access="write"/>
<expression>people.getMembers(bpm_groupAssignee).length;</expression>
</script>
</action>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="wf_requiredPercent" access="write"/>
<expression>wf_requiredPercent = wf_requiredApprovePercent;</expression>
</script>
</action>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="wf_actualPercent" access="write"/>
<expression>wf_actualPercent = ((wf_approveCount * 100) / people.getMembers(bpm_groupAssignee).length);</expression>
</script>
</action>
</event>
<transition name="reject" to="rejected" />
<transition name="approve" to="approved">
<condition>#{wf_actualPercent >= wf_requiredPercent}</condition>
</transition>
</decision>
<task-node name="rejected">
<task name="wf:rejectedParallelTask" swimlane="initiator" />
<transition to="end" />
</task-node>
<task-node name="approved">
<task name="wf:approvedParallelTask" swimlane="initiator" />
<transition to="end" />
</task-node>
<end-state name="end"/>
</process-definition>
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.