Activiti目录(三)部署流程、发起流程

本文深入探讨Activiti工作流,通过BPMN流程定义实现学生请假审批流程,详细阐述了流程的各个节点和条件表达式。接着介绍了如何部署流程,包括设置流程键值、添加BPMN文件,并部署到Activiti引擎。最后,展示了启动流程的步骤,包括设置流程变量、启动流程实例、完成申请任务等操作,确保流程顺利进行。
摘要由CSDN通过智能技术生成

把Activiti打入你的脑袋,通过画流程、部署流程、发起流程的方式快速打入

目录

Activiti(一)入门了解

Activiti(二)整合

Activiti零零碎碎的坑

一、BPMN流程

内容讲解:
applyState:0学生发起请假 1老师审核通过 2老师领导审核通过 3院长审核通过结束 4请假驳回 6学生重新申请
applyExamine:驳回后学生重新申请到谁
Gareway:必须要满足一个条件不如会报错
在这里插入图片描述
struApply.bpmn20.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1651751051110" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
  <process id="myProcess_1" isClosed="false" isExecutable="true" processType="None">
    <startEvent activiti:formKey="LeaveShanghaiApply" id="_2" name="StartEvent"/>
    <userTask activiti:assignee="${userName1}" activiti:async="false" activiti:candidateUsers="${userIds1}" activiti:exclusive="true" id="_3" name="teacher">
      <documentation id="_3_D_1"/>
    </userTask>
    <userTask activiti:assignee="${userName2}" activiti:candidateUsers="${userIds2}" activiti:exclusive="true" id="_4" name="academy"/>
    <userTask activiti:assignee="${userName3}" activiti:candidateUsers="${userIds3}" activiti:exclusive="true" id="_5" name="epidemicGroup"/>
    <endEvent id="_17" name="EndEvent"/>
    <exclusiveGateway gatewayDirection="Unspecified" id="_9" name="ExclusiveGateway1"/>
    <sequenceFlow id="_10" name="success" sourceRef="_9" targetRef="_4">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyState==1}]]></conditionExpression>
    </sequenceFlow>
    <exclusiveGateway gatewayDirection="Unspecified" id="_13" name="ExclusiveGateway2"/>
    <sequenceFlow id="_15" sourceRef="_4" targetRef="_13"/>
    <sequenceFlow id="_16" name="success" sourceRef="_13" targetRef="_5">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyState==2}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_27" sourceRef="_3" targetRef="_9"/>
    <userTask activiti:assignee="${userId}" activiti:exclusive="true" id="_28" name="strudent"/>
    <sequenceFlow id="_29" name="reject" sourceRef="_9" targetRef="_28">
      <documentation id="_29_D_1"><![CDATA[1]]></documentation>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyState==4}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_30" name="reject" sourceRef="_13" targetRef="_28">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyState==4}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_32" sourceRef="_2" targetRef="_28"/>
    <exclusiveGateway gatewayDirection="Unspecified" id="_35" name="ExclusiveGateway3"/>
    <sequenceFlow id="_36" sourceRef="_5" targetRef="_35"/>
    <sequenceFlow id="_37" name="success" sourceRef="_35" targetRef="_17">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyState==3}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_38" name="reject" sourceRef="_35" targetRef="_28">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyState==4}]]></conditionExpression>
    </sequenceFlow>
    <exclusiveGateway gatewayDirection="Unspecified" id="_45" name="ExclusiveGateway"/>
    <sequenceFlow id="_46" sourceRef="_45" targetRef="_3">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${applyExamine==teacher}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_48" sourceRef="_45" targetRef="_4
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值