Activiti工作流使用之新建bpmn文件

Activiti工作流使用之新建bpmn文件

一、bpmn文件介绍

业务流程建模与标注(Business Process Model and Notation,BPMN) ,描述流程的基本符号,包括这些图元如何组合成一个业务流程图(Business Process Diagram)

idea画出流程,有两个文件bpmn文件和png文件,其中bpmn文件又可以叫做流程定义文件,它需要遵循BPMN语言规范.png:就是一个单纯的图片,没有任何作用.

二、流程绘制
2.1 使用activiti-app绘制流程

流程实例:积分审批流程

在这里插入图片描述

2.2 流程节点指定代理人

每一个流程节点需要指定一个代理人,即流程执行到某个任务,需要有指定的用户来进行审批

在这里插入图片描述

点击任务节点,选择代理人

在这里插入图片描述

指定代理人的方式一共有三种:

  • 1、固定代理人

    在这里插入图片描述

  • 2、使用url表达式动态设置代理人

    在这里插入图片描述

  • 3、使用监听器动态设置代理人

    在这里插入图片描述

在这里插入图片描述

2.3 除了代理人,节点还可以设置其他类型节点审核

在这里插入图片描述

后续文章进行讲解

三、流程保存与导出

保存:

在这里插入图片描述

导出:

在这里插入图片描述

四、流程bpmn文件
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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"
            typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
            targetNamespace="http://www.activiti.org/processdef">
<process id="pointsRequestProcesses" name="积分审批流程" isExecutable="true">
   <startEvent id="startEventPoint" name="开始" />
   <userTask id="userTaskPointsRequest" name="积分申请" activiti:assignee="${applicantUser}" activiti:exclusive="true">
     <outgoing>Flow_0z08cw6</outgoing>
   </userTask>
   <userTask id="userTaskCompanyApproval" name="省公司审批" activiti:candidateUsers="${reviewerUser}" activiti:exclusive="true">
     <incoming>Flow_0z08cw6</incoming>
   </userTask>
   <exclusiveGateway id="exclusivegateway02" name="省公司审批exclusivegateway02" />
   <endEvent id="endEventPoint" />
   <sequenceFlow id="flow1" sourceRef="startEventPoint" targetRef="userTaskPointsRequest" />
   <sequenceFlow id="flow4" sourceRef="userTaskCompanyApproval" targetRef="exclusivegateway02" />
   <sequenceFlow id="flowrightexclusivegateway2" name="省公司审批通过" sourceRef="exclusivegateway02" targetRef="endEventPoint">
     <extensionElements>
       <activiti:executionListener class="com.awifi.capacity.project.manager.activiti.provider.listener.MyTaskListener" event="take" />
     </extensionElements>
     <conditionExpression xsi:type="tFormalExpression">
                    ${isOk == true}
               </conditionExpression>
   </sequenceFlow>
   <sequenceFlow id="flowleftexclusivegateway2" name="省公司审批未通过" sourceRef="exclusivegateway02" targetRef="userTaskPointsRequest">
     <extensionElements>
       <activiti:executionListener class="com.awifi.capacity.project.manager.activiti.provider.listener.MyTaskListener" event="take" />
     </extensionElements>
     <conditionExpression xsi:type="tFormalExpression">
                    ${isOk == false}
               </conditionExpression>
   </sequenceFlow>
   <sequenceFlow id="Flow_0z08cw6" sourceRef="userTaskPointsRequest" targetRef="userTaskCompanyApproval" />
 </process>
 <bpmndi:BPMNDiagram id="BPMNDiagram_pointsRequest">
   <bpmndi:BPMNPlane id="BPMNPlane_pointsRequest" bpmnElement="pointsRequestProcesses">
     <bpmndi:BPMNEdge id="BPMNEdge_flowleftexclusivegateway2" bpmnElement="flowleftexclusivegateway2">
       <omgdi:waypoint x="769.402004454343" y="69.40200445434299" />
       <omgdi:waypoint x="383.75" y="162.88046485888214" />
       <bpmndi:BPMNLabel>
         <omgdc:Bounds x="533" y="91" width="88" height="14" />
       </bpmndi:BPMNLabel>
     </bpmndi:BPMNEdge>
     <bpmndi:BPMNEdge id="BPMNEdge_flowrightexclusivegateway2" bpmnElement="flowrightexclusivegateway2">
       <omgdi:waypoint x="798.9766063630692" y="71.02339363693075" />
       <omgdi:waypoint x="1056.795793598862" y="176.69071224016682" />
       <bpmndi:BPMNLabel>
         <omgdc:Bounds x="889" y="99" width="77" height="14" />
       </bpmndi:BPMNLabel>
     </bpmndi:BPMNEdge>
     <bpmndi:BPMNEdge id="BPMNEdge_flow4" bpmnElement="flow4">
       <omgdi:waypoint x="785" y="135" />
       <omgdi:waypoint x="785" y="85" />
     </bpmndi:BPMNEdge>
     <bpmndi:BPMNEdge id="BPMNEdge_flow1" bpmnElement="flow1">
       <omgdi:waypoint x="189.99732231181528" y="177.7165860350523" />
       <omgdi:waypoint x="283.75" y="175.9448818897638" />
     </bpmndi:BPMNEdge>
     <bpmndi:BPMNEdge id="Flow_0z08cw6_di" bpmnElement="Flow_0z08cw6">
       <omgdi:waypoint x="384" y="175" />
       <omgdi:waypoint x="735" y="175" />
     </bpmndi:BPMNEdge>
     <bpmndi:BPMNShape id="BPMNShape_startEvent1" bpmnElement="startEventPoint">
       <omgdc:Bounds x="160" y="163" width="30" height="30" />
       <bpmndi:BPMNLabel>
         <omgdc:Bounds x="164" y="193" width="22" height="14" />
       </bpmndi:BPMNLabel>
     </bpmndi:BPMNShape>
     <bpmndi:BPMNShape id="BPMNShape_userTask1" bpmnElement="userTaskPointsRequest">
       <omgdc:Bounds x="284" y="135" width="100" height="80" />
     </bpmndi:BPMNShape>
     <bpmndi:BPMNShape id="BPMNShape_userTask3" bpmnElement="userTaskCompanyApproval">
       <omgdc:Bounds x="735" y="135" width="100" height="80" />
     </bpmndi:BPMNShape>
     <bpmndi:BPMNShape id="BPMNShape_exclusivegateway02" bpmnElement="exclusivegateway02" isMarkerVisible="true">
       <omgdc:Bounds x="765" y="45" width="40" height="40" />
       <bpmndi:BPMNLabel>
         <omgdc:Bounds x="742" y="85" width="86" height="27" />
       </bpmndi:BPMNLabel>
     </bpmndi:BPMNShape>
     <bpmndi:BPMNShape id="BPMNShape_sid-5477B73E-9754-4A01-B13D-B6B61CC509E0" bpmnElement="endEventPoint">
       <omgdc:Bounds x="1056" y="168" width="28" height="28" />
     </bpmndi:BPMNShape>
   </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</definitions>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Activiti 是一个流行的开源工作流引擎,用于管理和执行各种业务流程。它提供了丰富的功能和易于使用的接口,使开发人员可以快速构建和部署工作流应用。 Activiti 工作流使用手册是一个详细的指南,帮助用户了解 Activiti 的各个方面并学会使用它来设计和执行工作流。手册通常包括以下内容: 1. Activiti 的基本概念和架构:手册会介绍 Activiti 的核心概念,例如流程定义、流程实例、任务和执行等。它还会解释 Activiti 的组件和模块如何协同工作,以及其在整个工作流执行过程中的角色和责任。 2. Activiti 的安装和配置:手册会提供指导,说明如何安装和配置 Activiti 引擎。这包括数据库设置、环境变量配置和相关依赖的安装等。 3. 工作流设计和建模:手册会详细讲解如何使用 Activiti Designer 工具来设计和建模工作流。它会介绍如何创建流程定义、绘制流程图、定义任务和网关等。 4. 工作流执行和管理:手册会说明如何部署和执行工作流定义,包括启动流程实例、处理任务、查看流程状态和历史记录等操作。它还会介绍如何管理流程定义和部署信息,以及如何监控和优化工作流性能。 5. Activiti API 和扩展:手册会介绍 Activiti API 和相关库的使用方法,以及如何通过扩展和自定义来满足特定需求。 通过 Activiti 工作流使用手册,用户可以系统地学习和掌握 Activiti工作流管理功能。手册提供了详细的说明和示例,使用户能够快速上手并构建复杂的工作流应用。无论是初学者还是有经验的开发人员,都可以从手册中获得对 Activiti 工作流引擎的深入了解和应用。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值