Introduction
This article explains the logic and order of running a task and a route in it.
To start a task, you need to run an incoming configuration. A task is only created when the incoming configuration is connected to a route. While running the incoming configuration the entity transformer connected to the incoming configuration is executed, followed by the entity transformers in the connected route(s). Now a task is created.
Afterward, when you run a route that holds tasks for that route, the entity transformer in the outgoing configuration is executed, following by the publisher configured. And therefore the task is performed. These entity transformers are used to map and/or manipulate the data.
If you check the box “enable real-time processing” in the incoming configuration it will run both incoming configuration and a route (but you still need to run an incoming configuration to create a task).
Stages of running a task
So, you run an incoming configuration. What happens during this process?
Run an incoming configuration:
- The input transformer is executed
- It runs the incoming configuration(i.e. HTTP subscriber URI: /get/posts?date=&{today})
- The data is mapped and/or manipulated by the entity transformer
- The entity transformer in a route is executed
- Tasks with the status “new” have been created for the connected routes.
Run a route that contains tasks with the status “new”:
- The outgoing entity transformer is executed
- It runs the outgoing configuration (i.e. HTTP Publisher URI: /create/post)
- The task now contains the status “Finished”, ”Skipped”, or “Failed”.
While you run a route, only the entity transformers within the outgoing configuration are left to be executed together with the publisher.
After this, the task changes its status to “Finished”.
You can also create an input transformer. It is executed before the actual incoming configuration. You can use it to construct dynamic data you need to pass with a request, such as today’s date.