Article Directory
table of Contents
1. System design
4.1 Division of modules
Through the investigation and analysis of user needs, the functions that the system should have are determined. The required modules include: state diagram management, task management, task assignment, and task submission.
4.2 Function description
This system mainly involves state diagram management, task management, task assignment, and task submission.
State diagram management: including adding, deleting, and modifying processes. Control the process, including unconditional transfer, branch control, and merger control, or branch control, or merger control, voting merger control. View the status of the task, including sleep status, ready status, execution status, completed passed status, and completed failed status. Different task statuses are displayed in different colors.
Task management: Read the task list from the database, which includes unfinished tasks and completed tasks. The task list includes the time when the task is established, the estimated time to complete the task, the person who completes the task, and the time when the task is completed. At the same time, you can add new tasks.
Task assignment: including tasks waiting to be assigned, benchmarks for task assignment, and people to whom the task is assigned. The benchmarks of task assignment include task assignment based on department, task assignment based on team, task assignment based on role, and task assignment based on a custom method. The task assignment group includes all the personnel assigned to the task assignment, assigns the task to the personnel with the least workload in the assigned group, and assigns the earliest task created in the task queue to the individual who requested to perform the task first in the corresponding group, based on Priority number allocation.
Task submission: Submit to the system after the task is over.
4.3 Detailed design of workflow engine
According to the workflow of the workflow engine, integrating the above functional modules, the designed system module diagram is shown in Figure 5:
4.4 Design of the database structure
According to the previous module function design, the database required by the system should include "active node table", "business process table", "control node table", "task assignment rule table", "task status table", "task list", etc. , Each part exists as a table.
The specific design is as follows:
1. Active node table
Used to store active node information, the specific design is shown in Table 2:
2. Business process table
Used to store business processes, the specific design is shown in Table 3:
Two, system implementation
1 The user login module
has made a login interface to facilitate testing, and then added a form, using a tabControl control, and named tabPage1, tabPage2, tabPage3, tabPage4, and tabPage5 as: company profile, state chart management, Task management, task assignment, and task submission. Among them, state diagram management, task management, and task assignment are the core parts of the workflow engine. The main task in state diagram management is the customization of tasks, including functions such as adding, deleting, merging and branching, and you can directly view the status of tasks. The task management part is mainly to add and delete tasks, and you can view the task list at the same time. The task assignment part mainly completes the determination of the assigned benchmark and the assigned group. Below we will mainly introduce state diagram management, task management, and task assignment.
5.1 The design of state diagram management
5.1.1 Function description
This form is mainly used to customize the work process and view the task status, including adding process, deleting process, process merging, process splitting, status statistics and detailed status display.
5.1.2 Interface design
4 ComboBox controls, 6 GroupBox controls, 17 label controls, 5 Button controls, 1 DataGridView control, 1 TextBox control, and 1 panel control are used on this form. The added form is shown in Figure 8 after running:
5.1.3 Work flow and part of the code
The database connection is performed when the form is loaded, and the data is displayed in the table on the left. Enter the process name and click confirm to add. The drop-down list will automatically read the process name in the database, select a process name, click to confirm the deletion, a dialog box of "Deleting Task Process Successfully" appears, click OK to close. Move the mouse cursor to the text box of the process split, click to select the task on the left, and then confirm the split. First select the task on the left, click Add Process to List to move the task to be merged to the list, or click Delete from the list to remove the task. After moving the task to be merged to the list, click to confirm the merge. The status chart statistics and the status display below are changed according to the information in the data. Click the exit system button at the bottom to exit the system directly.
Part of the code is as follows:
5.1 Task Management Form
5.1.1 Function description
This form is mainly used to display unfinished tasks and completed tasks, as well as add and delete tasks.
5.1.2 Interface design
A DataGridView control, 2 label controls, 1 ComboBox control, 1 TextBox control, and 3 Button controls are used on this form. The added form is shown in Figure 9 after running:
5.3 Task Assignment Form
5.3.1 Function description
This form is mainly used for task assignment. First select the task to be assigned, then select the basis of assignment, and finally select the assigned group.
5.3.2 Interface Design
Use 1 DataGridView control, 1 GroupBox control, 1 panel control, 2 ComboBox control, 4 Button control, 8 RadioButton control on this form. The added form is shown in Figure 10 after running: