webMethods.io B2B - Extended Criteria in Processing Rules

1. Introduction

This article explains how to configure extended criteria based on the extracted attribute values in webmethods.io B2B.

       Why Extended Criteria?

  • If a user wants to define the criteria apart from standard criteria selection such as Sender, Receiver, Document, and User status.
  • Customer wants to use the extracted attribute from envelope or custom attributes as criteria while invoking any processing rule.

     In this article we are going to use the custom attributes in extended criteria section.

2. Pre-Requisites

3. UseCase

 In this article we are going to add extended criteria by using the two different State Values and trigger rules accordingly based on the criteria.

  • Here is the purchase order XML sample:

<?xml version="1.0"?>

<PurchaseOrder PurchaseOrderNumber="1" OrderDate="2020/04/22">

<Metadata>

<Sender>ABC</Sender>

<Receiver>ACME</Receiver>

</Metadata>

<Address Type="shipping">

<Name>ABC Corporation</Name>

<Street>ABC Street</Street>

<City>ABC City</City>

<State>Atlanta</State>

<Zip>560037</Zip>

<Country>ABC</Country>

</Address>

<DeliveryNotes>Office</DeliveryNotes>

<Items>

<Item PartNumber="1">

<ProductName>ACME</ProductName>

<Quantity>10</Quantity>

<USPrice>1000</USPrice>

<Comment>ACME</Comment>

<ShipDate>2020/04/22</ShipDate>

</Item>

</Items>

</PurchaseOrder>

3.1 Defining Extended Criteria in Processing Rule

        Navigate to Processing Rules -> Create two Rules say ‘AtlantaRule’ and ‘MichiganRule’. Click on ‘AtlantaRule’ and then click Extended criteria in the left side panel.

In the next page click on Add Extended Criteria and provide the attribute name, operator and Value.

In this case we are going to use the following values in extended criteria section, click update.

Attribute: State

Operator: Equals

Value: Atlanta

If the above criteria matches in the action invoke an integration specific to Atlanta state.

Similarly update the Rule ‘MichiganRule’ with the below extended criteria and integration specific to the state.

  Attribute: State

  Operator: Equals

  Value: Michigan

 3.2 Send XML Message over AS2 from Postman

Testing from Postman requires below features to be turned-off on the channel.

  • Use the postman collection - https://www.getpostman.com/collections/186b1096086f600b39d8 to post the XML over AS2 inbound channel. You need to configure the below on postman before posting.
    • tenantname - > webMethods.io B2B Tenant Name
    • channelid -> Channel Unique identifier
    • AS2-From -> ABC in this use case, AS2 identifier of Partner
    • AS2-To -> ACME in this use case, AS2 identifier of Enterprise
    • Message-Id -> Unique identifier for the message
    • Authorization -> Partner User

    In the body section, provide the state value as Atlanta as below.

Upon sending the message over postman you should see rule related to Atlanta will get fired and which will invoke the Atlanta integration.

You should see Rule (AtlantaRule) get fired successfully.

Send the XML message again by updating the status field in the body as Michigan. Observe that rule specific to Michigan state will get executed successfully.