Esempi di Automazione

Modello email personalizzato

# use the I18N class to display localized labels, the recipient's locale will be used
$I18N.get('dear') $assignee.fullName, $I18N.get('youareassignedtotask') <b>$taskName</b> $I18N.get('ofworkflow') <b>$workflow</b>
<hr/>

# display the links to take one of the possible actions defined for the current task
<b>$I18N.get('actions')</b>:
#foreach( $action in $actions)
  | <a target="_blank" href="/$WorkflowTool.completeUrl($task, $action, $assignee)">$action</a>
#end
<hr/>

# display the clickable list of the documents appended to the current workflow
<b>$I18N.get('documents')</b>:
#foreach( $doc in $documents )
  <br/>$doc.fileName | <a target="_blank" href="/$DocTool.downloadUrl($doc)">$I18N.get('download')</a> | <a target="_blank" href="/$DocTool.displayUrl($doc)">$I18N.get('display')</a>
#end

# iterate over the events of the current workflow to find the most recent one and save it in the lastAction variable
#set($hists = $WorkflowTool.getHistories($processId, null))
#foreach( $hhit in $hists )
   #if($hhit.taskName)
     #if($hhit.taskName != $taskName)
        #set($lastAction = $hhit)
        #break
     #end 
   #end   
#end

# display the last action taken inside the workflow
#if($lastAction) 
  <br/><br/>last taken action: $lastAction.taskName 
#end

# retrieves all the workflow annotations left until now
#set($hists = $WorkflowTool.getHistories($processId, 'task.note'))

# prepare a table to display the workflow annotations
<br/><br/>Annotations<br/>
<table>
<tr><td>Date</td><td>User</td><td>Annotation</td></tr>

#foreach( $hhit in $hists )
   <tr>
      <td>$hhit.date</td>
      <td>$hhit.username</td>
      <td>$hhit.comment</td>
   </tr>
#end
</table>

Una personalizzazione del modello e-mail utilizzato per notificare agli utenti le attività del flusso di lavoro. Questa proposta differisce dal modello standard perché include l'elenco delle annotazioni lasciate sul flusso di lavoro dagli altri utenti. In questo script puoi vedere l'uso della classe I18N per stampare etichette localizzate. L'istanza del flusso di lavoro corrente è referenziata dalla variabile processId.