Deploy task model

cancel
Showing results for 
Search instead for 
Did you mean: 
jonlord
Member II

Deploy task model

Salve,
sono alle prime armi con Alfresco e sto cercando di capire come creare un advanced workflow: sono riuscito a installare il plugin di eclipse per poter definire il processo con jBPM Process Designer, ho inserito le informazioni per il deploy e tutto sembra funzionare in quanto nell'explorer mi appare il workflow che ho creato.

Volendo però ricreare uno dei tanti esempi mi sono accorto che è necessario fare il deploy anche del task model e questa operazione va fatta esclusivamente a mano. A questo punto leggendo le guide e usando come esempi questi due post

http://forums.alfresco.com/en/viewtopic.php?f=34&t=3573
http://forums.alfresco.com/en/viewtopic.php?f=34&t=5676

ho creato i seguenti file:

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

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


   <swimlane name="redattore" />
   <swimlane name="verificatore" />


   <start-state name="start-state1">
      <task name="wf:mySubmitReviewTask" swimlane="redattore" />
      <transition to="verifica"></transition>
   </start-state>


   <task-node name="verifica">
      <task name="myReviewTask" swimlane="verificatore"></task>
      <transition to="approvato"></transition>
      <transition to="respinto" name="to node2"></transition>
   </task-node>

   <node name="approvato">
      <transition to="distribuzione"></transition>
   </node>

   <node name="respinto">
      <transition to="distribuzione"></transition>
   </node>

   <task-node name="distribuzione">
      <task name="wf:myCompleteReviewTask" swimlane="redattore"></task>
      <transition to="end-state1"></transition>
   </task-node>


   <end-state name="end-state1"></end-state>


</process-definition>

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

<model name="wf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Esempio di Task Model</description>
   <author>Mi</author>
   <versione>1.0</versione>
   
   <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>


   <types>
   
      <type name="wf:mySubmitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>
      
      <type name="myReviewTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>
      
      <type name=wf:myCompleteReviewTask>
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>
      
   </types>
   
</model>

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>

    <bean id="myworkflows.workflowBootstrap" parent="workflowDeployer">
      <property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/extension/correggieapprova_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">true</prop>
            </props>
         </list>
      </property>
      <property name="models">
         <list>
            <!– NOTE: The above process definition relies on the default workflowModel.xml –>
            <!–       which is already registered during Alfresco startup. –>
            <!–       See bootstrap-context.xml (workflowBootstrap). –>
                     <value>alfresco/extension/correggieapprovaModel.xml</value>
         </list>
      </property>
      <property name="labels">
         <list>
            <!– NOTE: The above process definition relies on the default workflow-messages.properties –>
            <!–       which is already registered during Alfresco startup –>
            <!–       See bootstrap-context.xml (workflowBootstrap). –>

            <!– <value>alfresco/workflow/workflow-messages</value> –>
         </list>
      </property>
   </bean>

</beans>

e li messi tutti nella cartella C:\Alfresco\tomcat\shared\classes\alfresco\extension.

Il guaio è che non appena faccio partire il server Tomcat e provo ad accedere all'explorer di Alfresco (ma anche alla console di deploy come pure ad Alfresco Share) ottengo sempre lo stesso errore:

HTTP Status 404 -

type Status report

message

description The requested resource () is not available.
Apache Tomcat/6.0.26

Se tolgo il file workflow-context.xml dalla cartella …\alfresco\extension tutto ritorna come prima e riesco a lanciare la Workflow console, ma ottengo:

deploy alfresco/extension/correggieapprova_processdefinition.xml
[WARNING] swimlane 'redattore' does not have an assignment
[WARNING] swimlane 'verificatore' does not have an assignment
[WARNING] swimlane 'verificatore' does not have an assignment
deployed definition id: jbpm$18 , name: jbpm$wf:correggieapprova , title: wf:correggieapprova , version: 2
definition: jbpm$18 , name: wf:correggieapprova , version: 2
workflow: None
path: None

deploy alfresco/extension/correggieapprovaModel.xml
org.alfresco.service.cmr.workflow.WorkflowException: 06230001 Failed to deploy workflow definition.

Qualcuno può aiutarmi?
Grazie in anticipo.
2 Replies
mturatti
Member II

Re: Deploy task model

La documentazione dei workflow parte da qui:
http://wiki.alfresco.com/wiki/Workflow

Cosa c'è nel file alfresco.log, solo dei WARNING?
jonlord
Member II

Re: Deploy task model

Ho risolto!
Effettivamente c'erano un paio di errori di sintassi nell'xml del content model e non andando a visualizzare il log alfresco.log non riuscivo ad accorgermene.

Grazie per l'aiuto.