AnsweredAssumed Answered

[Résolu]Erreur intégration d'actions dans un workflow

Question asked by greg.shogun_8524 on Feb 20, 2008
Latest reply on Feb 22, 2008 by michaelh
Bonjour,

J'ai fais un workflow qui fonctionne mais je n'arrive pas à insérer des actions en
Javascript dans la définition.
Par exemple je voudrais envoyer un mail lorsque mon workflow est terminer.
Le problème c'est que quand j'arrive à cette étape le workflow se plante et j'ai un
message d'erreur qui apparait dans l'interface de mon client web.

Je mets si dessous les codes de la définition du workflow et du modèle, pourriez-vous
y jeter un oeil et me dire ce qui fait planter mon workflow? Merci d'avance.

test_processdefinition.xml

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

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="scwf:test">
 
  <!–Definition des swimlanes–>
  <swimlane name="initiator">
     
  </swimlane>
 
  <swimlane name="assignee1">
     <!–
     <assignment class="org.alfresco.repo.workflow.jpbm.AlfrescoAssignment">
       <pooledactors>#{people.getGroup('GROUP_infochef')}</pooledactors>
   </assignment>
   –>
   <assignment actor-id="xxxxxx"/>
  </swimlane>
 
  <swimlane name="assignee2">
     <!–
     <assignment class="org.alfresco.repo.workflow.jpbm.AlfrescoAssignment">
       <pooledactors>#{people.getGroup('GROUP_secretaire')}</pooledactors>
     </assignment>
   –>
   <assignment actor-id="yyyyyy"/>
  </swimlane>
   
  <!–Definition du processus–>
  <start-state name="start">
     <task name="scwf:submitReviewTask" swimlane="initiator"/>
   <transition name="submit" to="Submit">
   <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavascript">
        <script>
          var doc = userhome.createFile("test.txt");
        doc.content = "Texte seulement pour le test.";
      </script>
     </action>
   </transition>
  </start-state>
 
  <node name="Submit">
     <event type="node-enter">
       <script>
          <variable name="approveCount" access="read,write"/>
      <expression>
        approveCount=0;
      </expression>
       </script>
     </event>
   <transition name="fork1" to="fork1">
    
   </transition>
  </node>
 
  <fork name="fork1">
     <transition name="Assignee1 review" to="Assignee1 review"/>
   <transition name="Assignee2 review" to="Assignee2 review"/>
  </fork>
 
  <task-node name="Assignee1 review">
    <task name="scwf:assignee1Review" swimlane="assignee1"/>
   <transition name="approve" to="join1">
     <script>
        <variable name="approveCount" access="read,write"/>
      <expression>
        approveCount = approveCount + 1;
      </expression>
     </script>
   </transition>
   <transition name="reject" to="join1"/>
  </task-node>
 
  <task-node name="Assignee2 review">
    <task name="scwf:assignee2Review" swimlane="assignee2"/>
   <transition name="approve" to="join1">
     <script>
        <variable name="approveCount" access="read,write"/>
      <expression>
        approveCount = approveCount + 1;
      </expression>
     </script>
   </transition>
   <transition name="reject" to="join1"/>
  </task-node>
 
  <join name="join1">
     <transition name="all approve" to="All approve"/>
  </join>
 
  <decision name="All approve">
     <transition name="reject" to="Revise"/>
   <transition name="end1" to="end1">
     <condition>#{approveCount == 2}</condition>
   </transition>   
  </decision>
 
  <task-node name="Revise">
     <task name="scwf:revise" swimlane="initiator"></task>
   <transition name="submit" to="Submit"></transition>
   <transition name="done" to="end1"></transition>
  </task-node>
     
  <end-state name="end1"/>
</process-definition>

testModel.xml

<?xml version="1.0" encoding="utf-8"?>
<model name="scwf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

<imports>
  <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
  <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
</imports>

<namespaces>
  <namespace uri="alfresco.extension.workflows.simple-process" prefix="scwf"/>
</namespaces>

<types>
   
  <type name="scwf:submitReviewTask">
     <parent>bpm:startTask</parent>
  </type>
 
  <type name="scwf:assignee1Review">
     <parent>bpm:workflowTask</parent>
   <overrides>
     <property name="bpm:packageItemActionGroup">
        <default>read_package_item_actions</default>
     </property>
   </overrides>
  </type>
 
  <type name="scwf:assignee2Review">
     <parent>bpm:workflowTask</parent>
   <overrides>
     <property name="bpm:packageItemActionGroup">
        <default>read_package_item_actions</default>
     </property>
   </overrides>
  </type>
 
  <type name="scwf:revise">
     <parent>bpm:workflowTask</parent>
   <overrides>
     <property name="bpm:packageItemActionGroup">
        <default>edit_package_item_actions</default>
     </property>
   </overrides>
  </type>
 
   
</types>

</model>

Outcomes