这是简单版本

后续有spring整合版本再更新

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
						http://www.springframework.org/schema/contex http://www.springframework.org/schema/context/spring-context.xsd
						http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
    <!--activiti单独运行的ProcessEngine配置对象(processEngineConfiguration),使用单独启动方式
            默认情况下:bean的id=processEngineConfiguration
        -->
    <!--<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">-->
        <!--<property name="jdbcDriver" value="com.mysql.jdbc.Driver"></property>-->
        <!--<property name="jdbcUrl" value="jdbc:mysql://192.168.2.177:3306/activiti?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false&amp;serverTimezone=GMT%2B8"></property>-->
        <!--<property name="jdbcUsername" value="root"></property>-->
        <!--<property name="jdbcPassword" value="root"></property>-->
        <!--&lt;!&ndash;数据库生成策略&ndash;&gt;-->
        <!--&lt;!&ndash;activiti在生成表的时候,true 表示数据库中如果已经存在,那么直接使用,如果不存在,则直接创建&ndash;&gt;-->
        <!--<property name="databaseSchemaUpdate" value="true"></property>-->
    <!--</bean>-->

    <!--数据库连接池的构造注入-->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
        <property name="url" value="jdbc:mysql://127.0.0.1:3306/activiti?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false&amp;serverTimezone=GMT%2B8"></property>
        <property name="username" value="root"></property>
        <property name="password" value="root"></property>
        <property name="maxActive" value="30"></property>
        <property name="minIdle" value="5"></property>

    </bean>
    <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
        <!--代表数据源-->
        <property name="dataSource" ref="dataSource"></property>
        <!--代表是否生成表结构-->
        <property name="databaseSchemaUpdate" value="true"/>
    </bean>






</beans>
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐