[The latest Activiti7 in 2023 is the most complete in the whole network] 1. Detailed introduction of Activiti7

Activiti detailed introduction
1 Introduction
  Alfresco software announced the official launch of the Activiti business process management (BPM) open source project on May 17, 2010. Its chief architect is Tom Baeyens, an expert in business process management BPM. Tom Baeyens is the original jbpm architecture Division, and jbpm is a very famous workflow engine, of course, activiti is also a workflow engine.

  Activiti is a workflow engine. Activiti can extract the complex business processes in the business system and define them using the special modeling language BPMN2.0. The business processes are executed according to the predefined processes, and the system processes are implemented by Activiti. Management, reducing the workload of business systems for system upgrading and transformation due to process changes, thereby improving the robustness of the system and reducing system development and maintenance costs.

​ Official website: https://www.activiti.org/


1.1 BPM
  BPM (Business Process Management), that is, business process management, is a standardized construction of end-to-end business processes to continuously improve organizational business efficiency. BPM is included in common business management education such as EMBA and MBA.

1.2 BPM software
  BPM software is an IT tool that promotes the integration and adjustment of business methods and solutions between people, between people and systems, and between systems according to changes in the business environment in an enterprise.

  Modeling, automation, management monitoring and optimization of the entire life cycle of the internal and external business processes of the enterprise through BPM software can reduce the cost of the enterprise and greatly increase the profit.

  BPM software is widely used in enterprises. Wherever there are business processes, BPM software can be used for management, such as enterprise personnel office management, procurement process management, official document approval process management, financial management, etc.

1.3 BPMN
  BPMN (Business Process Model AndNotation) - business process model and notation is a set of standard business process modeling notation developed by BPMI (BusinessProcess Management Initiative), using the notation provided by BPMN to create business processes.

  The BPMN1.0 specification was released in May 2004. BPMI was incorporated into the OMG (The Object Management Group) organization in September 2005. OMG released the final version of BPMN2.0 in January 2011.

The specific development history is as follows:

  BPMN is currently a BPM standard widely accepted by various BPM vendors. Activiti uses BPMN 2.0 for process modeling and process execution management. It includes many modeling symbols, such as:

Event

Represented by a circle, it's something that happens during the run of the process.


Activities are represented by rounded rectangles, and a process consists of one activity or multiple activities

The Bpmn graph actually represents the business process through xml, and the .bpmn file above is opened with a text editor:
 

<?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/test">
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="usertask1" name="创建请假单"></userTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <userTask id="usertask2" name="部门经理审核"></userTask>
    <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow>
    <userTask id="usertask3" name="人事复核"></userTask>
    <sequenceFlow id="flow3" sourceRef="usertask2" targetRef="usertask3"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow4" sourceRef="usertask3" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="130.0" y="160.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="210.0" y="150.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
        <omgdc:Bounds height="55.0" width="105.0" x="360.0" y="150.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
        <omgdc:Bounds height="55.0" width="105.0" x="510.0" y="150.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="660.0" y="160.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="165.0" y="177.0"></omgdi:waypoint>
        <omgdi:waypoint x="210.0" y="177.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="315.0" y="177.0"></omgdi:waypoint>
        <omgdi:waypoint x="360.0" y="177.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="465.0" y="177.0"></omgdi:waypoint>
        <omgdi:waypoint x="510.0" y="177.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="615.0" y="177.0"></omgdi:waypoint>
        <omgdi:waypoint x="660.0" y="177.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

2 Use step
2.1 to deploy activiti
  Activiti is a workflow engine (in fact, it is a bunch of jar package APIs), and the business system can access (operate) the interface of activiti to conveniently operate process-related data, so that the workflow environment can be integrated with the business The system environment is integrated together.

2.2 Process definition
  Use the activiti process modeling tool (activity-designer) to define the business process (.bpmn file).

  The .bpmn file is the business process definition file, which defines the business process through xml.

2.3 Process Definition Deployment
  Activiti deploys business process definitions (.bpmn files).

  Use the api provided by activiti to store the process definition content, and you can query the defined content during the execution of Activiti

  Activiti executes and stores the process definition content in the database

2.4 Start a process instance
  Process instance is also called: ProcessInstance

  Starting a process instance means starting the operation of a business process.

  After the deployment of the employee leave process definition is completed, if Zhang San wants to ask for leave, he can start a process instance, and if Li Si wants to ask for leave, he can also start a process instance, and the execution of the two processes does not affect each other.

2.5 Users query to-do tasks (Task)
  Because the business process of the system has been handed over to activiti for management, through activiti, you can query where the current process is executed, and what tasks the current user needs to handle. These activiti help us manage, not Developers need to write their own queries in SQL statements.

2.6 Users handle tasks
  After users inquire about pending tasks, they can handle a certain task. If the task is completed, other users need to handle it. For example, after the purchase order is created, it will be reviewed by the department manager. This process is also completed by activiti for us.

2.7 Process ends
  When the task is completed and there is no next task node, the process instance is completed.
 

Guess you like

Origin blog.csdn.net/wufaqidong1/article/details/129531045