3

我将在我的项目中使用 activiti-5.12.1。

这是 activiti.cfg.xml 文件:

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

<beans xmlns="http://www.springframework.org/schema/beans" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration" >

        <property name="databaseType" value="postgres" />
        <property name="jdbcUrl" value="jdbc:postgresql://project:5432/MYPROJECT" />
        <property name="jdbcDriver" value="org.postgresql.Driver" />
        <property name="jdbcUsername" value="me" />
        <property name="jdbcPassword" value="you" />

        <property name="databaseSchemaUpdate" value="false" />

        <property name="jobExecutorActivate" value="false" />

        <property name="history" value="full" />

        <property name="customPreVariableTypes">
            <list>
                <ref bean="activitiScriptNodeType" />
                <ref bean="activitiScriptNodeListType" />
            </list>
        </property>


        <property name="mailServerHost" value="mail.my-corp.com" />
        <property name="mailServerPort" value="5025" />
    </bean>

</beans>

我想通过使用 activiti-engine-5.12.1.jar 中提供的脚本自己创建 activiti 数据库。
默认情况下,这些表是在public schema中创建的,但我希望它们位于另一个模式中,例如mySchema
我的问题是如何管理这个,此外,我如何在 activiti.cfg.xml 中指定它,以通知 activiti 引擎 api activiti 表在 mySchema 中?

4

3 回答 3

2

我正在使用MySQL数据库activiti,所以我有一些这样的配置来创建我自己的模式名称:

<property name="databaseType" value="mysql" />
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti" />
<property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
<property name="jdbcUsername" value="root" />
<property name="jdbcPassword" value="root" />

因此,当您使用postgresql时,我不太确定以下代码是否适合您:

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

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration" >

    <property name="databaseType" value="postgres" />
    <property name="jdbcUrl" value="jdbc:postgresql://project:5432/MYPROJECT/activiti" />
    <property name="jdbcDriver" value="org.postgresql.Driver" />
    <property name="jdbcUsername" value="me" />
    <property name="jdbcPassword" value="you" />

    <property name="databaseSchemaUpdate" value="false" />

    <property name="jobExecutorActivate" value="false" />

    <property name="history" value="full" />

    <property name="customPreVariableTypes">
        <list>
            <ref bean="activitiScriptNodeType" />
            <ref bean="activitiScriptNodeListType" />
        </list>
    </property>


    <property name="mailServerHost" value="mail.my-corp.com" />
    <property name="mailServerPort" value="5025" />
</bean>

在部署带有新更改的 `activiti 之前,请确保您的数据库已创建模式。

于 2013-05-15T11:09:17.397 回答
1

尝试将数据库的类型更改为您的数据库名称或“postgresql”。

于 2014-03-07T17:38:56.850 回答
0

如果您使用的是 spring,则以下属性会有所帮助: spring.activiti.databaseSchema=MY_SCHEMA

于 2019-03-15T20:11:35.827 回答