⼯作流引擎flowable学习----idea创建maven请假流程例⼦1.创建简单maven项⽬
2.添加依赖
选择项⽬下的l⽂件,打开,加上⽅框⾥代码
牛肉面
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-engine</artifactId>
<version>6.4.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
3.在项⽬test->src->resources中添加⽇志⽂件log4j.properties,写⼊该内容Logger=DEBUG, CA
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n
4.新建flowable的表
ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
.tJdbcUrl("jdbc:mysql://localhost:3306/flowable")
.tJdbcUrname("root")
.tJdbcPassword("root")
.tJdbcDriver("sql.jdbc.Driver")
宝宝成长记录.tDatabaSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
ProcessEngine processEngine = cfg.buildProcessEngine();
晴反义词运⾏后表⽬录为
5.使⽤flowable创建⼀个简单的请假流程
5.1创建⼀个bpmn⽂件:l,将其放置于/src/main/resources下
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="/spec/BPMN/20100524/MODEL"
xmlns:xsi="www.w3/2001/XMLSchema-instance"
xmlns:xsd="www.w3/2001/XMLSchema"
xmlns:bpmndi="/spec/BPMN/20100524/DI"
江亭xmlns:omgdc="/spec/DD/20100524/DC"
xmlns:omgdi="/spec/DD/20100524/DI"
xmlns:activiti="activiti/bpmn"
typeLanguage="www.w3/2001/XMLSchema"
expressionLanguage="www.w3/1999/XPath"
targetNamespace="www.flowable/processdef">
艺术照片>康熙为什么要杀施琅
<process id="holidayRequest" name="Holiday Request" isExecutable="true">
<startEvent id="startEvent"/>
垃圾分类的作文<quenceFlow sourceRef="startEvent" targetRef="approveTask"/>
<urTask id="approveTask" name="Approve or reject request" activiti:candidateGroups="managers"/>
<quenceFlow sourceRef="approveTask" targetRef="decision"/>
<exclusiveGateway id="decision"/>
<quenceFlow sourceRef="decision" targetRef="externalSystemCall">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[
${approved}
]]>
</conditionExpression>
</quenceFlow>
<quenceFlow sourceRef="decision" targetRef="ndRejectionMail">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[
${!approved}
]]>
</conditionExpression>
</quenceFlow>
<!--cn.test.first.CallExternalSystemDelegate是你的包-->
<rviceTask id="externalSystemCall" name="Enter holidays in external system" activiti:class="cn.test.first.CallExternalSystemDelegate"/> <quenceFlow sourceRef="externalSystemCall" targetRef="holidayApprovedTask"/>
<urTask id="holidayApprovedTask" name="Holiday approved" activiti:assignee="${employee}"/>
<quenceFlow sourceRef="holidayApprovedTask" targetRef="approveEnd"/>
<!--cn.test.first.SendRejectionMail是你的包-->
<rviceTask id="ndRejectionMail" name="Send out rejection email" activiti:class="cn.test.first.SendRejectionMail"/>
<quenceFlow sourceRef="ndRejectionMail" targetRef="rejectEnd"/>
<endEvent id="approveEnd"/>
<endEvent id="rejectEnd"/>
古诗江南汉乐府
</process>
</definitions>
5.2部署写好的BPMN2.0⽂件: