flowable工作流

1、 什么是Flowable?

如果你对工作流引擎有所了解,那么一定知道Java领域当前主流的工作流引擎无非就是Jboss旗下的JBPM和Alfresco旗下的Activiti。

Flowable是Activiti原班主创人员从Activiti分离出来的一套工作流引擎,是一个业务流程管理(BPM)和工作流系统,适用于开发人员和系统管理员。其核心是超快速、稳定的BPMN2流程引擎,易于与 Spring集成使用。

2.eclispe测试Flowable(maven项目)

2.1 工程目录

flowable工作流_第1张图片

2.2 pom.xml


	4.0.0
	com.zjgt
	flowable
	war
	0.0.1-SNAPSHOT
	flowable Maven Webapp
	http://maven.apache.org

	
		
			junit
			junit
			4.12
		
		
		
			mysql
			mysql-connector-java
			5.1.30
		

		
		
			org.flowable
			flowable-spring
			6.2.0
		
		
		
			com.alibaba
			druid
			1.1.5
		


	

	
		flowable
		
			
				src/main/java
				
					**/*.xml
				
			
			
				src/main/resources
				
					**/*
				
			
		
	



2.3 FlowableTest.java


package com.cesat;

import java.io.IOException;
import java.io.InputStream;

import org.flowable.engine.IdentityService;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.DeploymentBuilder;
import org.junit.Before;
import org.junit.Test;

public class FlowableTest {

	// 获取到flowable ProcessEngine
	ProcessEngine processEngine = null;
	// 获取RepositoryService 实例对象
	RepositoryService repositoryService = null;
	// 资源名称
	String resourceName = "leaveProcess.bpmn";

	@Test
	public void init() {

		ProcessEngineConfiguration conf = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
		// 设置数据源信息
		conf.setJdbcDriver("com.mysql.jdbc.Driver");
		conf.setJdbcUrl("jdbc:mysql://localhost:3306/flowable_db");
		conf.setJdbcUsername("root");
		conf.setJdbcPassword("123456");
		// 设置自动建表
		conf.setDatabaseSchemaUpdate("true");
		// 创建一个流程引擎对象,在创建流程引擎对象过程中会自动建表
		ProcessEngine processEngine = conf.buildProcessEngine();
	}

}
2.3鼠标右键选择RunAS-->Junit Test 即可执行 可在navcat里面查看已经创建好的数据库

flowable工作流_第2张图片










你可能感兴趣的:(flowable)