AnsweredAssumed Answered

Starting a timer only if bpm:dueDate is set

Question asked by bedag-moo on Jan 30, 2008
Latest reply on Feb 1, 2008 by bedag-moo
I am working on a workflow where bpm:dueDate is not mandatory, but if one is set the initiator should be notified if it is missed. I have successfully attached a timer to the task:

         <timer duedate="#{bwf_editDueDate}">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  var mail = actions.create("mail");
                  mail.parameters.to = initiator.properties["cm:email"];
                  mail.parameters.subject = "Zeitüberschreitung: " + bpm_workflowDescription;
                  mail.parameters.from = "Alfresco";
                  mail.parameters.text = person.properties.firstName + " " + person.properties.lastName +
                     " hat den Auftrag " + bpm_workflowDescription + " nicht rechtzeitig erledigt.";
                  mail.execute(bpm_package);
               </script>
            </action>
         </timer>

However, this throws an exception if bpm:dueDate is null. Is there a way to set a timer only if bpm:dueDate is set?

Outcomes