AnsweredAssumed Answered

Failed to find association definition for bpm:assignee

Question asked by abdallah87 on May 14, 2010
Latest reply on May 14, 2010 by abdallah87
Salut;

jai essayé de reprendre le meme exemple du worflow adhoc pour comprendre le principe de fonctionnement;
En fait j ai  dupliqué le workflow adhoc pour que j arrive le personnaliser par la suite .

le probleme c est que lors ce que j ai déployé le workflow dupliqué les 2 autres workflow adhoc et rewiew&approve ne marchent pas parfaitement :on trouve plus la composante "bpm:assignee" alors que pour le nouveau workflow  marche parfaitement!!!!!!!!!
je me demande ça serait quoi le probleme

Voila les fichiers du workflow:
envoyerTache_processdefinition.xml:
<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:envoiTache">

   <swimlane name="initiator"/>

   <start-state name="start">
      <task name="wf:envoyerTache" swimlane="initiator"/>
      <transition name="" to="assignement"/>
   </start-state>

   <swimlane name="assignee">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{bpm_assignee}</actor>
      </assignment>
   </swimlane>
  
   <task-node name="assignement">
      <task name="wf:tacheAssignee" swimlane="assignee">
         <event type="task-create">
            <script>
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
      </task>
      <transition name="" to="completed">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
              if (wf_notifyMe)
              {
                 var mail = actions.create("mail");
                 mail.parameters.to = initiator.properties.email;
                 mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
                 mail.parameters.from = bpm_assignee.properties.email;
                 mail.parameters.text = "It's done";
                 mail.execute(bpm_package);
              }
           </script>
         </action>
      </transition>
   </task-node>
  
   <task-node name="completed">
      <task name="wf:tacheComplete" swimlane="initiator"/>
      <transition name="" to="end"/>
   </task-node>
     
   <end-state name="end"/>
  
</process-definition>





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

<model name="wf: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="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
  </namespaces>
     
<!–                               –>
      <!–  Envoyer taches Tasks –>              
      <!–                               –>
     <types>
     
      <type name="wf:envoyerTache">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:notifyMe">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:tacheAssignee">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:tacheComplete">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

   </types>
  
</model>




envoyerTache-model-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>

   <bean id="myworkflows.workflowBootstrap" parent="workflowDeployer">
   <property name="workflowDefinitions">
      <list>
         <props>
            <prop key="engineId">jbpm</prop>
            <prop key="location">alfresco/extension/envoyerTache_processdefinition.xml</prop>
            <prop key="mimetype">text/xml</prop>
         <prop key="redeploy">true</prop>
         </props>
      </list>
   </property>
   <property name="models">
    <list>
      <!– Task Model associated with above process definition –>
      <value>alfresco/extension/envoyerTacheModel.xml</value>
    </list>
  </property>
  <property name="labels">
    <list>
     
      <value>alfresco/extension/envoyerTache-messages</value>
    </list>
  </property>


</bean>

   
</beans>


web-client-config-custom.xml:
<alfresco-config>

<!– Envoyer tache______________________________________________________________________ workflow tasks –>
  
  
    <config evaluator="node-type" condition="wf:envoyerTache" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="wf_adhoc_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="wf_adhoc_due_date" />
         <show-property name="wf:notifyMe" />
         <separator name="sep2" display-label-id="user_filter_user" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="wf_adhoc_assign_to" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="wf:tacheAssignee" replace="true">
      <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" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="wf:tacheComplete" replace="true">
      <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" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="wf_envoyerTache_assignee" read-only="true" />
      </property-sheet>
   </config>

   
</alfresco-config>

envoyerTache-messages.properties

#
# envoyer tache________________________________________________ Task Workflow
#

envoiTache.workflow.title=Envoyer une Tache
envoiTache.workflow.description=Envoyer une tâche avec notification par émail

# envoyer tacheTask Definitions

wf_workflowmodel.type.wf_envoyerTache.title=Start Adhoc Task
wf_workflowmodel.type.wf_envoyerTache.description=Allocate task to colleague
wf_workflowmodel.property.wf_notifyMe.title=Notify Me
wf_workflowmodel.property.wf_notifyMe.description=Notify me when task is complete
wf_workflowmodel.type.wf_tacheAssignee.title=Adhoc Task
wf_workflowmodel.type.wf_tacheAssignee.description=Adhoc Task allocated by colleague
wf_workflowmodel.type.wf_tacheComplete.title=Adhoc Task Completed
wf_workflowmodel.type.wf_tacheComplete.description=Adhoc Task Completed

Outcomes