工作流(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


本文出自 “寂寞肖申克” 博客,谢绝转载!

你可能感兴趣的:(mysql,开发,工作流)