jBPM4.4安装时候数据库的配置

在通过ant执行build.xml,安装jBPM时候,数据库的配置如下:

 

jBPM目前安装在tomcat中,

 

和数据库进行相连,在build.xml中:

<target name="install.jbpm.into.tomcat" description="Deploy jBPM to Tomcat">

由这个target生成

 

 install.jbpm.into.tomcat的配置中,有以下配置:

    <generatecfg connection="tomcat" />

    <!-- create the jbpm configuration jar file in lib/ -->
    <jar destfile="${tomcat.home}/lib/jbpm-cfg.jar">
      <fileset dir="${jbpm.home}/install/generated/cfg">
        <include name="jbpm.cfg.xml" />
        <include name="jbpm.hibernate.cfg.xml" />
        <include name="jbpm.mail.properties" />
      </fileset>
    </jar>

 jbpm.cfg.xml,  jbpm.hibernate.cfg.xml, jbpm.mail.properties 这3个文件打包在jbpm-cfg.jar中。

(还有一个logging.properties没有见到上哪里去了)

 

对于generatecfg的配置:

  <macrodef name="generatecfg">
    <!-- {standalone | jta | spring | tomcat} -->
    <attribute name="transaction" default="standalone" />
    <!-- jdbc | datasource -->
    <attribute name="connection" default="jdbc" />
    <!-- jdk | none -->
    <attribute name="log" default="jdk" />
    <!-- default | testsuite -->
    <attribute name="mail" default="default" />

    <sequential>
      <mkdir dir="${cfg.dest.dir}" />
      <copy tofile="${cfg.dest.dir}/jbpm.cfg.xml"
            file="${install.src.dir}/cfg/jbpm/@{transaction}.jbpm.cfg.xml"
            overwrite="true"
            failοnerrοr="false" />
      <copy tofile="${cfg.dest.dir}/jbpm.hibernate.cfg.xml"
            file="${install.src.dir}/cfg/hibernate/@{connection}/${database}.hibernate.cfg.xml"
            overwrite="true">
        <filterset filtersfile="${jdbc.properties.dir}/${database}.properties" />
      </copy>
      <replace file="${cfg.dest.dir}/jbpm.hibernate.cfg.xml"
               token="$${bind.address}"
               value="${bind.address}" />
      <copy todir="${cfg.dest.dir}" overwrite="true">
        <fileset dir="${install.src.dir}/cfg/logging/@{log}" />
      </copy>
      <copy tofile="${cfg.dest.dir}/jbpm.mail.properties"
            file="${install.src.dir}/cfg/mail/jbpm.mail.@{mail}.properties"
            overwrite="true">
        <filterset>
          <filter token="bind.address" value="${bind.address}" />
        </filterset>
      </copy>

      <!-- If the target environment uses Spring, also copy the applicationContext.xml file-->
      <condition property="is.spring.environment">
        <contains string="@{transaction}" substring="spring" />
      </condition>
      <antcall target="internal.copy.spring.applicationContext" />
    </sequential>
  </macrodef>

 在执行install.jbpm.into.tomcat的时候,根据设置的参数,将所用到的参数文件,放到${cfg.dest.dir}目录中,

打包成jbpm-cfg.jar,放在tomcat/lib目录中了

 

----------------------------------------------------------------------------------

这些文件的来源:

 

这些文件都是在install/src/cfg目录中的,从每个目录中复制一个文件过来:

      <copy tofile="${cfg.dest.dir}/jbpm.cfg.xml

"
            file="${install.src.dir}/cfg/jbpm
/@{transaction}.jbpm.cfg.xml"
            overwrite="true"
            failοnerrοr="false" />

      <copy tofile="${cfg.dest.dir}/jbpm.hibernate.cfg.xml

"
            file="${install.src.dir}/cfg/hibernate
/@{connection}/${database}.hibernate.cfg.xml"
            overwrite="true">
            <filterset filtersfile="${jdbc.properties.dir}/${database}.properties" />
      </copy>
      <!-- 这个replace有问题的,看是在hibernate配置文件中,替换bind.address变量,
             但是实际情况中,只有在mail的配置文件中,才出现bind.address这个变量   -->

      <replace file="${cfg.dest.dir}/jbpm.hibernate.cfg.xml"
               token="$${bind.address}"
               value="${bind.address}" />

       <!-- log的配置文件处理 -->
       <copy todir="${cfg.dest.dir}" overwrite="true">
            <fileset dir="${install.src.dir}/cfg/logging
/@{log}" />
      </copy>

      <copy tofile="${cfg.dest.dir}/jbpm.mail.properties

"
            file="${install.src.dir}/cfg/mail
/jbpm.mail.@{mail}.properties"
            overwrite="true">
        <filterset>
          <filter token="bind.address" value="${bind.address}" />
        </filterset>
      </copy>
     
      <!-- Spring的处理

 If the target environment uses Spring, also copy the applicationContext.xml file-->
      <condition property="is.spring.environment">
        <contains string="@{transaction}" substring="spring" />
      </condition>
      <antcall target="internal.copy.spring.applicationContext" />

 

tomcat的安装中,hibernate数据库连接用到了JNDI配置:java:comp/env/jdbc/JBpmDS

但是在安装的地方没有设置(只有在birt中有提到)

 

但是在生成的tomcat/conf目录中生成的server.xml中,有一个Resource,名字为:jdbc/jbpm,而不是JBpmDS。

 

在tomcat/webapps中的2个安装的工程:

gwt-console-server和jbpm-console的 META-INF目录中的context.xml文件中,把JBpmDS指向了jdbc/jbpm

<?xml version="1.0" encoding="UTF-8"?>

<Context>
  <ResourceLink name="jdbc/JbpmDS
" global="jdbc/jbpm
" type="javax.sql.DataSource" />
  <Realm className="org.jbpm.integration.tomcat6.JbpmConsoleRealm" dataSourceName="jdbc/jbpm" />
</Context>

 通过这样的方式,把jBPM工程中的JNDI名字和tomcat中的Resource连接起来;

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值