<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

   <!--                                 -->
   <!-- Workflow Definitions            -->
   <!--                                 -->

   <bean id="workflow.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
         <list>
            <value>alfresco/model/bpmModel.xml</value>
            <value>alfresco/model/workflowModel.xml</value>
         </list>
      </property>
      <property name="labels">
         <list>
            <value>alfresco/messages/bpm-messages</value>
            <value>alfresco/messages/workflow-messages</value>
         </list>
      </property>
   </bean>

   <bean id="workflowDeployer" class="org.alfresco.repo.workflow.WorkflowDeployer" abstract="true">
      <property name="transactionService" ref="transactionComponent"/>
      <property name="authenticationComponent" ref="authenticationComponent" />
      <property name="workflowService" ref="WorkflowService" />
   </bean>
   
   <!--                                 -->
   <!-- Workflow Service Implementation -->
   <!--                                 -->

   <bean id="workflowServiceImpl" class="org.alfresco.repo.workflow.WorkflowServiceImpl">
      <property name="BPMEngineRegistry" ref="bpm_engineRegistry"/>
      <property name="workflowPackageComponent" ref="workflowPackageImpl"/>
   </bean>

   <bean id="workflowPackageImpl" class="org.alfresco.repo.workflow.WorkflowPackageImpl">
      <property name="importerBootstrap" ref="spacesBootstrap"/>
      <property name="fileFolderService" ref="fileFolderService"/>
      <property name="searchService" ref="searchService"/>
      <property name="nodeService" ref="nodeService"/>
      <property name="namespaceService" ref="namespaceService"/>
   </bean>

   <!--                 -->
   <!-- Workflow Action -->
   <!--                 -->

   <bean id="start-workflow" class="org.alfresco.repo.workflow.StartWorkflowActionExecuter" parent="action-executer">
      <property name="namespaceService">
         <ref bean="NamespaceService" />
      </property>
      <property name="nodeService">
         <ref bean="NodeService" />
      </property>
      <property name="workflowService">
         <ref bean="WorkflowService" />
      </property>
   </bean>

   <!--                       -->
   <!-- Alfresco BPM Registry -->
   <!--                       -->

   <bean id="bpm_engineRegistry" class="org.alfresco.repo.workflow.BPMEngineRegistry">
   </bean>

   <bean id="bpm_engine" class="org.alfresco.repo.workflow.BPMEngine" abstract="true">
      <property name="BPMEngineRegistry" ref="bpm_engineRegistry"/>
   </bean>

   <!--                     -->
   <!-- jBPM Implementation -->
   <!--                     -->

   <bean id="jbpm_configuration" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
      <property name="sessionFactory" ref="sessionFactory"/>
      <property name="configuration" value="classpath:org/alfresco/repo/workflow/jbpm/jbpm.cfg.xml"/>
   </bean>

   <bean id="jbpm_template" class="org.springmodules.workflow.jbpm31.JbpmTemplate">
      <constructor-arg index="0" ref="jbpm_configuration"/>
   </bean>

   <bean id="jbpm_engine" class="org.alfresco.repo.workflow.jbpm.JBPMEngine" parent="bpm_engine">
      <property name="engineId" value="jbpm"/>
      <property name="JBPMTemplate" ref="jbpm_template"/>
      <property name="dictionaryService" ref="DictionaryService"/>
      <property name="namespaceService" ref="NamespaceService"/>
      <property name="nodeService" ref="nodeService"/>
      <property name="personService" ref="personService"/>
      <property name="serviceRegistry" ref="ServiceRegistry"/>
   </bean>

</beans>
