1 Reply Latest reply on Apr 4, 2011 7:21 AM by Kris Verlaenen

    Parallel process instances

    Pavel Sknar Newbie

      I have spring config (JBPM 5.0 release):

       

      <context:annotation-config/>

       

          <bean id="processBuilderFactoryService" class="org.jbpm.process.builder.ProcessBuilderFactoryServiceImpl"/>

       

          <bean id="processMarshallerFactoryService" class="org.flexpay.common.process.marshaller.ProcessMarshallerFactoryServiceImpl"/>

       

          <bean id="processRuntimeFactoryService" class="org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl"/>

       

          <bean id="bpmn2ProcessProvider" class="org.jbpm.bpmn2.BPMN2ProcessProviderImpl"/>

       

          <bean name="initProcessBuilderFactory" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" >

              <property name="staticMethod" value="org.drools.compiler.ProcessBuilderFactory.setProcessBuilderFactoryService"/>

              <property name="arguments">

                  <list>

                      <ref bean="processBuilderFactoryService"/>

                  </list>

             </property>

          </bean>

       

          <bean name="initProcessMarshallerFactory" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" >

              <property name="staticMethod" value="org.drools.marshalling.impl.ProcessMarshallerFactory.setProcessMarshallerFactoryService"/>

              <property name="arguments">

                  <list>

                      <ref bean="processMarshallerFactoryService"/>

                  </list>

             </property>

          </bean>

       

          <bean name="initProcessRuntimeFactory" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" >

              <property name="staticMethod" value="org.drools.runtime.process.ProcessRuntimeFactory.setProcessRuntimeFactoryService"/>

              <property name="arguments">

                  <list>

                      <ref bean="processRuntimeFactoryService"/>

                  </list>

             </property>

          </bean>

       

          <bean name="initBPMN2ProcessFactory" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" >

              <property name="staticMethod" value="org.drools.compiler.BPMN2ProcessFactory.setBPMN2ProcessProvider"/>

              <property name="arguments">

                  <list>

                      <ref bean="bpmn2ProcessProvider"/>

                  </list>

             </property>

          </bean>

       

          <drools:kstore id="knowledgeStore" />

       

      <drools:kbase id="knowledgeBase">

              <drools:resources>

               </drools:resources>

              <drools:configuration>

              </drools:configuration>

          </drools:kbase>

       

      <drools:ksession id="jpaSingleSessionCommandService" type="stateful" kbase="knowledgeBase">

              <drools:configuration>

                  <drools:jpa-persistence load="1">

                      <drools:transaction-manager ref="transactionManager" />

                      <drools:entity-manager-factory ref="entityManagerFactory" />

                  </drools:jpa-persistence>

              </drools:configuration>

          </drools:ksession>

       

      I start some process instance in this StatefulKnowledgeSession session. Main thread is bloked in startProcess() while process instance not finish. When I try start process instance in child thread, but I can not get process from knowledge base: getKnowledgeBase().getProcess(processId). Main thread is blocked. What`s this? I wait more from jbpm 5. Where is parallel processes?