Read XML files and dispatch them to different processes
Example of how to read XML files and dispatch them to other processes in Robocorp Control Room
This example shows how to create a process that's role is to trigger other processes. In our sample case, the process read XML files from a given folder, reads a value from the first element's attribute and uses that to determine the process to trigger. The example also gives the said XML file as a input work item file to the triggered process.
This example is easy to extend for example to read different types of inputs, dispatch files to several processes or to create work item payloads instead of files.
- You need processes to trigger, a minimum two in this example case. Use for example a simple work item logger robot if you don't have your own robots available yet.
- Once those processes are created in the Control Room, you'll need a Vault entry called
dispatch_demothat has the following entries:
workspace_idthe workspace ID of where the triggered processes are (use e.g. API Helper to find out the value)
process_id_1one process ID that will be triggered
process_id_2second process ID that will be triggered
apikeyAPI key that has credentials to manage processes
Variables section defines a dictionary that is mapping between "something" in your XML to the processes, which are represented by the names given in the Vault. It looks like this.
In this example case the strings
SOME_THING are found from the XML files, like below.