Activiti工作流系统环境搭建
Posted cat-fish6
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Activiti工作流系统环境搭建相关的知识,希望对你有一定的参考价值。
一、创建Activiti工程,并导入Activiti包及数据库驱动包
二、用代码方式创建 流程引擎
1 @Test 2 public void createProcessEngineWithCode() { 3 //创建流程引擎配置对象 4 ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration(); 5 //设置流程引擎数据库配置 6 processEngineConfiguration.setJdbcDriver("com.mysql.jdbc.Driver"); 7 processEngineConfiguration.setJdbcUrl("jdbc:mysql://localhost:3306/activiti0312"); 8 processEngineConfiguration.setJdbcUsername("root"); 9 processEngineConfiguration.setJdbcPassword("root"); 10 //建表策略 11 processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE); 12 //创建流程引擎 13 ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine(); 14 System.out.println(processEngine); 15 }
三、采用配置文件方式创建 流程引擎
1 @Test 2 public void createProcessEngineWithXMLConfig(){ 3 ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti-context.xml"); 4 ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine(); 5 System.out.println(processEngine); 6 }
1 <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> 2 <property name="jdbcDriver" value="com.mysql.jdbc.Driver"></property> 3 <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti0312"></property> 4 <property name="jdbcUsername" value="root"></property> 5 <property name="jdbcPassword" value="root"></property> 6 <property name="databaseSchemaUpdate" value="true"></property> 7 </bean>
以上是关于Activiti工作流系统环境搭建的主要内容,如果未能解决你的问题,请参考以下文章
springboot整合activiti+bpmn-js或VUE(架构搭建篇)