Use Rules for multiple Trading Partners

Before you start: This document assumes you are already familiar with Orderful’s Rules Engine. If you are not familiar with the Rules Engine, please read this document first: Use the Rules Engine


If you have more than one Trading Partner, it is almost inevitable that you will also have multiple Guidelines that must be followed for each Trading Partner. It is your decision whether to enforce these differing Guidelines in your integration software or within Orderful using our Rules Engine. If you would like to send out one payload and have Orderful modify the payload so that it fulfills the requirements of different Trading Partners, then this document is for you.

If you are looking to minimize the amount of work you need to do in your integration software, you will likely decide to create one “master payload” that will contain all the data for your different Trading Partners. You can then use Orderful’s Rules Engine to modify the document so that it fulfills an individual Trading Partner’s Guidelines.

To see the structure of this “master payload”, you can use our Integration Assistance: Select the Transaction Type, Direction, and Data Format, then select all of the Trading Partners that you would like to include.

Example Use Case

In this example, you have two Trading Partners with two different Guidelines regarding the “referenceIdentificationQualifier” field in a document.

  • Trading Partner 1: Only accepts VN (“Vendor Number”) and DP (“Department”). They do not accept any other values for referenceIdentificationQualifier.
  • Trading Partner 2: Also accepts Vendor Numbers, but instead of VN uses the code IA (“Internal Vendor Number)”. They also accept CO (“Customer Order”). They do not accept any other values for referenceIdentificationQualifier.

If you are sending a master payload, you will be sending the "Vendor Number", "Department", and "Customer Order" values all in one payload. This means you will need two different Conditional Rules, one for Trading Partner 1, and two for Trading Partner 2:

  • Trading Partner 1, Rule 1, Condition 1: If referenceIdentificationQualifier has a value other than VN or DP then remove that value.
  • Trading Partner 2, Rule 1, Condition 1: If referenceIdentificationQualifier has a value of VN, change it to IA.
  • Trading Partner 2, Rule 1, Condition 2: If referenceIdentificationQualifier has a value that is anything other than VN or CO, then remove that value.

Each Rule will also need a corresponding Rule that removes the referenceIdentification associated with that referenceIdentificationQualifier.

Trading Partner 1

Here we need a Conditional Rule that says if referenceIdentificationQualifier has a value other than VN or DP then remove that value.

And a corresponding Conditional Rule for the referenceIdentification:

Here we can see that though all three values were sent, the one we don’t want (CO) has been removed:

Trading Partner 2

First we need a Conditional Rule to change VN to IA.

This Rule states that if the value of referenceIdentificationQualifier is VN, to change it to IA.

Next, as an additional condition, if the value is anything other than VN or CO, remove it.

And a corresponding Rule to remove the value of referenceIdentification:

Here we can see that though all three values were sent, VN has been changed to IA, and the DP value has been removed: