[jboss-user] [JBoss jBPM] - Re: jbpm 3.2.GA and mysql

sparklehorse do-not-reply at jboss.com
Fri Jun 22 08:46:46 EDT 2007


I was able to make it run
using this approach:

- execute in mysql the incomplete jbpm.jpdl.mysql.sql provided in the starter kit
- manually create the missing tables

 create table JBPM_ID_GROUP (
  | ID_ bigint not null auto_increment,
  |         CLASS_ char( 1) not null, 
  |         NAME_ varchar(255), 
  |         TYPE_ varchar(255), 
  |         PARENT_ bigint, 
  |         primary key (ID_));
  | create table JBPM_ID_MEMBERSHIP (
  | ID_ bigint not null auto_increment,
  |         CLASS_  char(1) not null, 
  |         NAME_ varchar(255), 
  |         ROLE_ varchar(255), 
  |         USER_ bigint, 
  |         GROUP_ bigint, 
  |         primary key ( ID_));
  | create table JBPM_ID_PERMISSIONS (
  |         ENTITY_ bigint not null, 
  |         CLASS_ varchar(255), 
  |         NAME_ varchar(255), 
  |         ACTION_ varchar(255));
  | create table JBPM_ID_USER (
  | ID_ bigint not null auto_increment,
  |         CLASS_ char(1 ) not null, 
  |         NAME_ varchar(255), 
  |         EMAIL_ varchar(255), 
  |         PASSWORD_ varchar(255), 
  |         primary key (ID_));
  | alter table JBPM_ID_GROUP add constraint FK_ID_GRP_PARENT foreign key (PARENT_) references JBPM_ID_GROUP;
  | alter table JBPM_ID_MEMBERSHIP add constraint FK_ID_MEMSHIP_GRP foreign key (GROUP_) references JBPM_ID_GROUP;
  | alter table JBPM_ID_MEMBERSHIP add constraint FK_ID_MEMSHIP_USR foreign key (USER_) references JBPM_ID_USER;

- manually insert the missing data


  | INSERT INTO JBPM_ID_GROUP VALUES(1,'G','participant','security-role',NULL);
  |   INSERT INTO JBPM_ID_GROUP VALUES(2,'G','administrator','security-role',NULL);
  |   INSERT INTO JBPM_ID_GROUP VALUES(3,'G','hr','organisation',NULL);
  |   INSERT INTO JBPM_ID_GROUP VALUES(4,'G','sales','organisation',NULL);
  |   INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,2);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,1);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,3,3);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,2,3);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,4);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,'boss',2,4);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,2,5);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,2,1);
  |   INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,1,1);
  |   INSERT INTO JBPM_ID_USER VALUES(1,'U','cookie monster','[EMAIL PROTECTED]','cookie monster');
  |   INSERT INTO JBPM_ID_USER VALUES(2,'U','ernie','[EMAIL PROTECTED]','ernie');
  |   INSERT INTO JBPM_ID_USER VALUES(3,'U','bert','[EMAIL PROTECTED]','bert');
  |   INSERT INTO JBPM_ID_USER VALUES(4,'U','grover','[EMAIL PROTECTED]','grover');

- open the jbpm-enterprise.ear
open the jbpm-configs.tar in it and change the hibernate-cfg.xml
for customizing the dialect mysql

- change in jboss the login-config.xml module 
to include the authentication versus the jbpm db

  |   <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>
  | 

security domain should be jbpm as verified in jboss-web.xml of the jbpm-console.war


....now its running...

hope this helps some other unlucky guy who is working with the 
unsable documentation of jbpm!

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

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



More information about the jboss-user mailing list