package com.osvue.bpmn.activitiapp;
import javax.annotation.processing.ProcessingEnvironment;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
public class CreateDataTable {
public static void main(String[] args) {
createTable();
}
public static void createTable(){
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
processEngineConfiguration.setJdbcDriver("com.mysql.jdbc.Driver");
processEngineConfiguration.setJdbcUrl("jdbc:mysql://localhost:3306/activi?useUnicode=true&characterEncoding=utf8&useSSL=false");
processEngineConfiguration.setJdbcUsername("root");
processEngineConfiguration.setJdbcPassword("0");
processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
System.out.println("processEngine:"+processEngine);
}
}
use xml
public void createTable_2(){
ProcessEngine processEngine = ProcessEngineConfiguration.
createProcessEngineConfigurationFromResource("activiti.cfg.xml").
buildProcessEngine();
}
activiti.cfg.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
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
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
<property name="jdbcDriver" value="com.mysql.jdbc.Driver"></property>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activi?useUnicode=true&characterEncoding=utf8"></property>
<property name="jdbcUsername" value="root"></property>
<property name="jdbcPassword" value="root"></property>
<property name="databaseSchemaUpdate" value="true"></property>
</bean>
</beans>
sts 开发
window => show view => properties
- 开始结束Event,连线、userTask
- 配置userTask 属性
properties MainConfig
配置办理人- 配置 流程id、name
部署流程定义