[jboss-user] [JBoss jBPM] - Re: jBPM : Couldn't be that complicated... Getting there

viniciuscarvalho do-not-reply at jboss.com
Mon Mar 26 09:41:39 EDT 2007


Alright! Almost there: So far those have been the steps taken:

I'm using jbpm-jpdl-3.2.GA ok, on jboss 4.0.5:

1st: Create a db named jbpmdb on you mysql (please google it for instruction , I'll post a full explanation as soon as I finish this)
2nd: Download the jbpm-starters-kit 3.1.3 
3rd: Use the scripts under starters-kit/jbpm-db/build/mysql/scripts/mysql.create.sql, for that log on the myslq 'mysql -u root -p'
>use jbpmdb;
>source mysql.create.sql
(Remember that you must be on the scripts directory when you started the mysql in order to use the exact sentence above)

4th: Fill in some tables...
You need to create a user: JBPM_ID_USER (fill in as you need, just use 'U' for the class [do not ask me why, I dunno know yet ;P])
Now setup three groups for the user:

  | insert into JBPM_ID_GROUP (ID_, 
  | CLASS_, 
  | NAME_, 
  | TYPE_, 
  | PARENT_) values (1, 'G', 'manager', 'security-role', null), (2, 'G', 'participant', 'security-role', null), (3,'G','administrator', 'security-role', null)
  | 
5th: now you have to map roles<->users

  | insert into JBPM_ID_MEMBERSHIP (ID_, 
  | CLASS_, 
  | NAME_, 
  | ROLE_, 
  | USER_, 
  | GROUP_) values (1,'M','','',1,1),(1,'M','','',1,2),(1,'M','','',1,3)
  | 
Once again , don't know why class should be M (internal use of jbpm???).

6th: Ok, you have the db-setup, next step, create a jbpm-ds.xml file on your deploy dir:

  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>JbpmDS</jndi-name>
  |     <connection-url>jdbc:mysql://localhost:3306/jbpmdb</connection-url>
  |     <driver-class>com.mysql.jdbc.Driver</driver-class>
  |     <user-name>root</user-name>
  |     <password></password>
  |     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
  |     <!-- should only be used on drivers after 3.22.1 with "ping" support
  |     <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
  |     -->
  |     <!-- sql to call when connection is created
  |     <new-connection-sql>some arbitrary sql</new-connection-sql>
  |       -->
  |     <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
  |     <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
  |       -->
  | 
  |     <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
  |     <metadata>
  |        <type-mapping>mySQL</type-mapping>
  |     </metadata>
  |   </local-tx-datasource>
  | </datasources>
  | 

7th: Append this to your login-config.xml under conf dir:


  |     <application-policy name = "jbpm">
  |        <authentication>
  |          <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
  |                        flag="required">
  |            <module-option name="dsJndiName">java:/JbpmDS</module-option>
  |            <module-option name="principalsQuery">
  |              SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_=?
  |            </module-option>
  |            <module-option name="rolesQuery">
  |              SELECT g.NAME_ ,'Roles' 
  |              FROM JBPM_ID_USER u,
  |                   JBPM_ID_MEMBERSHIP m,
  |                   JBPM_ID_GROUP g
  |              WHERE g.TYPE_='security-role'
  |                AND m.GROUP_ = g.ID_
  |                AND m.USER_ = u.ID_
  |                AND u.NAME_=?
  |            </module-option>
  |          </login-module>
  |        </authentication>
  |     </application-policy>
  | 
8th: Create some queues, append the following under the deploy/jms/jbossmq-destinations-service.xml:

  |   <mbean code="org.jboss.mq.server.jmx.Queue"
  | 	 name="jboss.mq.destination:service=Queue,name=JbpmCommandQueue">
  | 	  <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  |   </mbean>
  |   
  |   <mbean code="org.jboss.mq.server.jmx.Queue"
  | 	 name="jboss.mq.destination:service=Queue,name=JbpmJobQueue">
  | 	  <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  |   </mbean>
  | 
And last but not least, copy the jbpm-enterprise.ear to your deploy dir

Ok you are now setup. You can log on your new jbpm deployed into you jboss as standalone and try to access the console.
You try to log in and ... BAAAM! Error. /common/searchheader.xhtml @27,7 disabled="#{search.firstPage}": org.hibernate.exception.SQLGrammarException: could not execute query

I'm still figuring out this one, please come back later :)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031586#4031586

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031586



More information about the jboss-user mailing list