Process Classes |
![]() ![]() ![]() |
Process classes are business logic wrappers of the MoreMotion Process Management Framework. They are defined with process element in the configuration and called with callProcess and callQueryProcess elements from within processTemplate element. The inputs of a process class are the process configuration and the records of the process block that it is associated. A process class has no idea where the process records that it should process are coming from (whether from an HTML form or from its parent process) and how the changes that it causes are represented in the next page. The only responsibility of a process is to process the records given to it. A process does not have to deal with parameter parsing or decision making because by design that is the responsibility of the process manager. The role of the MScript is outstanding in making the life of a process simpler. A developer can configure a process in many different ways according to the applications needs. Once the control of the execution is taken by the Process Manager it evaluates the preconditions and the record filters and calls the process classes as configured in the configuration. The Base Classes An process class should extend either org.moremotion.process.Process base class or org.moremotion.process.QueryProcess base class. The Process base class has three abstract methods to implement, which are: prepare(), processRecord() and finalizeProcess(). The Query Process base class enforces the extender class to implement two more abstract methods which are getFieldNames() and getNextResultRecord().
An example of extending base class "Process"
The classes that extend org.moremotion.process.QueryProcess base class implement additional interface methods and generate 0 or more output records for each process record given to them. It is configurable what to do with the records generated by a query process. See callQueryProcess configuration element. An example of extending base class "QueryProcess" The content of process block "fileNames":
Assume that on the user interface the process block "fileNames" contains the above records. The process field "FILE_NAME" in each record contains the file to read. The user selects the first and the third record and submits the request to execute the process template "T1".
The process configuration:
|