JBPM WEB CONSOLE安装实录

http://www.blogjava.net/paulwong/archive/2009/03/13/259551.html

JBPM WEB CONSOLE是一个B/S端的,能管理JBPM的流程和实例。



1、下载jbpm-jpdl-3.2.3。



2、安装TOMCAT 6.0,注意,这个版本的JBPM由于使用了JSF 1.2,而5.5以下的不支持。



3、安装ANT。



4、安装MYSQL 5.0,建立JBPM表,可以ANT,或在数据库中执行SCRIPT建立。



5、制作JBPM CONSOLE的WAR包。

转到DOS运行模式,去到deploy目录,运行ant  customize.console.for.tomcat,生成两个目录:customized和target,将缺少的JAR包加入到WAR包中的WEB-INF/lib中,最后完整的JAR包



activation.jar

antlr-2.7.6.jar

asm.jar

bsh.jar

cglib.jar

commons-beanutils-1.8.0.jar

commons-collections.jar

commons-digester-1.8.jar

commons-fileupload.jar

commons-io.jar

commons-logging.jar

dom4j.jar

gravel.jar

hibernate3.jar

jboss-backport-concurrent.jar

jboss-j2ee.jar

jboss-retro-1.1.0-rt.jar

jbpm4jsf.jar

jbpm-identity.jar

jbpm-jpdl.jar

jsf-api.jar

jsf-facelets.jar

jsf-impl.jar

jstl.jar

mysql-connector-java-5.0.4-bin.jar

servlet-api.jar

standard-1.0.6.jar



修改WEB.XML里面的其中SECURITY元素为:

JBPM WEB CONSOLE安装实录    <security-role>

JBPM WEB CONSOLE安装实录        <role-name>admin</role-name>

JBPM WEB CONSOLE安装实录    </security-role>

JBPM WEB CONSOLE安装实录    <security-role>

JBPM WEB CONSOLE安装实录        <role-name>user</role-name>

JBPM WEB CONSOLE安装实录    </security-role>

JBPM WEB CONSOLE安装实录

JBPM WEB CONSOLE安装实录    <!--

JBPM WEB CONSOLE安装实录       Security constraints - uncomment and optionally customize the role name to require

JBPM WEB CONSOLE安装实录       a login before access is allowed to the application.

JBPM WEB CONSOLE安装实录

JBPM WEB CONSOLE安装实录       Also, be sure to edit jboss-web.xml to configure the security domain if you are

JBPM WEB CONSOLE安装实录       deploying inside JBossAS.

JBPM WEB CONSOLE安装实录    -->

JBPM WEB CONSOLE安装实录    <security-constraint>

JBPM WEB CONSOLE安装实录        <web-resource-collection>

JBPM WEB CONSOLE安装实录            <web-resource-name>Secure Area</web-resource-name>

JBPM WEB CONSOLE安装实录            <url-pattern>/sa/*</url-pattern>

JBPM WEB CONSOLE安装实录            <http-method>GET</http-method>

JBPM WEB CONSOLE安装实录            <http-method>POST</http-method>

JBPM WEB CONSOLE安装实录        </web-resource-collection>

JBPM WEB CONSOLE安装实录        <auth-constraint>

JBPM WEB CONSOLE安装实录            <role-name>user</role-name>

JBPM WEB CONSOLE安装实录            <role-name>admin</role-name>

JBPM WEB CONSOLE安装实录        </auth-constraint>

JBPM WEB CONSOLE安装实录    </security-constraint>

修改hibernate.cfg.xml

JBPM WEB CONSOLE安装实录<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

6、配置TOMCAT。

把MYSQL的驱动COPY到lib下;增加数据源

JBPM WEB CONSOLE安装实录  <Resource

JBPM WEB CONSOLE安装实录    type="javax.sql.DataSource"

JBPM WEB CONSOLE安装实录    name="jdbc/JbpmDataSource"

JBPM WEB CONSOLE安装实录    url="jdbc:mysql://localhost/jbpm"

JBPM WEB CONSOLE安装实录    password="888"

JBPM WEB CONSOLE安装实录    validationQuery="SELECT * FROM jbpm_processdefinition j;"

JBPM WEB CONSOLE安装实录    driverClassName="com.mysql.jdbc.Driver"

JBPM WEB CONSOLE安装实录    maxWait="5000"

JBPM WEB CONSOLE安装实录    username="root"

JBPM WEB CONSOLE安装实录    maxIdle="2"

JBPM WEB CONSOLE安装实录    maxActive="4"/>

增加LOGIN CONSOLE的用户,有两种方式

1)修改tomcat-users.xml为

JBPM WEB CONSOLE安装实录<?xml version='1.0' encoding='utf-8'?>

JBPM WEB CONSOLE安装实录<tomcat-users>

JBPM WEB CONSOLE安装实录  <role rolename="user"/>

JBPM WEB CONSOLE安装实录  <role rolename="role1"/>

JBPM WEB CONSOLE安装实录  <role rolename="admin"/>

JBPM WEB CONSOLE安装实录  <role rolename="tomcat"/>

JBPM WEB CONSOLE安装实录  <role rolename="manager"/>

JBPM WEB CONSOLE安装实录  <user username="role1" password="tomcat" roles="role1"/>

JBPM WEB CONSOLE安装实录  <user username="admin" password="888" roles="manager,admin,user"/>

JBPM WEB CONSOLE安装实录  <user username="both" password="tomcat" roles="tomcat,role1"/>

JBPM WEB CONSOLE安装实录  <user username="tomcat" password="tomcat" roles="tomcat"/>

JBPM WEB CONSOLE安装实录</tomcat-users>

JBPM WEB CONSOLE安装实录

2)配置用户从数据库中读取,修改jbpm-console.xml:

JBPM WEB CONSOLE安装实录<Context>

JBPM WEB CONSOLE安装实录<Realm  className="org.apache.catalina.realm.JDBCRealm 

JBPM WEB CONSOLE安装实录          driverName="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/jbpm"

JBPM WEB CONSOLE安装实录          connectionName="root" 

JBPM WEB CONSOLE安装实录          connectionPassword="自己的密码"

JBPM WEB CONSOLE安装实录          userTable="JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g" 

JBPM WEB CONSOLE安装实录          userNameCol="g.TYPE_ = 'security-role' AND m.GROUP_ = g.ID_ AND m.USER_ = u.ID_ AND u.NAME_" 

JBPM WEB CONSOLE安装实录          userCredCol="DISTINCT u.PASSWORD_"

JBPM WEB CONSOLE安装实录          userRoleTable="JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g" 

JBPM WEB CONSOLE安装实录          roleNameCol="g.NAME_" />

JBPM WEB CONSOLE安装实录</Context>

JBPM WEB CONSOLE安装实录

向数据库中插入以下数据:

JBPM WEB CONSOLE安装实录 INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_GROUP VALUES(2,'G','admin','security-role',NULL);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_GROUP VALUES(3,'G','user','security-role',NULL);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_GROUP VALUES(4,'G','hr','organisation',NULL);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_USER VALUES(4,'U','shipper','shipper@sample.domain','shipper');

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,4);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,4);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,4,4);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,4,3);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,3);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,2,3);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,3,3);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,2);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,2);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,5);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,'boss',2,1);

JBPM WEB CONSOLE安装实录      INSERT INTO JBPM_ID_MEMBERSHIP VALUES(12,'M',NULL,NULL,1,1);

JBPM WEB CONSOLE安装实录

7、启动TOMCAT,部署刚才生成的WAR包,输入http://localhost:8080/jbpm-console访问,用户名:admin,密码:888

上一篇:2015暑假acm短训小结


下一篇:Python基础(一)