AnsweredAssumed Answered

[Résolu]Passage de parametre entre Tasks

Question asked by slipknotik on Jan 7, 2010
Latest reply on Jan 11, 2010 by slipknotik
salut à tous, j'ai créer un workflow "demande d'un congé", l'employé remplit des paramètre dans la nœud y associée comme son nom, prénom ,date du début et date de fin.
mon besoin est de récupérer ces valeurs dans la noeud suivant qui associé à son superieur en lecture seul.
comment je peut visualiser ces paramètres dans cette noeud?

voici mon modèle :


<?xml version="1.0" encoding="utf-8" ?>
<model name="sawf:workflowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Conge Workflow</description>
   <author>Jack</author>
   <version>1.0</version>
   
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
</imports>


<namespaces>
<namespace uri="new.workflow.conge" prefix="sawf"/>
</namespaces>


<constraints>
      <constraint name="sawf:causeList" type="LIST">
         <parameter name="allowedValues">
            <list>
                  <value>Maladie</value>               
              <value>Autre</value>                
            </list>
         </parameter>
      </constraint> 
      </constraints>


<types>
<type name="sawf:Submit">
<parent>bpm:startTask</parent>
</type>

<type name="sawf:Envoye">
<parent>bpm:workflowTask</parent>
<properties>
<property name="sawf:Matricule">
<type>d:int</type>
</property>

<property name="sawf:Nom">
<type>d:text</type>
</property>

<property name="sawf:Prenom">
<type>d:text</type>
</property>

<property name="sawf:Dated">
<type>d:date</type>
</property>

<property name="sawf:Datef">
<type>d:date</type>
</property>

<property name="sawf:Cause">
<type>d:text</type>

<constraints>
   <constraint ref="sawf:causeList"/>
</constraints>
</property>


</properties>
<mandatory-aspects>
   <aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>

<type name="sawf:RespH_Tache">
<parent>bpm:workflowTask</parent>


<overrides>
<property name="bpm:packageItemActionGroup">
<default>read_package_item_actions</default>
</property>
</overrides>


</type>


<type name="sawf:Ordre_Tache">
<parent>bpm:workflowTask</parent>


<overrides>
<property name="bpm:packageItemActionGroup">
<default>read_package_item_actions</default>
</property>
</overrides>
</type>




</types>
</model>
 

la définition du processus :

<?xml version="1.0" encoding="UTF-8"?>

<process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="sawf:congesawf">
   <swimlane name="initiator"></swimlane>
      <swimlane name="RespH">
   <assignment actor-id="#{bpm_assignee.properties['cm:userName']}"/>
   </swimlane>
   <swimlane name="Ordre">
   <assignment actor-id="Ordre"/>
   </swimlane>
   <start-state name="Initialisation">
<task name="sawf:Submit" swimlane="initiator"/>
      <transition name="Envoyer" to="Envoie Demande"></transition>
   </start-state>

   
   <task-node name="Envoye Demande">
   <task name="sawf:Envoye" swimlane="initiator">
   
      <event type="task-create">
            <!– Set the due date and the priority of the task –>
            <script>
               if(sawf_Nom != void) taskInstance.Nom = sawf_Nom;
               if(sawf_Prenom != void)  taskInstance.Prenom = sawf_Prenom;
               if(sawf_Matricule != void) taskInstance.Matricule = sawf_Matricule;
               if(sawf_Dated != void)  taskInstance.Dated = sawf_Dated;
               if(sawf_Datef != void) taskInstance.Datef = sawf_Datef;
               if(sawf_Cause != void)  taskInstance.Cause = sawf_Cause;
            
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
   
   
   </task>
      <transition name="Demande Conge" to="Validation"></transition>
   </task-node>

   <task-node name="Validation">
   <task name="sawf:RespH_Tache" swimlane="RespH"/>

      <transition name="valider conge" to="Ordre"></transition>
      <transition name="refuser" to="Finalisation"></transition>
   </task-node>

   <task-node name="Ordre">
   <task name="sawf:Ordre_Tache" swimlane="Ordre"/>
   

   
   
      <transition  to="Finalisation"></transition>
      
   </task-node>

   <end-state name="Finalisation">

</end-state>
</process-definition>
  


et la portion du web-client-config-custom associé :


   
   <config evaluator="node-type" condition="sawf:Submit" replace="true">
<property-sheet>
<separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>
<show-property name="bpm:workflowDescription" componentgenerator="TextAreaGenerator"/>
</property-sheet>
</config>

<config evaluator="node-type" condition="sawf:Envoye">
   <property-sheet>
      <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
      <show-property name="bpm:taskId" />
      <show-property name="bpm:description" component-generator="TextAreaGenerator" />
      <show-property name="bpm:status" />
      <show-property name="bpm:dueDate" />
      <show-property name="bpm:priority" />
   <separator name="sep2" display-label="Personnel" component-generator="HeaderSeparatorGenerator" />   
      <show-property name="sawf:Matricule" component-generator="TextAreaGenerator"></show-property>
      <show-property name="sawf:Nom" component-generator="TextAreaGenerator"></show-property>
      <show-property name="sawf:Prenom" component-generator="TextAreaGenerator"></show-property>
      <show-property name="sawf:Dated"></show-property>
      <show-property name="sawf:Datef"></show-property>
      <show-property name="sawf:Cause"></show-property>
      
      <separator name="sep3" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
   <show-association name="bpm:assignee"/>
   </property-sheet>
</config>


<config evaluator="node-type" condition="sawf:RespH_Tache" replace="true">
<property-sheet>
   <separator name="sep21" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>
   <show-property name="bpm:priority"/>
   <show-property name="bpm:dueDate"/>
   <show-property name="bpm:description" componentgenerator="TextAreaGenerator" read-only="true"/>
<separator name="sep22" display-label="Pesrsonnel" component-generator="HeaderSeparatorGenerator" />   
      <show-property name="sawf:Matricule" component-generator="TextAreaGenerator" read-only="true"></show-property>
      <show-property name="sawf:Nom" component-generator="TextAreaGenerator" read-only="true"></show-property>
      <show-property name="sawf:Prenom" component-generator="TextAreaGenerator" read-only="true"></show-property>
      <show-property name="sawf:Dated" read-only="true"></show-property>
      <show-property name="sawf:Datef" read-only="true"></show-property>
      <show-property name="sawf:Cause" read-only="true"></show-property>

</property-sheet>
</config>

<config evaluator="node-type" condition="sawf:Ordre_Tache" replace="true">
<property-sheet>
<separator name="sep31" display-label-id="general" componentgenerator="HeaderSeparatorGenerator"/>
<show-property name="bpm:priority"/>
<show-property name="bpm:dueDate"/>
<show-property name="bpm:description" componentgenerator="TextAreaGenerator" read-only="false"/>
<separator name="sep32" display-label="Pesrsonnel" component-generator="HeaderSeparatorGenerator" />   
      <show-property name="sawf:Matricule" component-generator="TextAreaGenerator" read-only="true"></show-property>
      <show-property name="sawf:Nom" component-generator="TextAreaGenerator" read-only="true"></show-property>
      <show-property name="sawf:Prenom" component-generator="TextAreaGenerator" read-only="true"></show-property>
      <show-property name="sawf:Dated" read-only="true"></show-property>
      <show-property name="sawf:Datef" read-only="true"></show-property>
      <show-property name="sawf:Cause" read-only="true"></show-property>
      </property-sheet>
</config>

si vous avez des remarques qui peuvent améliorer ce workflow, n'hésitez pas à les poser .
merci

Outcomes