PHP Workflow I am currently working on an approval system, but the requirement is that the administrator can customize the process settings and personnel, and the process may also be a parallel process.

  question

Buddy, the user-defined form I made, the approval process, can be customized by the administrator.
At present there is no train of thought, everyone give some advice!

I have worked on workflow just before, but I don’t quite understand what your parallelism means. Let’s take a few pictures to see if this is the case:

clipboard.png

clipboard.png

clipboard.png

Processors or processing departments in the process can be customized, and each selection will be kept in the hidden field of the page.

  1. If it is the combination of departments and personnel, the preservation form is probably like thisu:1; s:3; g:4,u:1Indicates that the user with user ID 1 is processed in the first step;s:3This means that the department with ID bit 3 will actually take out all the personnel under this department for selection when processing in the process. This is the second step. Backg:4Then the permission group is represented, and so on …
  2. When the processing flow is a single user or a single department, it is sufficient to store the ID directly.1, 2, 3So, similarly, the number of steps is arranged in sequence.

When the workflow is actually in progress, there may be functions such as approval, call back, re-processing, etc., which need to be considered.
Taking document handling as an example, we need some tables: workflow configuration table, document table and document processing table.

I have written the workflow class myself, but it may not be suitable for your scene, so I won’t post it as a disgrace.
It’s probably like this.