How to determine the status of the current task in Activiti?

in activiti, for a task that has already been executed, a task that has not been executed can be judged, but there is another state, that is, the task has already been executed, but later, because it has returned to some of the previous tasks of the task because of process selection, the task may be executed again.

how to judge the status of the task?

for example, the following flowchart of asking for leave
clipboard.png
when it comes to personnel examination and approval, personnel examination and approval rejects the current application and begins to adjust the application task, so personnel examination and approval may be carried out again. How to judge the status change that has already been implemented but may still be implemented?

Mar.30,2021

takes a variable to write the node that the process passes through in the variable?
or mark each node that the process passes through directly in the database, and judge it according to the process id when it arrives at the node.


after thinking about it for a while, I found a solution to meet my own requirements, which is mainly to judge the status of the tasks that have already been performed, such as the examination and approval task. If the examination and approval task is not approved, it will be returned to the application step. So at this time, the examination and approval task has been completed once, but it may be carried out again. The idea I judge for this state is as follows:
first, all the historical activity instances (ACT_HI_ACTINS table) of the process can be obtained according to ProcessInstanceID, then traverse by time, and put the activityID into an array. If an activityId is repeated twice, the one between the two activityId is in this state, and then the part is removed from the array

.

Code

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TaskInfo {
    private String taskId;      // id

    private String assignee;    // 

    private Date completeTime;  // 
}

because the scenario in the requirement is relatively simple, the use of parallel gateways is not considered, and complex processes may need to be improved

  • How to use activiti to realize the function of randomly combining processes?

    is this function suitable for activiti workflow implementation? A company has several products, and the quality inspection process of each product is different, but the number of nodes in it is limited. for example, there are several kinds of nodes: ...

    Mar.03,2021
  • Activiti workflow related

    I encountered a problem when setting up an e-commerce website. I want to use workflow to control the flow of orders. At present, the flow of my orders is like this: 1. Create a total order 2. Create multiple production orders (the number is determine...

    Mar.15,2021
  • How does Activiti handle exceptions?

    < H2 > how to deal with the early termination of the process due to exceptions in activiti? < H2 > for example, I need to enter a variable in a usertask. If the variable is 1, then the process to usertask1,; if it is 2, then there are only two paths f...

    Mar.30,2021
  • Using activiti in java

    Hello, boss! I just got in touch with this, and then I watched the video and wrote the code. ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); deployment process definition @Test public void test2(){ get a deployment b...

    Apr.24,2022
  • How to implement activiti6.0 endorsement

    if you want to add a person 6.0, how to achieve ...

    Jun.22,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3271e-2be2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3271e-2be2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?