Which module route applies
Lesson 5 of 25 7 min read
The three precedence rules that decide between competing module routes, and how module groups let one route serve many integration types.
An integration type can have several module routes that could match the same message: one for all organisations, one for a single customer, one inherited from a group. This lesson teaches you the rules the service uses to pick one, so that you can predict the result before you open the Preview.
Config-driven integration types
This lesson doesn't apply to config-driven integration types. Published maps and profiles choose the work for those types, so they need no module routes.
What a module route is made of
A module route is a rule for one combination of:
- an integration type, or a module group the type belongs to;
- a message type;
- a document type, or Any document;
- all organisations, or one organisation.
It names one module, and it can be enabled or disabled.
The three precedence rules
When more than one route matches a message, the service applies these rules, in this order:
- A route for one organisation applies before a route for all organisations.
- A route for one document type applies before a route for any document.
- A route for the integration type applies before a route for its module group.
The service ignores a route that is disabled.
Worked example
The Acme SFTP integration type is in the module group FTP send for the Send message type. These Send routes exist:
| # | Source | Document type | Organisations | Module | Enabled |
|---|---|---|---|---|---|
| 1 | Group: FTP send | Any document | All organisations | ftp-send | On |
| 2 | This type | Any document | All organisations | acme-sftp-send | On |
| 3 | This type | Any document | Hilltop Coffee | acme-sftp-send-legacy | On |
| 4 | This type | Any document | Riverside Bakery | acme-sftp-send-legacy | Off |
(The module keys are fictional.)
A Send message for Hilltop Coffee. Route 3 is for Hilltop Coffee, so rule 1 picks it over routes 1 and 2. acme-sftp-send-legacy runs.
A Send message for Riverside Bakery. Route 4 is for Riverside Bakery, but it's off, so the service ignores it. That leaves routes 1 and 2, both for all organisations and any document. Rule 3 picks the type's own route over the group's. acme-sftp-send runs.
A Send message for any other organisation. Same as Riverside Bakery: route 2 beats the group route 1. acme-sftp-send runs.
So in this example the group route never runs. On the Modules tab it would show as Overridden. You'll meet that label in the Module configuration module.
Tip
Before you add a route, write down the competing routes as in the table above and walk the three rules. It takes a minute and prevents surprises. Then confirm with Preview on the Modules tab.
Module groups
A module group lets one module route apply to many integration types. For example, the group FTP send can give the same Send module to all SFTP integration types, so you set the route once rather than on every type.
Two rules shape how groups work:
- A group is for one message type only.
- An integration type can be in only one group for each message type.
Because of rule 3, a type's own route always beats its group's route for the same message, document type and organisations. That gives you a clean pattern: set the common case once on the group, and override on the one type that is different.
Recap
- Precedence: one organisation beats all organisations, one document type beats any document, the type beats its group.
- Disabled routes are ignored.
- A module group shares routes for one message type across many integration types.
- A type can be in only one group per message type.
- None of this applies to config-driven types.
Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.