AnsweredAssumed Answered

How to create simple workflow using jbpm

Question asked by snowstormuser on Oct 8, 2012
Latest reply on Feb 8, 2013 by tm
Hi,
I am new to Alfresco, I have created a process in jpdl having two task. When I add the "snowstorm-model-context.xml" to "tomcat\shared\classes\alfresco\extension\"  folder the server is not started properly and  it gives following error

SEVERE: Job Solr.CoreTracker-archive threw an unhandled Exception:
org.alfresco.error.AlfrescoRuntimeException: 09080001 GetModelsDiff return status is 404
   at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:1010)
   at org.alfresco.solr.tracker.CoreTracker.trackModels(CoreTracker.java:1630)
   at org.alfresco.solr.tracker.CoreTracker.trackRepository(CoreTracker.java:1134)
   at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:491)
   at org.alfresco.solr.tracker.CoreTrackerJob.execute(CoreTrackerJob.java:45)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)

processdefinition.xml

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

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



   <swimlane name="initiator"></swimlane>


   <start-state name="start">
      <task swimlane="initiator" name="sswf:startProcess"></task>
      <transition to="task1"></transition>
   </start-state>


   <task-node name="task1">
      <task name="sswf:task1" swimlane="initiator"></task>
      <transition to="task2"></transition>
   </task-node>

   <task-node name="task2">
      <task name="sswf:task2" swimlane="initiator"></task>
      <transition to="end"></transition>
   </task-node>


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


</process-definition>

snowstorm-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="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/snowstormWFModel.xml</value>
            </list>
        </property>
    </bean>

   <!– Registration of resource bundles –>
    <bean id="extension.workflowBootstrap"
          parent="workflowDeployer">
        <property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/extension/workflows/snowstorm2/processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">true</prop>
            </props>
         </list>
      </property>
        <property name="labels">
                <list>
                <value>alfresco.extension.snowstormWFModel</value>
            </list>
        </property>
    </bean>


   
</beans>


snowstormWFModel.properties


#
#   Credit Request workflow properties
#

sswf_Sample.workflow.title=Snowstorm Workflow Sample
sswf_Sample.workflow.description=Testing WorkFlow

sswf_snowstormWorkflow.type.sswf_startProcess.title=Start Process
sswf_snowstormWorkflow.type.sswf_startProcess.description=Start Process Description

sswf_snowstormWorkflow.type.sswf_task1.title=Task 1
sswf_snowstormWorkflow.type.sswf_task1.description=Task 1 description

sswf_snowstormWorkflow.type.sswf_task2.title=Task 2
sswf_snowstormWorkflow.type.sswf_task2.description=Task 2 description




snowstormWFModel.xml

<?xml version="1.0" encoding="UTF-8"?>
<!– definition of the workflow model for document validation process –>
<model name="sswf:snowstormWorkflow" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description> Snowstorm Workflow Model </description>
   <author>Shahid Iqbal</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/bpm/1.0" prefix="bpm" />
   </imports>

   <namespaces>
      <namespace uri="http://www.ensias.ma/model/cr/1.0" prefix="sswf" />
   </namespaces>

   <types>
      <!– Start Process task –>
      <type name="sswf:startProcess">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="sswf:firstName">
             <title>First Name</title>
               <type>d:text</type>
            </property>

            <property name="sswf:lastName">
            <title>Last Name</title>
               <type>d:text</type>
            </property>

            <property name="sswf:adress">
            <title>Address</title>
               <type>d:text</type>
            </property>

            <property name="sswf:creditAmount">
            <title>Credit Amount</title>
               <type>d:float</type>
            </property>

            <property name="sswf:requestNumber">
            <title>Request Number</title>
               <type>d:int</type>
            </property>
         </properties>

      </type>

      <!–  Task 2 model –>
      <type name="sswf:task1">
         <parent>sswf:startProcess</parent>
         <properties>
            <property name="sswf:comments">
            <title>Comments</title>
               <type>d:text</type>
            </property>
         </properties>

      </type>

      <!– <type name="sswf:reviseRequest">
         <parent>sswf:studyCreditRequest</parent>
      </type> –>

      <type name="sswf:task2">
         <parent>sswf:creditRequest</parent>
         <properties>
            <property name="sswf:Amount">
               <type>d:float</type>
            </property>
            <property name="sswf:creditRate">
               <type>d:float</type>
            </property>
            <property name="sswf:creditPeriode">
               <type>d:text</type>
            </property>
         </properties>

      </type>


      <!– <type name="sswf:studyOffer">
         <parent>sswf:prepareOffer</parent>
      </type>

      <type name="sswf:consultOffer">
         <parent>sswf:prepareOffer</parent>
      </type> –>

   </types>

</model>

If there is any mistake please let me know.
Thanks!

Outcomes