Skip to main content

Put two routes in order

"'Artikel Cambira Austria' is to run only once 'Artikel Webshop' is through — where do I set that?"

Nowhere. Each route stands on its own: its settings concern it alone. A first A, then B — a before and an after — cannot be entered on any tab of the route editor.

What there is are two ways that come close. And a third thought that usually resolves the question.

Way 1: Stagger the schedules​

Two routes, two schedules, a gap between them: one at 02:00, the other at 03:00. "Artikel Cambira Austria" shows the form — the route carries two schedules, daily at 02:00 Incremental and on Sundays at 03:00 Full. Laid across two routes, it looks just the same. The way there is described in Run on a schedule.

The clock only guarantees the start time. A schedule starts its run as soon as its time has come, regardless of whether another run has finished. If the first takes longer than the gap, the second starts anyway, and the two run side by side.

The gap is therefore an estimate, and you should back it up: how long a run actually takes is shown by the run list — see Check whether a run went through cleanly. As the data volume grows, the runtime grows, and the gap that was enough for half a year then becomes too tight. The two runs then overlap silently.

Way 2: Build a dispatch​

There is one place where a route names another: the dispatch route. Its only task is dispatching: it receives incoming messages, looks at each one and passes it on to the route that is responsible. In the example system, "Statusmeldungen Kessler" does this: the route fetches the logistics provider's status messages and dispatches them to "Abholung Kessler", "Transport Kessler", "Zustellung Kessler" and "Fehlzustellung Kessler".

That is a real chain — first one, then the other. But it is a design of its own, with routes built for it. Two conditions show this:

  • A target route must have the data origin Dispatch input. Otherwise, the validation flags it with "Target route does not have the data origin 'Dispatch input'".
  • It must be on the same connection as the dispatch route — otherwise: "Target route is on a different connection than the dispatch route".

A route with this data origin has its data assigned to it instead of fetching it itself. Target routes are therefore built specifically for this purpose — two finished routes cannot be chained together this way after the fact. How it works is described in Pass incoming messages to the responsible route.

Usually the question is a different one​

If B is to run after A, it is almost always about B finding A's data in place. For that, a suitable trigger is enough.

In the example system, two routes export the same item master: "Artikel Webshop" to the shop, "Artikel Cambira Austria" to the second company. The first listens to events, the second runs at two o'clock at night. If Austria is to see the same state as the shop, give the second route the same trigger. Then every item change goes to both targets as soon as it is saved, and the question of the order settles itself.

The way there is described in React to a change in SAP.

See also​