4 Replies Latest reply on Jul 13, 2011 10:30 PM by RuiHua Tang

    jBPM 5.1 with Spring mvc

    Sameer Kumar Newbie



      I downloaded jBPM5.1 full installer and could successfully execute the sample web-console example provided.


      I need to understand how jBPM5.1 works with Spring MVC.

      Request people to kindly share one working simple workflow step by step.


      Could not find any demo spring integration example in web.




        • 1. Re: jBPM 5.1 with Spring mvc
          Sameer Kumar Newbie

          It will be really great if jBPM Team could provide a sample Spring mvc integrated example. This is really missing here.

          • 2. Re: jBPM 5.1 with Spring mvc
            bpmn2user Expert

            jBPM is agnostic to any UI framework you want to use, i.e, it does not matter if you use Spring MVC, Struts, JSF, Swing, GWT etc. You can use jBPM API from any framework you like.


            Here are some examples to see how the jBPM API is used. You can  have the API calls from your Spring MVC framework.



            • 3. Re: jBPM 5.1 with Spring mvc
              RuiHua Tang Newbie

              I found that using the spring to manage the transaction for jbpm5 ,what seems to be incorrect.


              here is my code:


              <persistence-unit name="org.jbpm.persistence.jpa"
              code :
              EntityManagerFactory emf = (EntityManagerFactory) Constants.ctx.getBean("entityManagerFactory");
              Environment env = KnowledgeBaseFactory.newEnvironment();
                             env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
                             env.set(EnvironmentName.TRANSACTION_MANAGER, Constants.ctx.getBean("txManager"));
              StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
              <context:annotation-config />
              <bean id="dataSource"
              <property name="driverClassName" value="oracle.jdbc.OracleDriver" />
              <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl" />
              <property name="username" value="jbpm" />
              <property name="password" value="jbpm" />
              <bean id="entityManagerFactory"
              <property name="persistenceUnitName" value="org.jbpm.persistence.jpa"></property>
              <property name="dataSource" ref="dataSource"></property>
              <property name="jpaVendorAdapter">
              <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
              <property name="database" value="ORACLE" />
              <property name="showSql" value="true" />
              <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
              <property name="entityManagerFactory" ref="entityManagerFactory" />
              <tx:annotation-driven transaction-manager="txManager" />


              The result is i can't start the second task.


              You can use the following link to view details:



              • 4. Re: jBPM 5.1 with Spring mvc
                RuiHua Tang Newbie

                Does anyone can solve the problem?