Using condition filtering

Discovery connector request nodes provide a condition filtering capability, which you can use during retrieve or update actions. If you add conditions for retrieve or update actions, you can optionally use condition filtering to refine the conditions that are applied. This topic describes the additional configuration that is required when you want to use condition filtering.

Before you begin

You must install IBM® App Connect Enterprise 12.0.11.0 or later to use condition filtering.

In the IBM App Connect Enterprise Toolkit, create a message flow containing an input node and a discovery connector request node for the discovery connector that you want to use. Configure it as described in the configuration topic for your chosen connector (such as Using Slack with IBM App Connect Enterprise). For example, the following message flow contains an HTTPInput node, a Slack Request node, and an HTTPReply node.
This image shows a flow containing an HTTP Input node, a Slack Request node, and an HTTP Reply node..

About this task

This task contains instructions for using condition filtering with discovery connector request nodes in the IBM App Connect Enterprise Toolkit. The examples that are shown are based on the action Retrieve channel performed from a Slack Request node. You can see a worked example of using conditional filtering in Example: Using condition filtering with a Slack Request node.

Procedure

  1. If the Connector Discovery wizard is running, close it by clicking the X in the upper-right corner of the window.
  2. In the Properties view of the input node for your message flow, select the Basic tab. In the Path suffix for URL field, enter a value for the path suffix, for example /slack. (In this example, the input node is an HTTPInput node.)
  3. In the Properties view of the input node for your message flow, select the Input message parsing tab. In the Message domain field, select JSON : For JavaScript Object Notation messages from the drop-down menu
  4. Create a blank JSON schema as described in Creating a JSON schema file. Populate the JSON file with entries that relate to the action that you are performing in Connector Discovery. For example, slack.schema.json:
    
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "properties": {
        "ChannelName": {
          "type": "string"
        },
        "filterByChannelName": {
          "type": "boolean"
        }
      },
      "required": [
        "ChannelName",
        "filterByChannelName"
      ]
    }

    For more information about creating JSON schemas, see json-schema.org.

  5. In the Properties view of the request node, select the Request tab. Click Add to open the Add Map inputs entry wizard.
  6. Complete the following fields:
    1. Input name: Choose a unique name for the Map Inputs table, for example HTTP_Input.
    2. Input location: Click Browse and select $InputRoot/JSON/Data from the XPath Expression Builder.
    3. Schema location: Click Browse to open the JSON Schema Selection wizard, select the schema that you created in step 4 and click OK.
    4. Schema root: The location in the schema file that describes the message structure. This value is only required if the JSON schema is not at the root of the schema document.
  7. Click OK to save the entries.
  8. Click Launch Connector Discovery to start the Connector Discovery wizard for the discovery connector.
  9. If you have not clicked Add condition, click it now and then select the property that you want to filter on.
    The option Enable condition filtering becomes visible in the Map options menu.
  10. In the Connector Discovery wizard, click Map options menu and select Enable condition filtering.
    This image shows the icon for Map options menu .
    The text "Filter mode" is displayed next to the Map options menu control.
    This image shows the text Filter mode beside the Map options menu.
  11. Place the cursor in the input field, delete any existing text, and click Insert a mapping to open the Available mappings table.
    The mappings in the Available mappings table are derived from the JSON schema that you created in step 4 and referenced from the request node in step 6.
  12. In the Available mappings table, click Map inputs / HTTP_Input / Object /ChannelName

    The text SampleChannelName is displayed under the input field. (This is the data that is associated with the mapping ChannelName and it is derived from the JSON schema that you created in step 4.) The only if: field is displayed. The drop-down menu has the options True, False, and Custom.

    This image shows the selected mapping and the only if field.
  13. From the drop-down menu in the only if: field, select Custom.
  14. Delete any text from the only if: field and click Insert a mapping.
  15. In the Available mappings wizard, click Map inputs / HTTP_Input / Object /filterByChannelName .

    The text True is displayed under the only if: field. (This is the data that is associated with the mapping filterByChannelName and it is derived from the JSON schema that you created in step 4.)

  16. Optionally, you can populate the fields manually by typing in the required values. For example, you can type the value mychannel in ChannelName
  17. Optionally, you can edit the data that is associated with a mapping by completing the following steps:
    1. Place the cursor in the input field, delete any existing text, and click Insert a mapping to open the Available mappings table .
    2. Select a mapping from the Available mappings table, for example Map inputs / HTTP_Input / Object /ChannelName.
    3. In the "Retrieve channels" section, click the pencil icon to view available mappings and edit your sample data.
      This image shows the pencil icon to view available mappings and edit your sample data.
      The table "Map inputs and sample data" is displayed.
    4. In the table, select the mapping ChannelName and change the data SampleChannelName to mychannel.
      This image shows map inputs and sample data table.
      The text "mychannel" will be displayed after the field that you selected.
      This image shows map inputs and sample data table.
  18. Optionally, you can set properties that specify the maximum number of records to retrieve and the action to be taken if that limit is exceeded by clicking + or - in Maximum number of items to retrieve and selecting the radio button Throw an error or Process 10 items from the collection.

What to do next

Return to the using topic for your chosen connector (such as Using Slack with IBM App Connect Enterprise), and complete the remaining steps.

Optionally, refer to Example: Using condition filtering with a Slack Request node to see a fully worked example of using condition filtering.