二、activiti工作流-創建25張表


首先我們在eclipse上創建一個maven項目

然后在resources下面創建一個file,並命名問activiti.cfg.xml

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="jdbcUrl" value="jdbc:mysql://localhost:3306/student" />
<property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
<property name="jdbcUsername" value="root" />
<property name="jdbcPassword" value="123456" />
<property name="databaseSchemaUpdate" value="true" />
</bean>
</beans>

然后新建一個包和一個類

 

執行以下代碼,自動會在數據庫創建25張表

    //使用activiti.cfg.xml配置文件,引入配置文件一樣可以獲得流程引擎信息

@Test
public void testCreateTableWithXml(){
// 引擎配置
ProcessEngineConfiguration pec=ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
// 獲取流程引擎對象
ProcessEngine processEngine=pec.buildProcessEngine();
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM