创建流程引擎 #
Flowable 流程引擎通过一个名为 flowable.cfg.xml 的 XML 文件进行配置
现在类路径下放置floable.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.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <property name="jdbcUrl" value="jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000" /> <property name="jdbcDriver" value="org.h2.Driver" /> <property name="jdbcUsername" value="sa" /> <property name="jdbcPassword" value="" /> <property name="databaseSchemaUpdate" value="true" /> <property name="asyncExecutorActivate" value="false" /> <property name="mailServerHost" value="mail.my-corp.com" /> <property name="mailServerPort" value="5025" /> </bean> </beans>
然后使用静态方法进行获取ProcessEngine
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
还有其他配置,这里不一一列举,详见文档地址 https://www.flowable.com/open-source/docs/bpmn/ch03-Configuration
大致目录如下