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.
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
- If the Connector Discovery wizard is running, close it by clicking
the X in the upper-right corner of the window.
- 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.)
- 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
- 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.
- In the Properties view of the request node, select the
Request tab. Click Add to open the Add Map
inputs entry wizard.
- Complete the following fields:
- Input name: Choose a unique name for the Map Inputs table, for example
HTTP_Input.
- Input location: Click Browse and select
$InputRoot/JSON/Data from the XPath Expression Builder.
- Schema location: Click Browse to open the
JSON Schema Selection wizard, select the schema that you created in step
4 and click OK.
- 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.
- Click OK to save the entries.
- Click Launch Connector Discovery to start the Connector Discovery
wizard for the discovery connector.
- 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.
- In the Connector Discovery wizard, click Map options menu and
select Enable condition filtering.The text "Filter mode" is displayed next to the Map options menu
control.
- 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.
- 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.
- From the drop-down menu in the only if: field, select
Custom.
- Delete any text from the only if: field and click
Insert a mapping.
- 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.)
- Optionally, you can populate the fields manually by typing in the required values. For
example, you can type the value mychannel in
ChannelName
- Optionally, you can edit the data that is associated with a mapping by completing the
following steps:
- Place the cursor in the input field, delete any existing text, and click
Insert a mapping to open the Available mappings table
.
- Select a mapping from the Available mappings table, for
example Map inputs / HTTP_Input / Object /ChannelName.
- In the "Retrieve channels" section, click the pencil icon to view available mappings
and edit your sample data. The table "Map inputs and sample data" is displayed.
- In the table, select the mapping ChannelName and change the
data SampleChannelName to mychannel.
The text "
mychannel" will be displayed after the field that you
selected.
- 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.