Postgresql 为activiti-5.12.1表指定数据库架构

Postgresql 为activiti-5.12.1表指定数据库架构,postgresql,activiti,bpmn,Postgresql,Activiti,Bpmn,我将在我的项目中使用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="ht

我将在我的项目中使用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数据库。
默认情况下,表是在公共模式中创建的,但我希望它们位于另一个模式中,例如mySchema

我的问题是如何管理它,另外,我如何在activiti.cfg.xml中指定它,以通知activiti引擎api activiti表在mySchema中?

我正在使用
MySQL
数据库来创建我自己的模式名:

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


在部署带有新更改的“activiti”之前,请确保您的数据库已创建架构。

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

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

数据库类型将是“postgres”(在activiti 5.18.0中)-但您不需要设置它,它将从JDBC URL派生。但不幸的是,Activiti对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>