I recently recorded a detailed tutorial on Activiti, which is a good way to blog about Activiti.

Activiti is the most detailed series of articles on the web.

Activiti details

1 introduction

Alfresco Software announced the launch of the Activiti Open Source Business Process Management (BPM) project on May 17, 2010. The lead architect is Business process management BPM specialist Tom Baeyens, who was the architect of JBPM, JBPM is a well-known workflow engine, and Activiti is a workflow engine as well.

Activiti is a workflow engine that extracts complex business processes from a business system and defines them using BPMN2.0. Business processes are executed according to predefined processes and the system flows are managed by Activiti. Reduce the workload of system upgrading due to process changes in the business system, thus improving the robustness of the system and reducing the cost of system development and maintenance.

Official website:www.activiti.org/

1.1 BPM

BPM (Business Process Management) is a standardized way to construct 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 among people, between people and systems and between systems according to the changes of business environment in enterprises.

BPM software is used to model, automate, manage, monitor and optimize the whole life cycle of internal and external business processes of enterprises, so that enterprises can reduce costs and greatly increase profits.

BPM software is widely used in enterprises. BPM software can be used to manage all business processes, such as enterprise personnel and office management, procurement process management, document approval process management, financial management, etc.

BPMN 1.3

BPMN (BusinessProcess Model AndNotation) is a set of standard BusinessProcess modeling notation developed by BPMI (BusinessProcess Management Initiative). Business processes can be created using symbols provided by BPMN.

The BPMN1.0 specification was released in May 2004. BPMI was incorporated into 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 a BPM standard widely accepted by BPM vendors. Activiti uses BPMN 2.0 for process modeling and process execution management. It includes many modeling notations, such as:

Event

Represented by a circle, it is what happens in the process as it runs.

Activities are represented by rounded rectangles, and a process consists of one or more activitiesThe Bpmn graph is actually an XML representation of the business process, and the. Bpmn file above is opened using a text editor:


      
<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="Create leave form"></userTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <userTask id="usertask2" name="Department Manager Audit"></userTask>
    <sequenceFlow id="flow2" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow>
    <userTask id="usertask3" name="Personnel Review"></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>
Copy the code

2 Procedure

2.1 deployment activiti

Activiti is a workflow engine (essentially a bunch of JAR apis), and business systems can access Activiti’s interfaces to easily manipulate process-related data, thereby integrating workflow environments with business systems’ environments.

2.2 Process Definition

Define business processes (.bPMn files) using the Activiti process Modeling tool.

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, which can be queried during Activiti execution

Activiti execution stores the process definition content in a database

2.4 Start a process instance

ProcessInstance is also called: ProcessInstance

Starting a process instance starts the running of a business process.

After the definition of employee leave process is deployed, if John wants to ask for leave, a process instance can be started, and if John wants to ask for leave, a process instance can be started. The execution of the two processes does not affect each other.

2.5 Querying To-do Tasks (Task)

Because the business processes of the system are now managed by Activiti, activiti can query where the current process has been executed and what tasks the current user needs to handle. Activiti can help us manage these tasks without the need for developers to write in SQL statements.

2.6 User Task Handling

After the user queries the to-do list, he can handle a certain task. If the task is completed, other users need to handle it. For example, after the purchase order is created, the department manager will review it.

2.7 Process End

The process instance is completed when the task is completed and there is no next task node.

That’s all for Activiti, and the next chapter will show you how to use it. Welcome to focus on zan plus collection oh V_V