工作流(2)--activit 5.14 開發測試

1. 搭建開發環境

   1.1 拷貝jar

   1.2 運行mysql數據庫腳本

   1.3 在classpath路徑下創建activiti.cfg.xml,代碼如下:

<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/workflow1?autoReconnect=true" />
    <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
    <property name="jdbcUsername" value="activiti" />
    <property name="jdbcPassword" value="activiti" />
                           
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jobExecutorActivate" value="false" />
    <property name="mailServerHost" value="mail.my-corp.com" />
    <property name="mailServerPort" value="5025" />
  </bean>
</beans>

   1.4 創建測試類,獲取流程引擎ProcessEngine

package com.bpm.engine;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.junit.Test;
public class EngineTest {
    ProcessEngine pe;
    public EngineTest(){
        pe = ProcessEngines.getDefaultProcessEngine();
    }
    @Test
    public void test() {
        System.out.println(pe);
    }
}

   console界面:

org.activiti.engine.impl.ProcessEngineImpl@5e222e


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章