10-17-2017 12:03 PM
Hello,
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:
<overrides>
<property name="bpm:workflowDueDate">
<mandatory>true</mandatory><default />
</property>
</overrides>
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="http://www.omg.org/.........>
<process id="id" name="name" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><
11-09-2017 08:36 AM
A point on the situation:
I made a custom date-display.ftl, which is a copy of the native file date.ftl.
In my ftl I add the script I need to calculate the default due date to set : function calc_date_mini(nbjour){ ... }
Now I would to set the result get from this function in the property value from the date input. Something like:
<input id="${controlId}-date" value=calc_date_mini(nbjour) name="-" type="text" class="date-entry" <#if field.description??>title="${field.description}"</#if> <#if disabled>disabled="true"<#else>tabindex="0"</#if>></input>#
I figure that it's no possible to call the fonction like this, so I tried whit a second script in the end of my ftl, which would set the value by retriving the element, by calling document.getElementById("${controlId}-date"), but in this case the element is null and the input value is not set.
Did someone know how I can achieve my aim?
Explore our Alfresco products with the links below. Use labels to filter content by product module.