初始化
jBPM
数据表至相应数据库
(MS SQLServer 2000)
@Author:zwm
@Msn:zhaowenming21@hotmail.com
@Blog:http://blog.csdn.net/zhaowenming21
@Date:2007-8-25
下载
jbpm-starters-kit-3.1.4
解压至本地
E:\ jbpm-starters-kit-3.1.4\
下,
解压后的目录格式为
E:\ jbpm-starters-kit-3.1.4\
+Jbpm
+
jbpm-bpel
+
jbpm-db
+
jbpm-designer
+
jbpm-server
readme.html
现在,进行
ant
工具的配置
配置两个环境变量:
1.
ant_home:
C:\eclipse\plugins\org.apache.ant_1.6.5
2.
Path:
C:\eclipse\plugins\org.apache.ant_1.6.5\bin
配置文件修改项
:
进入
jbpm\
目录下,进行相关修改
(
鉴于个人机器性能因素,没有采用
Oracle,
使用
SQLServer,
应该与数据库类别关系不大呵
)
1.
进入
jbpm\src\config.files\
下,修改
hibernate.cfg.xml
的
(
注,加粗部分为修改后的结果
,
下同
)
<!-- jdbc connection properties -->
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="hibernate.connection.url">jdbc:microsoft:sqlserver://localhost:1433;databaseName=jbpm</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
2.
进入
jbpm\src\resources\
下,创建一个
mysqlserver
文件夹,将
jbpm\src\resources\hsqldb
下的两个文件拷贝至刚才新建的
mysqlserver
文件夹下
,
修改这个文件
create.db.hibernate.properties
# these properties are used by the build script to create
# a hypersonic database in the build/db directory that contains
# the jbpm tables and a process deployed in there
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver
hibernate.connection.url=jdbc:microsoft:sqlserver://localhost:1433;databaseName=jbpm
hibernate.connection.username=sa
hibernate.connection.password=
hibernate.show_sql=true
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
3.
进入
jbpm\
下,修改
build.deploy.xml
文件的
SERVER
那一段
(
即指定刚才建立的
mysqlserver
文件夹目录
)
<!-- ============== -->
<!-- === SERVER === -->
<!-- ============== -->
<target name="create.db" depends="declare.jbpm.tasks, db.clean, db.start" description="creates a hypersonic database with the jbpm tables and loads the processes in there">
<jbpmschema actions="create"
cfg="${basedir}/src/config.files/hibernate.cfg.xml"
properties="${basedir}/src/resources/mysqlserver/create.db.hibernate.properties"/>
<loadidentities file="${basedir}/src/resources/mysqlserver/identity.db.xml"
cfg="${basedir}/src/config.files/hibernate.cfg.xml"
properties="${basedir}/src/resources/mysqlserver/create.db.hibernate.properties"/>
<ant antfile="build.xml" target="build.processes" inheritall="false" />
<deployprocess cfg="${basedir}/src/config.files/hibernate.cfg.xml"
properties="${basedir}/src/resources/mysqlserver/create.db.hibernate.properties">
<fileset dir="build" includes="*.process" />
</deployprocess>
<antcall target="db.stop" />
</target>
4.
拷贝驱动文件
SQLServer
的三个驱动
(msbase.jar,
mssqlserver.jar,
msutil.jar)
至
jbpm\lib
下
另外,记得在
sqlserver
下创建一个
jbpm
数据库哦
.
现在进行
ant
构建
运行
cmd>
进入
E:\jbpm-starters-kit-3.1.4\jbpm\
下
执行
ant create.db
–
buildfile build.deploy.xml
如果不出其它异常(但我这还是出现点异常信息,不过表是创建成功了,呵呵
,
不知道是否应该关注异常信息)
认真数一下,
33
张以
JBPM_**
开头的数据表毅然矗立在你的眼前!谢谢您的阅读,希望得到您的指点
(Msn:zhaowenming21@hotmail.com,QQ:312837814)