Process Entities

Top  Previous  Next

The Processes

A process is the smallest callable unit that wraps a certain business logic. A process class should extend MoreMotion's org.moremotion.process.Process base class and it should be defined with element process in the configuration as follows.

  <process name="CreateNewUser">
    <class>org.moremotion.mmcomp.security.SMLProcess</class>
    <sml>CreateUser('test','123','Test User','test@mycompany.com')
  </processTemplate> 

A process class does not have to deal with the parsing the user input. Without any decision making it just processes the records objects given to it.

See Process Classes

 
Process Templates

A process template configures calling of one or more processes by defining the execution order and the execution preconditions. With the call definitions in a process template one can conditionally steer the processes and build the application logic on a higher level.

Invocation of a process may depend on the completion codes of the preceding executions. For instance a mail process can be configured to be executed only if maximum completion code of the previous steps equals to 0.

  <processTemplate  name="AddNewUser">
    <callProcess name="CreateUser" if="_maxcc = 0" blockName="NewUserBlock" />
    <callProcess name="SetUserRoles" if="_maxcc = 0 and SetRoles = true" 
                                     blockName="RolesBlock" />
    <callProcess name="InformAdmin" if="_maxcc = 0" />
  </processTemplate>   

 
ProcessForm, ProcessBlock, ProcessRecord, ProcessField entities

Process Management relies on specially classified elements on the user interface side. The ProcessForm is the outer most container of all the other elements. A Process Form may contain one or more ProcessBlock elements.

PMF_Elements_Simple

A ProcessBlock contains one or more ProcessRecords and a ProcessRecord contains 0 or more ProcessFields. These entities are marked in a normal HTML document by using special element attributes as follows.

  <form method="post" action="ProcessManager.doms"
        mo:type="ProcessForm" mo:name="OrderProcessForm">
 
    <table mo:type="ProcessBlock" mo:name="ProductBlock">
 
      <xsl:for-each select="/root/products/item">
        <tr mo:type="ProcessRecord">
 
          <td align="center">
              <input name="__selection" type="checkbox" value="checked" 
                   onclick="PMgr.toggleSelection(this);" /></td>
 
          <td><input name="pf_NAME" type="hidden" value="{NAME}"
                   mo:type="EditBox" mo:field="true" mo:name="NAME" mo:iValue="{NAME}" /></td>
 
          <td><input name="pf_EMAIL" type="hidden" value="{EMAIL}"
                     mo:type="EditBox" mo:field="true" mo:name="EMAIL" mo:iValue="{EMAIL}" /></td> 
        </tr>
      </xsl:for-each>
 
    </table>
  </form> 

MoreMotion does not make use of custom HTML elements such as <jsp:EditBox /> or <jsf:Calendar /> as it is the case in JSP and JSF. The standard HTML elements are given special meanings by means of attaching them special "mo:" attributes. This technique gives the user more flexibility for customizing the user interface without compromising the provided functionality.