cancel
Showing results for 
Search instead for 
Did you mean: 

new workflow definition not getting display in the list wf

amitnerkar
Champ in-the-making
Champ in-the-making
Hi,

I have to create a new workflow process definition. I created the following files:

-alfresco/model/DocuModel.xml
-alfresco/workflow/TaskModel.xml
-alfresco/workflow/ProcessDefinition.xml
-alfresco/extension/docuModel-context.xml
-alfresco/web-client-config.xml

I have configured the xmls. But when i store a document in the repository and start a workflow the initial list of workflows is displayed. This list doesn't contain the new process definition.

The document model alfresco/model/DocuModel.xml is working alright. The process definition is not.

-alfresco/workflow/TaskModel.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>
     
  <types>


     <type name="wf:submitAdhocTask">
        <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:adhocTask">
        <parent>bpm:workflowTask</parent>
      <properties>
      <property name="wf:adhocname">
              <type>d:text</type>
              <default>false</default>
        </property>
      </properties>
     </type>

     <type name="wf:completedAdhocTask">
        <parent>bpm:workflowTask</parent>
      <properties>
      <property name="wf:completedadhocname">
              <type>d:text</type>
              <default>false</default>
        </property>
      </properties>
     </type>
     
  </types>
  
</model>




-alfresco/workflow/ProcessDefinition.xml


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

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

   <swimlane name="initiator"/>

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

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


-alfresco/extension/docuModel-context.xml


<?xml version="1.0" encoding="UTF-8"?>
<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              
       xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 ../../../../webapps/alfresco/WEB-INF/classes/alfresco/model/modelSchema.xsd"    
       xmlns="http://www.alfresco.org/model/dictionary/1.0" name="lts:model">

  <author>LTS</author>
  <version>1.0</version>
  <imports>
     <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
     <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
  </imports>
  <namespaces>
     <namespace uri="model" prefix="lts"/>
  </namespaces> 
  <types>  
     <type name="lts:meta">
        <title>Leo TechnoSoft</title>
        <parent>cm:content</parent>
        <archive>true</archive>
         <properties>
           <property name="lts:documentname">
              <title>Prj</title>
              <type>d:text</type>
              <mandatory>true</mandatory>
           </property>
          </properties>
     </type>
   </types>
</model>



-alfresco/extension/docuModel-context.xml


<?xml version="1.0" encoding="UTF-8"?>
<!– Source: config/alfresco/extension/mycompany-model-context.xml –>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN'
    'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
  <bean id="lts.context" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
    <property name="models">
      <list>
        <value>alfresco/model/LTSDocuModel.xml</value>
      <value>alfresco/workflow/ltsTaskModel.xml</value>
      </list>
    </property>
  </bean>

<bean id="lts.process" parent="workflowDeployer">
   <property name="workflowDefinitions">
      <list>
         <props>
            <prop key="engineId">jbpm</prop>
            <prop key="location">alfresco/workflow/ltsProcessDefinition.xml</prop>
            <prop key="mimetype">text/xml</prop>
         </props>
      </list>
   </property>
</bean>

</beans>



-alfresco/web-client-config.xml



<config evaluator="node-type" condition="wf:submitAdhocTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="wf:notifyMe" />
      </property-sheet>
   </config>

  <config evaluator="node-type" condition="wf:adhocTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="wf:adhocname" />
      </property-sheet>
   </config>
<config evaluator="node-type" condition="wf:completedAdhocTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="wf:completedadhocname" />
      </property-sheet>
   </config>



Is there something not properly configured in the xmls.

Thanks & Regards,
Amit
4 REPLIES 4

pjankowski
Champ in-the-making
Champ in-the-making
I know this question is quite old but maybe someone else is also looking for an answer to similar problem.

Have you ever deployed your process on a workflow engine?

According to your configuration the process is not deployed automatically. To do this, add this line:
<prop key="redeploy">true</prop>

to your lts.process bean:
<bean id="lts.process" parent="workflowDeployer">
   <property name="workflowDefinitions">
      <list>
         <props>
            <prop key="engineId">jbpm</prop>
            <prop key="location">alfresco/workflow/ltsProcessDefinition.xml</prop>
            <prop key="mimetype">text/xml</prop>
            <prop key="redeploy">true</prop>
         </props>
      </list>
   </property>
</bean>


But keep in mind that with this option set to true your process definition will be deployed each time the server starts.

Another solution is to deploy the process definition manually.
1. Visit:
http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp
(where localhost:8080 is your Alfresco URL)

2. If you get 403 error go to:
http://localhost:8080/alfresco/faces/jsp/dashboards/container.jsp
login as admin
go back to
http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp

3. Deploy your process definition by typing:
deploy activiti alfresco/module/<your_module_name>/<path_to_your_process_definition>/<process_definition>.bpmn

in your case
deploy activiti alfresco/module/<your_module_name>/workflow/ProcessDefinition.xml


4. Check if the process was successfully deployed by typing:
show definitions all


5. Try to start a new workflow as you did already. The new process should appear.


Another reason why a process does not appear in the process list is that it can be hidden but I don't suppose that's your case. If you interested in hiding workflows, see https://forums.alfresco.com/forum/developer-discussions/workflow/how-hide-custom-workflow-share-work...

aitbenmouh
Champ in-the-making
Champ in-the-making
Add this to your global configuration file :
system.workflow.engine.jbpm.enabled=true
system.workflow.engine.activiti.enabled=false
system.workflow.engine.jbpm.definitions.visible=true
system.workflow.engine.activiti.definitions.visible=false


You can choose wich process engine you are using JBPM/Activity .

deehansdee
Champ in-the-making
Champ in-the-making
Hello, I am new to alfresco custom workflows and I will like to try your workflow sample but realised you have no file for share-workflow-form-config.xml. Also, if u can differentiate which of your files is DocuModel.xml and docuModel-context.xml since you have two of the same file names with different content. Please help with the locations of each file. I also got an error of files LTSDocuModel.xml, ltsTaskModel.xml and ltsProcessDefinition.xml not found and will appreciate your help on that as well. Thank you.

Hi,

Judging from the way you're asking your question, you have a lot of read up to do. But here is an explanation of some of those files:
1. ltsTaskModel.xml this file defines task types that will be used by the process.
2. ltsProcessDefinition.xml is the BPM definition of how you want the process to flow.
3. LTSDocuModel.xml would probably be defining the metadata fields used by the documents that will be attached to the workflow.
4. share-config.xml is used to specify how you want your forms to be presented. This is to structure the properties of the task types you defined in the Task Model file.
5. docuModel-context.xml anything with a "-context.xml" suffix in Alfresco is a bean definition to register models, class etc.

Now with that being said please read up on the wiki about custom workflows. And also follow this link: http://jmuras.com/blog/2012/creation-of-workflow-in-alfresco-using-activiti-step-by-step/