cancel
Showing results for 
Search instead for 
Did you mean: 

Message and Date in Workflow

thomasberment
Champ in-the-making
Champ in-the-making
Hi, I have two little questions. I don't find anything in the Wiki and here …

1/ I want display a little message, like an error message to show initiator his initial error (eg. The custom property isn't right, you don't start this workflow.).

<decision name="condition">
      <transition name="conditionOK" to="sendMail">
         <condition>
            #{statutDoc == "Travail"}
         </condition>
      </transition>
      <transition name="conditionKO"  to="end">
         <condition>
            #{statutDoc != "Travail"}
         </condition>
                         DISPLAY A MESSAGE !
      </transition>
   </decision>


2/ I want return in my custom property, the date of workflow's end (bpm:completionDate).

<end-state name="end" >   
      <event type="process-end">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <variable name="bpm_package" access="read" />
               <variable name="bpm_completionDate" access="read" />
                   <expression>
                      bpm_package.children[0].properties["custom:daterelecture"] = bpm_completionDate;
                         bpm_package.children[0].save();
                     </expression>
            </script>
         </action>
      </event>
   </end-state>

Can you help me please ?
2 REPLIES 2

thomasberment
Champ in-the-making
Champ in-the-making
For my second question, I have a solution but I'm glad none of it.

bpm_package.children[0].properties["custom:daterelecture"] = new Date();

The date of today appears, but without the hour.

thomasberment
Champ in-the-making
Champ in-the-making
Ok second question solved :

bpm_package.children[0].properties["custom:daterelecture"] = new Datetime();