AnsweredAssumed Answered

Initialise a default workflowDueDate

Question asked by vmiorga on Oct 17, 2017
Latest reply on Nov 9, 2017 by vmiorga


I am asked to set a default workflowDueDate to the workflow I implement: in 10 work day after the current date.

I already have a script to calculate this default date, my issue is to set this date.


I saw 2 places where it can be down, but I need a technical advise:


1) the first place a saw I can do it is the model.xml, in my custom type of my startTask:

                <property name="bpm:workflowDueDate">

                          <default />

but in this case I don't know how to call my script (and even if it's possible) in the model.xml


2) the second place I can imagine set this default date, will be in the bpmn:

<definitions xmlns=">
     <process id="id" name="name" isExecutable="true">
               <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
                    <activiti:field name="script">
                         <activiti:string><![CDATA[<import resource="classpath:alfresco/path/myScript.js">

      <startEvent id="start" activiti:formKey="ddg:submitGroupsReviewTask"></startEvent>

       <sequenceFlow id="flow1"  .....

The issue here is:

  1. if a call my script in the <extensionElements> of the process, it's resolved after the startTask is done, so I don't have my default dueDate set when I initialise the workflow (it will rather overwrite the date set by the user).
  2. it the same if I add the script call in the <extensionElements> in the <startEvent>.


Did some one know how set a default workflowDueDate calculated by a script?