processTemplate Element

Top  Previous  Next

processTemplate element is used to define a group of processes and/or templates and their preconditions for execution. A process template is a callable unit that provides high level abstraction of a business case. It is  and the content of it can be changed along with the business requirements. It may contain call definitions of processes, query processes and other process templates.

  <processTemplate name="templateName">
    <accessControl />
    <callProcess />
    <callQueryProcess />
    <callTemplate />
  </processTemplate> 

A process template can be addressed by a processCommand element or by another processTemplate element.

 
Nested Elements

accessControl Element

A processTemplate may contain only one accessControl element to define the authority requirements for the execution. If this element is defined, it is evaluated only once by the first execution of the template and if insufficient authority is detected the execution is canceled with a  ProcessManaging Exception.

callProcess Element

  <callProcess name="" stepName="" if="" blockName="" recordFilter="" debugLevel="" >
    <param name="param1">value1</param>
  </callProcess>

callProcess element is used to define a process call. It must have name attribute and may have stepName, if, blockName, recordFilter and debugLevel attributes. The element may also have nested param elements.

callQueryProcess Element

  <callQueryProcess name="" stepName="" if="" blockName="" recordFilter="" 
                    outputTo="" reset="" debugLevel="" >
    <param name="param1">value1</param>
    <!--
      nested call elements defined here are called for each output record 
      generated by the query process.
      -->
  </callQueryProcess>

callQueryProcess element is used to define a query process call. It must have name attribute and may have stepName, if, blockName, recordFilter, outputTo, reset and debugLevel attributes. The element may also have nested param elements. Unlike other call definition elements, a callQueryprocess element may have nested call definition elements.

A Query Process should extend MoreMotion's org.moremotion.process.QueryProcess base class and it can be configured with callQueryProcess element in  a processTemplate configuration as a container for the other processes and templates. The processes and the templates configured with the nested call definitions are called for each output record populated by the query process.

  <callQueryProcess name="GetCustomers">
    <callQueryProcess name="GetCustomerOrders">
      <callProcess name="CreateOrderReport"/>
      <callProcess name="SendReportWithEmail"/>
    </callQueryProcess>
  </callQueryProcess>

callTemplate Element

  <callTemplate name="" stepName="" if="" blockName="" recordFilter="" reset="" >
    <param name="param1">value</param>
  </callTemplate>

callTemplate element is used to define a template call. It must have name attribute and may have stepName, if, blockName, recordFilter and reset attributes. The element may have 0 or more nested param elements.

 
Attributes

name Attribute (Accepts MScript ony for callTemplate element)

The name of the target process definition or process template element. See Addressing other configuration elements. MScript can be used in this attribute   ONLY for callTemplate element.

stepName Attribute

It can be used to assign a step name to the call definition. Step names are used to identify the call definitions during debugging. They can also be used as a completion code symbol for conditional processing.

  <callProcess name="UpdateForm.UpdateUserProfile" stepName="UpdateUserProfile" />
  <callProcess name="..." />
  <callTemplate name="/ResetUserProfile" if="__UpdateUserProfile_cc != 0" />

if Attribute

This attribute can be used to define an MScript expression as the execution precondition. If an expression is defined with this attribute, the process or the template is called only if the evaluation result of the expression is true. _maxcc, _maxlcc and other MScript symbols can be used in the expression. See Built-In Process Symbols.

  <callProcess name="ValidateForm" if="i:Validate" />
  <callProcess name="..." if="_maxcc = 0 and "/>

blockName Attribute (Accepts MScript)

The name of the ProcessBlock. If a ProcessBlock name is defined with this attribute the Process Manager will call the process or the template for each record existing in the block.

Please note that a ProcessBlock is constructed by the Process Manager out of the specially prefixed input parameters existing in the request (FormProcessBlock ) or  out of the result records populated by a query process (MemoryProcessBlock )

recordFilter Attribute

The MScript expression defined with this attribute is used as a process pre-condition for each ProcessRecord existing in the ProcessBlock. The expression is evaluated for each record and the process or the template is called for that record only if the evaluation result is true.

outputTo Attribute (Accepts MScript)

This attribute applies only to callQueryProcess element and it defines what to do with the result records returned from the query process. If a callQueryProcess has nested call definition elements, by default, they are called for each record provided by the query process and for that outputTo attribute has no effect.

This attribute can be used to output the provided records to 3 different targets.

1.To a new ProcessBlock. If a ProcessBlock with the given name already exists it is replaced.
Example: outputTo="newblock".
2.To a symbol as a XML string. Note that the XML string will not have a root tag.
Example: outputTo="v:XML".
3.To a new request ADOM. If an ADOM with the given name already exists it is replaced. Example: outputTo="ADOM:newadom"

reset Attribute (Accepts MScript)

It is used to reset the process defined in the current call definition.

See Resetting Processes.

debugLevel Attribute (Accepts MScript)

Applies to callProcess and callQueryProcess elements and defines the debug level of the process class.