cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to deploy my workflow

zomurn
Champ in-the-making
Champ in-the-making
Hello,

I don't manage to deploy my jpbm workflow under Alfresco CE 4.0c.
Here my steps :

Process definition at  D:\alfresco-community-40c-sbc\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\workflow\mon-workflow.xml


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

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

   <swimlane name="initiator"/>

   <start-state name="start">
      <task name="awf:submitAdhocTask" swimlane="initiator"/>
      <transition name="" to="adhoc"/>
   </start-state>

   <swimlane name="assignee"/>
  
   <task-node name="adhoc">
      <task name="awf:adhocTask" swimlane="assignee"/>
      <transition name="" to="completed"/>
   </task-node>
  
   <task-node name="completed">
      <task name="awf:completedAdhocTask" swimlane="initiator"/>
      <transition name="" to="end"/>
   </task-node>
     
   <end-state name="end"/>
  
</process-definition>

Workflow Model definition at  D:\alfresco-community-40c-sbc\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\fr_intuitiv_module_sbc_amp\model\mon-workflow-model.xml

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

<model name="awf: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="awf"/>
  </namespaces>
     
  <types>


     <type name="awf:submitAdhocTask">
        <parent>bpm:startTask</parent>
        
        <properties>
           <property name="awf:notifyMe">
              <type>d:boolean</type>
              <default>false</default>
           </property>
        </properties>

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

     <type name="awf:adhocTask">
        <parent>bpm:workflowTask</parent>
     </type>

     <type name="awf:completedAdhocTask">
        <parent>bpm:workflowTask</parent>
     </type>
     
  </types>
  
</model>

Workflow Resource Bundle messages at  D:\alfresco-community-40c-sbc\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\fr_intuitiv_module_sbc_amp\model\mon-workflow-model.properties

#
# Adhoc Task Workflow
#

awf_adhoc.workflow.title=Mon Workflow
awf_adhoc.workflow.description=Ex. avec Mon workflow

# Adhoc Task Definitions

awf_workflowmodel.type.awf_submitAdhocTask.title=Soumettre mon workflow
awf_workflowmodel.type.awf_submitAdhocTask.description=Allocate task to colleague
awf_workflowmodel.property.awf_adhocDescription.title=Task Description
awf_workflowmodel.property.awf_adhocDescription.description=Description of what needs to be achieved
awf_workflowmodel.property.awf_adhocDueDate.description=Task Due Date
awf_workflowmodel.property.awf_adhocPriority.title=Task Priority
awf_workflowmodel.property.awf_notifyMe.title=Notify Me
awf_workflowmodel.property.awf_notifyMe.description=Notify me when task is complete
awf_workflowmodel.association.awf_assignee.title=Assignee
awf_workflowmodel.association.awf_assignee.description=Who's doing the task
awf_workflowmodel.type.awf_adhocTask.title=Adhoc Task
awf_workflowmodel.type.awf_adhocTask.description=Adhoc Task allocated by colleague
awf_workflowmodel.type.awf_completedAdhocTask.title=Adhoc Task Completed
awf_workflowmodel.type.awf_completedAdhocTask.description=Adhoc Task Completed

Spring configuration file for auto deployment of my workflow at D:\alfresco-community-40c-sbc\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\fr_intuitiv_module_sbc_amp\context\bootstrap-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>

   

   <!– Workflows –>
   <bean id="sbc.workflowBootstrap" parent="workflowDeployer">
      <property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflow/mon-workflow.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">true</prop>
            </props>
         </list>
      </property>
      <property name="models">
         <list>
            <value>alfresco/module/fr_intuitiv_module_sbc_amp/model/mon-workflow-model.xml</value>
         </list>
      </property>
      <property name="labels">
         <list>
            <value>alfresco/module/fr_intuitiv_module_sbc_amp/model/mon-workflow-model</value>
         </list>
      </property>
      <property name="repositoryWorkflowDefsLocations" ref="customWorkflowDefsRepositoryLocation" />
   </bean>


</beans>

When I type in workflow admin console :

list my file :
show file alfresco/workflow/mon-workflow.xml
(ok)
deploy my file :
deploy alfresco/workflow/mon-workflow.xml
(I've got syntax error)
list available workflows :
show definitions all
Only 11 items are listed, the out of box workflows only (activiti one).

Why the deployment failed ? What is wrong ?
3 REPLIES 3

zomurn
Champ in-the-making
Champ in-the-making
I manged to go forward.

The error was to type:

deploy jpbm alfresco/workflow/mon-workflow.xml

instead of

deploy alfresco/workflow/mon-workflow.xml

and don't forget to put in alfresco-global.properties

### BPM Engine ###
system.workflow.engine.jbpm.enabled=true

And I changed all path to my custom workflow model to shared/classes/alfresco/extension/workflows/
So now, everything concerning my custom workflow (all files) are in this folder.
I updated my boostrap-context.xml file consequently to :

<!– Workflows –>
   <bean id="sbc.workflowBootstrap" parent="workflowDeployer">
      <property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/extension/workflows/sbc_gestion_incident.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">true</prop>
            </props>
         </list>
      </property>
      <property name="models">
         <list>
            <value>alfresco/extension/workflows/sbc-workflow-model.xml</value>
         </list>
      </property>
      <property name="labels">
         <list>
            <value>alfresco/extension/workflows/sbc-workflow-model</value>
         </list>
      </property>
      <property name="repositoryWorkflowDefsLocations" ref="customWorkflowDefsRepositoryLocation" />
   </bean>


But now, process definition is badly parsed by jBpm engine :

Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] cvc-complex-type.2.4.a: Invalid content was found starting with element 'namespaces'. One of '{"urn:jbpm.org:jpdl-3.1":swimlane, "urn:jbpm.org:jpdl-3.1":start-state, "urn:jbpm.org:jpdl-3.1":node, "urn:jbpm.org:jpdl-3.1":state, "urn:jbpm.org:jpdl-3.1":task-node, "urn:jbpm.org:jpdl-3.1":super-state, "urn:jbpm.org:jpdl-3.1":process-state, "urn:jbpm.org:jpdl-3.1":fork, "urn:jbpm.org:jpdl-3.1":join, "urn:jbpm.org:jpdl-3.1":decision, "urn:jbpm.org:jpdl-3.1":end-state, "urn:jbpm.org:jpdl-3.1":action, "urn:jbpm.org:jpdl-3.1":script, "urn:jbpm.org:jpdl-3.1":create-timer, "urn:jbpm.org:jpdl-3.1":cancel-timer, "urn:jbpm.org:jpdl-3.1":event, "urn:jbpm.org:jpdl-3.1":exception-handler, "urn:jbpm.org:jpdl-3.1":task}' is expected. line 7]
   at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:173)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:2334)
   … 62 more

zomurn
Champ in-the-making
Champ in-the-making
The solution which the process definition is well boostraped :

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

<process-definition name="swf:wf_gestion_incident"
   xmlns="urn:jbpm.org:jpdl-3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="urn:jbpm.org:jpdl-3.1 jpdl-3.1.xsd">

   <!– Déclaration des acteurs –>

   <swimlane name="groupe_directeur_projet">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm.groupAssignee}</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="groupe_chef_projet">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm.groupAssignee}</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="groupe_developpeur">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm.groupAssignee}</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="groupe_testeur">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm.groupAssignee}</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="groupe_utilisateur_final">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm.groupAssignee)}</pooledactors>
      </assignment>
   </swimlane>


   <!– Déclaration de l'état de départ –>

   <start-state name="debut_incident">
      <task name="wf:tk_soumettre_incident" swimlane="groupe_directeur_projet" />
      <transition name="tr_soumission_incident" to="tkn_affecter_incident" />
   </start-state>

   <!– Tâche affecter pour les chefs de projet –>

   <task-node name="tkn_affecter_incident">
      <task name="wf:tk_affecter_incident" swimlane="groupe_chef_projet">
         <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="tr_affecter_incident" to="tkn_corriger_incident" />
   </task-node>
   
   <!– Tâche corriger pour les developpeur –>

   <task-node name="tkn_corriger_incident">
      <task name="wf:tk_corriger_incident" swimlane="groupe_developpeur">
         <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="tr_corriger_incident" to="tkn_tester_incident" />
   </task-node>
   
   <!– Tâche tester pour les testeur –>

   <task-node name="tkn_tester_incident">
      <task name="wf:tk_tester_incident" swimlane="groupe_testeur">
         <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="tr_tester_incident" to="fin_incident" />
   </task-node>

   <!– <decision name="review_decision"> –>
   <!– <transition to="rework"> –>
   <!– <condition>#{!reviewer1.approved || !reviewer2.approved || –>
   <!– !reviewer3.approved}</condition> –>
   <!– </transition> –>
   <!– <transition name="tr_end" to="end" /> –>
   <!– </decision> –>
<!—->
   <!– <task-node name="rework"> –>
   <!– <task name="wf:reworkTask"> –>
   <!– <assignment actor-id="#{initiator.properties['cm:userName']}" /> –>
   <!– </task> –>
   <!– <transition to="review_fork" /> –>
   <!– </task-node> –>

   <end-state name="fin_incident" />

</process-definition>

paiyyavj13
Star Contributor
Star Contributor
wats the version of Alfresco u deploying this workflow on?… were u able to deploy it or still facing issues in doing so?