cancel
Showing results for 
Search instead for 
Did you mean: 

How to set any custom due date?

dbz
Champ on-the-rise
Champ on-the-rise
Hello, guys and girls!

I'm asking google about this the whole day, but the situation is sad…

In standard Alfresco process definitions there are following code:

if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;

This checks the bpm_workflowDueDate parameter and, if it's set, sets the dueDate for the taskInstance variable.

I looked for how to set taskInstance.dueDate to be DIFFERENT from bpm_workflowDueDate and there is no answer! Anywhere!

I've tried various variants of how to do that, like:

taskInstance.dueDate = bpm_workflowDueDate - 1;
or
taskInstance.dueDate.setDate(bpm_workflowDueDate.getDate() - 1);
or
taskInstance.dueDate.setDate(new Date(bpm_workflowDueDate) - 1);
or
taskInstance.dueDate = new Date();
or even
taskInstance.dueDate = new Date(bpm_workflowDueDate - 1);

Smiley Sad

Nothing works…

How to do what I want?
And, please, refer me to the specs where taskInstance variable defined…

Thank you very much!
2 REPLIES 2

jayjayecl
Confirmed Champ
Confirmed Champ
Best way to set any custom Due date is to provide your workflow Model with a custom date property, such as



<property name="custom:myDueDate">
<type>d:date</type>
</property>

And then edit the webclient-config-custom.xml in order to show this property on a task form


<config evaluator="node-type" condition="custom:myStartTask" replace="true">
   <property-sheet>
       <show-property name="custom:myDueDate" component-generator="DatePickerGenerator" />
   </property-sheet>
</config>

and then, in your process definition, set the bpm_dueDate with the value of your custom:myDueDate

dbz
Champ on-the-rise
Champ on-the-rise
No-no-no…
This is not a solution for me, and probably it's not a solution for all, because it isn't user-friendly, I think… )))
I solved this problem by setting tasks due dates through Java action classes assotiated with tasks.

In future this workflow should have posibility to be autostarted (I don't know how to do this yet, but I have a time for this  Smiley Happy   ) and adding some UI elements ISN'T A SOLUTION in this case.

Well, anyway, thank you for the reply!