Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: jbpm getting started

  1. #1
    Join Date
    Dec 2004
    Location
    Vancouver, BC
    Posts
    80

    Default jbpm getting started

    I have been able to download and build the jbpm 31 integration.

    I have looked but cannot find any examples of setting up an engine which I can use withing my application. Does anyone have a 'Hello World' example which includes the applicationContext.xml ?

    Thanks,
    Craig

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    There isn't any sample for jbpm at the moment. I'll try to make one or migrate an existing one from plain jbpm to spring jbpm support. You can take a look at the tests which contain application context definitions. Can you also please, raise an issue on jira under spring modules? thanks.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Dec 2004
    Location
    Vancouver, BC
    Posts
    80

    Default

    thanks for the hints Costin.

    i raised the jira issue as asked.

    I have looked at the tests, but cannot figure out how to set up the factorybean.

    I would like to pass in a mysql connection for the hibernate. I know how to set up transaction managers, and a mysql connection...but, how would I configure it to use a specific database, with the default hbm files?

    Here is what I have in my application context...it fails in the afterPropertiesSet...I am not sure which of the two configuration methods to use (JbpmConfiguration, or ObjectFactory)

    any help would be much appreciated.

    craig


    <bean id="jbpmSessionFactoryBean" class="org.springmodules.workflow.jbpm31.LocalJbpm ConfigurationFactoryBean">
    <!-- <property name="hibernateSessionFactory" ref="mySessionFactory"/> -->
    </bean>

    <bean id="processDefinition" class="org.springmodules.workflow.jbpm31.definitio n.ProcessDefinitionFactoryBean">
    <property name="jbpmSessionFactory" ref="jbpmSessionFactoryBean"/>
    <property name="definitionLocation" value="classpath:/demo-process.xml"/>
    </bean>

    <bean id="jbpmDataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName">
    <value>com.mysql.jdbc.Driver</value>
    </property>
    <property name="url">
    <value>jdbc:mysql://localhost/jbpm</value>
    </property>
    <property name="username">
    <value>${jdbc.user}</value>
    </property>
    <property name="password">
    <value>${jdbc.password}</value>
    </property>
    </bean>

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    What's the message? Have you looked at the generated javadocs?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Dec 2004
    Location
    Vancouver, BC
    Posts
    80

    Default

    Yup, I have read it all.

    I also tried this:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation=
    "http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://localhost/jbpm"/>
    <property name="username" value="aaaaa"/>
    <property name="password" value="xxxxxx"/>
    </bean>

    <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource">
    <ref bean="dataSource"/>
    </property>
    <property name="mappingLocations">
    <value>classpath*:/org/jbpm/**/*.hbm.xml</value>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.MySQ LDialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    </props>
    </property>
    <property name="schemaUpdate" value="true"/>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory" ref="hibernateSessionFactory"/>
    </bean>

    <bean id="hibernateConfiguration" factory-bean="hibernateSessionFactory" factory-method="getConfiguration"/>

    <bean id="jbpmSessionFactory" class="org.springmodules.workflow.jbpm31.LocalJbpm ConfigurationFactoryBean">
    <property name="hibernateSessionFactory" ref="hibernateSessionFactory"/>
    <property name="hibernateConfiguration" ref="hibernateConfiguration"/>
    </bean>

    <bean id="jbpmTemplate" class="org.springmodules.workflow.jbpm31.JbpmTempl ate">
    <property name="jbpmSessionFactory" ref="jbpmSessionFactory"/>
    </bean>

    </beans>


    I get this error:
    ERROR web.context.ContextLoader - Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'hibernateConfiguration' defined in ServletContext resource [/WEB-INF/classes/jpbmContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: No factory method: factory bean=hibernateSessionFactory; factory method=getConfiguration
    org.springframework.beans.factory.BeanDefinitionSt oreException: No factory method: factory bean=hibernateSessionFactory; factory method=getConfiguration
    at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:271)

  6. #6
    Join Date
    Dec 2004
    Location
    Vancouver, BC
    Posts
    80

    Default

    getting further...i had missed the &. However, if I call getConfiguration on the hibernate session factory the return type is Configuration....the LocalJbpmConfigurationFactoryBean has a method setConfiguration, but is expecting resource.

    I don't see what I should be setting, setObjectFactory, or setConfiguration.

  7. #7
    Join Date
    Dec 2004
    Location
    Vancouver, BC
    Posts
    80

    Default

    Ok, now I am getting there. I hadn't seen the applicationContext which was in the testing folder, i had looked in the source package.

    That has all the information I need to set it up properly.

  8. #8
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I hadn't seen the applicationContext which was in the testing folder
    That's what I meant by tests. jbpm 3.1 support is different from jbpm 3.0 since jbpm itself has been modified quite a lot. Even though there are some similarities the classes and underlying architecture has changed - one aspect would be that you don't need to pass in a Hibernate configuration.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  9. #9
    Join Date
    Nov 2005
    Location
    London, UK
    Posts
    68

    Default

    Quote Originally Posted by craig
    Ok, now I am getting there. I hadn't seen the applicationContext which was in the testing folder, i had looked in the source package.

    That has all the information I need to set it up properly.
    where is the testing folder your refering to here?

  10. #10
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    inside the springmodules 0.3 distribution and the latest version on the spring modules cvs.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •