AnsweredAssumed Answered

problème workflow : tutoriel de Grégory HELBIN.

Question asked by ptitmat on Jul 9, 2009
Latest reply on Aug 3, 2009 by ptitmat
Bonjour,
J’essaie d’installer un worklow en suivant le tutoriel de Grégory HELBIN.

Je n'utilise pas eclipse pour ce Workflow, j'implémente tout à la main.

Dans le répertoire WEB-inf/alfersco/…/
Pour ce faire, je me suis créé un répertoire workflowMathieu où j’ai créé les fichiers testModel.xml, workflow-messages.properties et test_processdefinition.xml

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 actor-id="admin" />
  </swimlane>
  <swimlane name="assignee2">
    <assignment actor-id="admin" />
  </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">

        <!– Ajout de l'aspect versionable au document concerne –>
        <script>var test = bpm_package; var doc = test.children[0];
        doc.addAspect("cm:versionable"); doc.save();</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" />
  </node>
  <fork name="fork1">
    <transition name="Assignee1 review" to="Assignee1 review">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">

        <!– Envoie du mail a assignee1 –>
      </action>
    </transition>
    <transition name="Assignee2 review" to="Assignee2 review">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
      </action>
    </transition>
  </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">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">

        <!– Envoie du mail a initiator si son rapport est rejete –>
      </action>
    </transition>
    <transition name="end1" to="end1">
      <condition>#{approveCount == 2}</condition>
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">

        <!– Envoie du mail a initiator si son rapport est approuve–>
      </action>
    </transition>
  </decision>
  <task-node name="Revise">
    <task name="scwf:revise" swimlane="initiator"></task>
    <transition name="submit" to="Submit">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">

        <!– deplacement du fichier–>
        <script>var dest = bpm_context.parent.childByNamePath("en
        cours de relecture"); if(dest!=null) { for (var i = 0; i
        &lt; bpm_package.children.length; i++) {
        bpm_package.children[i].move(dest); } }</script>
      </action>
    </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="scwf.testModel"   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_and_delete_wcm_package_item_actions</default>
        </property>
      </overrides>
    </type>
  </types>
</model>

J'ai essayé de modifier plusieurs fois la ligne
<namespaces>
    <namespace uri="scwf.testModel"   prefix="scwf" />
  </namespaces>
Vous avez ici mon dernier test.

workflow-messages.properties

# Test Definitions
scwf_test.workflow.title=Rapport au collège
scwf_test.workflow.description=Procédure d'envoie d'un rapport au collège
scwf_workflowmodel.type.scwf_submitReviewTask.title=Validation du rapport
scwf_workflowmodel.type.scwf_submitReviewTask.description=Validation d'un
rapport au collège
scwf_workflowmodel.type.scwf_assignee1Review.title=Validation Mr Boucqueau
scwf_workflowmodel.type.scwf_assignee1Review.description=Validation par Mr
Boucqueau
scwf_workflowmodel.type.scwf_assignee2Review.title=Validation Mr Gevenois
scwf_workflowmodel.type.scwf_assignee1Review.description=Validation par Mr
Gevenois
scwf_workflowmodel.type.scwf_revise.title=Révision
scwf_workflowmodel.type.scwf_revise.description=Révision du document



J’ai ensuite créé un fichier custom-workflow-context.xml.

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Deploiement du modele –>
   <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
         <list>
            <value>alfresco/workflowMathieu/testModel.xml</value>
         </list>   
      </property>
   </bean>
   
   <!– Deploiement du workflow test –>
   <!– Deploiement de la definition –>
   <bean id="extension.workflows.workflowBootstrap" parent="workflowDeployer">
      <property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflowMathieu/test_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">true</prop>
            </props>
         </list>
      </property>
   </bean>

   
   
   
   <!– deploiement du .prop –>
   <bean id="extension.workflowBootstrap" parent="workflowDeployer">
      <property name="labels">
         <list>
            <value>.alfresco.workflowMathieu.workflow-messages</value>
         </list>
      </property>
   </bean>
   
   </beans>

J’ai aussi modifié le fichier web-client-config-custom.xml

   
     <config evaluator="node-type" condition="scwf:assignee1Review"
     replace="true">
      <property-sheet>
        <separator name="sep1" display-label-id="general"
        componentgenerator="HeaderSeparatorGenerator" />
        <show-property name="bpm:description"
        componentgenerator="TextAreaGenerator" read-only="true" />
        <show-property name="bpm:comment"
        componentgenerator="TextAreaGenerator" />
      </property-sheet>
     </config>
 
 
  <!– Interface pour la tAche scwf:assignee2Review –>
     <config evaluator="node-type" condition="scwf:assignee2Review"
        replace="true">
         <property-sheet>
           <separator name="sep1" display-label-id="general"
           componentgenerator="HeaderSeparatorGenerator" />
           <show-property name="bpm:description"
           componentgenerator="TextAreaGenerator" read-only="true" />
           <show-property name="bpm:comment"
           componentgenerator="TextAreaGenerator" />
         </property-sheet>
        </config>

<!– Interface pour la tache scwf:revise –>
     <config evaluator="node-type" condition="scwf:revise"
     replace="true">
      <property-sheet>
        <separator name="sep1" display-label-id="general"
        componentgenerator="HeaderSeparatorGenerator" />
        <show-property name="bpm:description"
        componentgenerator="TextAreaGenerator" read-only="false" />
        <show-property name="bpm:comment"
        componentgenerator="TextAreaGenerator" />
      </property-sheet>
     </config>


lorsque je vais dans la console workflow à l'aide de  l'interface proposé par alfresco et que je tape la ligne deploy alfresco/workflowMathieu/test_processdefinition.xml

j'ai le message d'erreur suivant : org.alfresco.service.namespace.NamespaceException: Namespace prefix scwf is not mapped to a namespace URI

J'ai trouvé des message sur les forums mais aucun ne résous le problème.

Me suis je trompé dans la configuration de mes fichiers?

Ptitmat

Outcomes