Mass Processing Overview

Mass processing is the term use when processing grouped multiple elements in a modeled action. The default execution mode in AWM is single processing of elements.

If mass processing is not explicitly enabled in a modeled action, executing an action with multiple elements selected will result in the action running in a loop, one iteration for each element. With mass processing enabled, AWM will create a mass execution context with all the selected elements and the action is executed once only. Tools within the action are able to process all elements at once, provided they support mass processing.

The mass processing execution context is similar to a single processing execution context, except it also contains the sub-contexts, which each represents a single element or entity that is about to be processed. The mass processing execution context is always initialized with the property values of the first element selected. The sub-contexts which includes the first element are then added to the mass processing execution context. This enables tools to access both single and mass values of the context. Sub-contexts also have individual parameter memories, so it is possible to maintain element specific output parameter values for the same properties throughout a mass processing action. A mass processing context is also what causes tool descriptors to be executed in mass processing mode, if supported. This makes it possible to design complex workflow within a single action descriptor, which contain both mass and single processing, see examples below.

Note: The number of mass processing sub-contexts can be obtained by using the variable &numelements.

See Variable References for more information

Mass Processing Context

It is possible to specify whether modeled tool input parameters should be obtained from the main context (only a single value) or the sub-contexts (a set of values). This is specified by the Mass Processing attribute of modeled tool descriptor parameters. The same applies for output parameter, where the flag specifies which context the output value should be written to. If a tool is executed in single processing mode, the Mass Processing flag is simply ignored and all parameters are treated as single processing parameters.

Most of the common scenarios do not require you to fully understand the mass processing mechanics and options, as most tools supporting mass processing will be pre-defined with mass processing parameters, so setting the attribute Mass Processing in the action descriptor to true will typically be enough to enable the tool to execute on all selected elements. Understanding the differences between single and mass processing parameters is only required if you want to realize complex use cases, where the full flexibility of the concept is required.

Whether a tool descriptor supports mass processing, and to what extent, depends on the tool's implementation. This is often indicated by the Mass Processing flag of its input and output parameters. If the tool parameters are automatically created with the Mass Processing attribute set to true, the tool should support mass processing execution. Micro Focus recommends you always read the tool documentation, in your product Help, to find out if the tool supports mass processing. You can also use F1 in the model editor to open tool-specific Help.

To enable mass processing, set the Mass Processing attribute of a modeled action descriptor to true. This will result in the action being executed with an initial mass processing context. Alternatively, it is also possible to dynamically create named mass (or single) processing contexts within a tool sequence by using the Tool has Named Context complex attribute. See Relationship Action Has Tool Has Named Context for more information.

Example 1: Delete selected elements (non-mass processing):

  • Action descriptor: ACT_DeleteFileSingle (non-mass processing)
    • Tool descriptor: TOOL_UI_ConfirmDelete
    • Tool descriptor: TOOL_DeleteFile

The action is executed for every selected element, which means both the confirm dialog TOOL_UI_DeleteFile and the tool TOOL_DeleteFile, once per element. Whilst the repetition of the dialog becomes impractical, the execution of the delete action takes more time for larger selections, especially if it is a remote tool.

Example 2: Delete selected elements (mass processing):

  • Action descriptor: ACT_DeleteFileMass (mass processing)
    • Tool descriptor: TOOL_UI_ConfirmDelete
    • Tool descriptor: TOOL_FileDeleteMass

This action is executed once as the mass processing attribute is set, even if multiple elements are selected. After the first dialog tool is confirmed, all the necessary element properties are passed to the TOOL_FileDeleteMass tool which deletes all selected elements in a single call. In this case, the tool must support the processing of a group of elements.

Tools within mass processing actions can use tool-defined resource operations to update elements from the views as they process them. See Tool-defined Resource Operations for more information. A delete tool, for example, returns a REMOVE-ELEMENT: <ID properties> resource operation for every deleted element. This information is used by AWM to delete the elements from the UI.

Mass processing does not necessarily require the selection of several elements. It is also possible for tools to create a multi selection context. For example, an input dialog can be modeled as a table selection dialog, which gives you the opportunity to select several rows from a checkbox table. The properties of these rows can be used by subsequent mass processing tools by setting the Parameter From attribute of all their mass input parameters to Previous Tool.

  • Action descriptor: ACT_DeleteFilesOfFolder
    • Tool descriptor: TOOL_GetFilesOfFolder
      • Create context FILES (mass processing)
      • Input parameter PROP_FolderName
      • Output parameter PROP_FileName (mass processing)
    • Tool descriptor: TOOL_UI_ConfirmDelete
    • Tool descriptor: TOOL_DeleteFilesMass (context FILES)
      • Input parameter PROP_FileName (mass processing)

This action is executed as a single processing action on a folder. The first tool called will obtain a single folder name and return all file names contained in the folder. The modelled action is defined to create a new mass processing context named FILES from the tool output. The last tool in the sequence, TOOL_DeleteFilesMass, is called with the FILES mass processing context. This enables the tool to delete all files returned by the TOOL_GetFilesOfFolder in a single call.

If a user selects several folders before selecting the action, the action will loop over each folder.