The main process, sub-process and timer all belong to the control container. And each control container contains one or more modules; Define specific jobs in modules.
Relationships among main processes, sub-processes, timers, and modules
Main process, sub-process, timer, module expression in resource tree:
-
Control container: it is the largest organizational unit of a job and an independent and complete scheduling control subject. In practice, each control container also acts as a program, with a corresponding process on the server. Therefore, each control container has a separate start-stop (activation) operation in Monitor.
-
Module: In TASKCTL, job definition information for processes and timers is organized in XML format code, which is stored in each module file. At the same time, to facilitate management, a process or timer can also be composed of multiple module code information. Second, like a program. Each program has an entry main function class, and the TASKCTL process also has a main module entry.
-
Processes versus timers: Processes and timers are different control containers with a distinct conceptual distinction. The process organizes the job in an orderly way, while the timer is out of order, and there is no relationship between the jobs. TASKCTL forms a relatively complete controller system through the two organizational forms of order and disorder.
-
Main process and sub-process: from the technical point of view, the main process is equivalent to a daemon process, once run, unless artificial or abnormal exit, it will live in memory, its process is an infinite loop, from the start to the end, and again cycle; A subprocess, as opposed to a normal program, will exit automatically after it finishes running.
The main uses and application scenarios of the main flow, sub-flow, and timer
-
In general, jobs with sequential logical relationships are organized by processes, while discrete jobs without logical relationships (only jobs with different time frequencies) are organized by timers.
-
Sub-process, mainly for the organization of business logic job flow; The main process, typically used for logical trigger control, is used to trigger the invocation of subprocesses
Use several examples to deepen the understanding of the main uses and application scenarios of the main flow, sub-flow and timer
Discrete call processing timer
Business subprocess
Use subprocesses to organize specific business processes
Trigger control main flow
The main flow is mainly used for triggering control of the flow. In this case, the file reaches triggering control
In fact, if the triggering control of business sub-processes is simple and timed, timers are recommended. However, if it is some complicated process trigger control, the main process is used to trigger control.
A complex main process trigger control example
The corresponding code
This example runs the call to “my business process” at [8,10,16] points every week [1,3,4].