The use of activiti6, or signing, countersigning, and signing

Countersign: Refers to setting multiple people at the same approval node, such as ABC three people, the three people will receive the approval at the same time, and the approval can only go to the next approval node after all agree; or sign: also called "competition", "
string Sign": refers to the same approval node set up multiple people, such as ABC three people, the three people will receive approval at the same time, as long as any one of them approves, they can go to the next approval node to sign: refers to the same approval node to set up multiple people, such
as ABC three people, the three people will receive the approval first in order, and then notify B for approval after A agrees, and so on, if any person refuses to accept, the process will end;
multi-instance built-in variable
1: nrOfInstances: total number of instances
2: nrOfActiveInstances : The number of currently active instances. For sequentially executed multi-instances, the value is always 1
3: nrOfCompletedInstances: The number of completed instances

insert image description here

Description:
Multi-instance type (Multi-instance type): There are two types, parallel (parallel) and serial (sequntial)
collection (multi-instance) Collection (Multi-instance): dynamic collection, according to the variable input
completion condition (multi -instance) Example) Completion condition (Multi-instance): task end condition, all completed by default
Element variable (multi-instance) Element variable (Multi-instance): The alias cardinality of each item after traversal
(multi-instance) Cardinality (multi-instance): Manually specify multiple instances to loop several times

1-1: The first method: or sign setting, the completion condition (multi-instance) setting ${nrOfCompletedInstances>=1}, which means that as long as any one of them approves and agrees, you can go to the next approval node, in the set (multi-instance) name is passed in as a form or a variable, the element variable user is the alias for each traversal of the collection name, and the proxy ${user} is used to obtain the element variable user, which is consistent

insert image description here
Set the corresponding node variable (note that each time you set a node, you can only set one type (otherwise the audit is abnormal). For example, if the current node has a variable set, don’t set it to directly select the person or department, the same reason)
insert image description here

1-2: The second method: or sign settings, only need to be approved by any one person to go to the next approval node

insert image description hereinsert image description here

Enter the form table: name can be multiple users, type admin1, admin2, admin3, and then process according to the business

2: Countersignature setting, only need to set the completion condition of the document to be empty by default, indicating that all approval is required before the approval can go to the next approval node

insert image description here

3: Sequential sign, set the multi-instance type to serial (sequntial), other settings are the same as countersign

insert image description here

4: Realize monitoring events

insert image description here

package org.jeecg.listener;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.JavaDelegate;

import java.io.Serializable;

/**
 * @Author xu
 * @create 2023/5/12 18
 */
public class RegistEndStatusListener implements JavaDelegate, Serializable {
    
    
    private Expression status;

    @Override
    public void execute(DelegateExecution execution) {
    
    
        System.out.println("==========");
        System.out.println("----------");

    }
}

Guess you like

Origin blog.csdn.net/qq_19891197/article/details/130700133