Add a PM Block to a Process

Add PM Blocks to your Process model that provide pre-built, focused functionality, including but not limited to connecting to custom third-party services.

Overview

Add a PM Block to a Process model

Add a PM Block to Your Process Model

Permissions

Your user account or group membership must have the following permissions to add and configure a PM Block to the Process model unless your user account has the Make this user a Super Admin setting selected:

  • Processes: Edit Processes

  • Processes: View Processes

See the Process permissions or ask your Administrator for assistance.

Add a PM Block from one of the following locations in Process Modeler:

  • Object Panel: Located to the left of the Process Modeler canvas, the Object Panel contains various process model objects.

  • Object Bar: Located at the bottom of the Process Modeler canvas, the Object Bar contains pinned Process model objects for quick access.

Ensure that at least one PM Block is created and is not archived. Archived PM Blocks cannot be added to a Process model.

Follow these steps to add a PM Block from the Object panel to the Process model:

  1. Click the PM Block object from one of the following sections:

    • Pinned Objects: The PM Block object appears in the Pinned Objects section when it is pinned.

    • Object Category: The PM Block object appears in the Object Category section when it is not pinned.

  2. Click the location in the Process model to place this object. Follow these guidelines when placing this PM Block:

    • Optionally place this PM Block between two existing Process model objects already connected with a Sequence Flow element. See Place an object between two connected objects.

    • If a Pool element is in your Process model, the PM Block cannot be placed outside of the Pool element.

Add boundary events

After adding the Object Element, consider adding the following Boundary-type Process model elements to design business solutions when your best-case scenarios don't happen:

Settings

The PM Block has the following panels that contain settings:

Configuration Panel Settings

Edit the PM Block Name

Follow these steps to edit a PM Block's name:

  1. Select the PM Block from the Process model in which to configure its settings.

  2. In the Name setting, edit the selected PM Block's name and then press Enter.

Map Data from a Process to the PM Block

The inbound configuration for a PM Block object defines how data gets transferred from the process to PM Block.

Follow these steps to specify inbound configuration:

  1. Select the object in the process model.

  1. From the Property drop-down menu, select a property configured for the PM Block.

  2. In the Request Variable setting, enter the Request variable (in mustache syntax) to use to send data to PM Block.

  3. Click Save.

Map Data from the Data Source to the Request's JSON Data Model

Configure how data from the PM Block integrates with Request data.

The procedure to integrate the data source's data to the Request JSON data model is called response mapping: specifying into which Request variable to store the data source's data. The PM Block may be configured with response mapping, whereby a specified source name in the body or header of the data source response's is mapped to store that value in a specified Request variable. By relying on the PM Block's response mapping, the Process Designer only needs to select the Request variable name as mapped in the PM Block's response without knowing technical details for this mapping.

Each JSON object contains a key name that references the JSON object, and the value for that key. If the JSON object already exists in a Request's JSON data model, then the PM Block overwrites the existing JSON object value with that from the data source. If the JSON object(s) to map the data source data does not exist, then the PM Block adds the JSON data object(s) to that Request's JSON data model.

Follow these steps to specify the Request JSON data object(s) to which to map the data source's data:

  1. Select the PM Block from the Process model to map the data source's data to the Request JSON object(s).

  2. Ensure that the Configuration panel displays. If not, show it. Panels to configure this element display.

  3. In the Source setting, enter the name of the source from which to store the response. If the source is from Request data, such as from a Collection, the source name is data. data is the name of the JSON object that stores all data for each Request. However, the Source setting corresponds with how the PM Block maps the data response: by selecting a mapped Request variable from the Set to Request Variable setting below, its corresponding source name displays in the Source setting. Optionally, specify the source name as a Request variable using mustache syntax.

  4. In the Set to Request Variable setting, enter the Request variable as configured in the PM Block's response mapping in which to store the data source's response. Optionally, specify the source name as a Request variable using mustache syntax. After doing so, the Source setting displays the source's name configured for that response mapping.

  5. Click Save.

  6. Repeat Steps 4 through 6 for each Request variable to store the data source's response.

Loop Characteristics Panel Settings

Specify Characteristics to Perform Multiple Instances of the Object

Use the Loop Activity panel settings to specify how to run multiple instances of this object. The following loop modes are available:

No Loop Mode

Select the No Loop Mode option to perform this PM Block's function only once.

Follow these steps to specify characteristics to perform multiple instances of the PM Block:‌

  1. Select the PM Block from the Process model. Panels to configure this element display.

  2. Expand the Loop Activity panel. By default, the Loop Mode setting is set to No Loop Mode and the function is performed only once.

Loop

Select the Loop option to sequentially repeat this PM Block's function multiple times until an exit condition is True. This is useful when a function should be performed multiple times with the same set of data, such as, processing a credit card payment. This loop mode has the following characteristics:

  • The PM Block's function is repeated until the exit condition is True or the maximum iterations limit is reached.

  • At any given time, only one instance of the PM Block is active. The subsequent instance does not begin until the current instance completes.

  • The same exit condition evaluates at the end of each instance; however, value(s) of the Request variable(s) used in the exit condition can change during an instance resulting in the exit condition to eventually evaluate as True.

  • If any one instance of that function does not complete, workflow pauses.

  • All active instances are terminated if an interrupting boundary-type event element triggers.

Follow these steps to specify characteristics to perform multiple instances of the PM Block:‌

  1. Select the PM Block from the Process model in which to specify multiple instance characteristics. Panels to configure this element display.

  2. Expand the Loop Activity panel to display the Loop Mode Setting.

  3. In the Maximum Iterations setting, enter an integer value representing the maximum number of times this Task should be performed.

  4. In the Exit Condition setting, enter a condition in FEEL syntax. When this condition is True the loop activity is halted.

Multi-instance (Parallel)

Select the Multi-instance (Parallel) option to perform this PM Block's Task multiple times in parallel a fixed number of times. This is useful when performing any action in bulk, such as sending an email to several people. This loop mode has the following characteristics:

  • Instances of the PM Block are governed by the size of an array-type Request variable where a new instance is created for each item in this variable. For example, an array with 10 items will create 10 parallel instances of this function that each contains data from its respective array index.

  • All instances begin simultaneously when this PM Block triggers; however, they perform their function independently of each other.

  • The function as a whole completes when all instances are complete.

  • The output from each instance can either be saved in the source Request variable or a new array-type Request variable.

  • All active instances terminate if an interrupting boundary-type event element triggers.

Follow these steps to specify characteristics to perform multiple instances of the PM Block:‌

  1. Select the PM Block from the Process model in which to specify multiple instance characteristics. Panels to configure this element display.

  2. Expand the Loop Activity panel to display the Loop Mode Setting.

  3. From the Loop Mode setting, select the Multi-instance (Parallel) option. The settings for this loop mode display:

  4. In the Request Variable Array setting, enter the name of an array-type Request variable. The size of this array will determine how many times this loop iterates.

  5. In the Output Data Variable setting, enter the name of an array-type Request variable in which to store the results of all instances. Each instance of the loop saves to a separate JSON object within the array of the specified Request variable. If the Output Data Variable setting is not configured, then the output data replaces the source data in the Request Variable Array.

Multi-instance (Sequential)

Select the Multi-instance (Sequential) option to perform this PM Block's function multiple times sequentially a fixed number of times or until an exit condition is True. This is useful when sequentially repeating a function multiple times but with a different set of data each time. This loop mode has the following characteristics:

  • Instances of the function are governed by the size an array-type Request variable where a new instance is created for each item in this variable. For example, an array with 10 items will create 10 parallel instances of this function that each contains data from its respect array index.

  • At any given time, only one instance of the function is active. The subsequent instance does not begin until the current instance completes.

  • At the end of each instance an exit condition evaluates and the loop activity halts if the exit condition is True.

  • The function as a whole completes when all instances are complete.

  • The output from each instance can either be saved in the source Request variable or a new array-type Request variable.

  • All active instances terminate if an interrupting boundary-type event element triggers.

Follow these steps to specify characteristics to perform multiple instances of the PM Block:‌

  1. Select the PM Block from the Process model in which to specify multiple instance characteristics. Panels to configure this element display.

  2. Expand the Loop Activity panel to display the Loop Mode Setting.

  3. From the Loop Mode setting, select the Multi-instance (Sequential) option. The settings for this loop mode display:

  4. In the Request Variable Array setting, enter the name of an array-type Request variable. The size of this array will determine how many times this loop iterates.

  5. In the Exit Condition setting, enter a condition in FEEL syntax. When this condition is True the loop activity is halted.

  6. In the Output Data Variable setting, enter the name of an array-type Request variable in which to store the results of all instances. Each instance of the loop saves to a separate JSON object within the array of the specified Request variable. If the Output Data Variable setting is not configured, then the output data replaces the source data in the Request Variable Array.

Last updated

Logo

© 2024 ProcessMaker, Inc. All Rights Reserved. Except as otherwise permitted by ProcessMaker, this publication, or parts thereof, may not be reproduced in any form, by any method, for any purpose.