You can read the XML information as a variable. Once it's a variable, you can sort the job via connector include/exclude criteria.
- Put your XML file in a folder.
- Route the jobs from that folder through an XML Pickup.
---- Set the "Dataset name" to "My XML Dataset"
- Route the jobs from the XML Pickup into another folder
- Route the jobs from the outbound folder into two more folders
- Change these connector colors to blue, to signify they are not including "all jobs"
- Edit the first connector, changing "Include these jobs" to "define condition with variables"
- On the left side of the condition, hit the [...]
---- If you are sorting based on a number
-------- Choose Switch > Calculation > Expression > [ > ] > Define single line text with variables
-------- Choose Metadata > Text > Path > [ > ] > Build location path > click on "My XML Dataset" > click on the value > OK > Insert variable > OK
---- If you are sorting based on a text value
-------- Choose Metadata > Text > Path > [ > ] > Build location path > click on "My XML Dataset" > click on the value > OK > Insert variable > OK
- On the right side condition, select the condition that jobs will route this way if evaluates to true. For example, if your number is a Switch calculation that returns 400, and you say greater than 500 as your right side condition, this job will not route this way.
- For the other connector, set all other jobs to be included
Now your flow should be routing based on the XML value. You can tweak those conditions to make them more complex.
But a good next step is to stop right here and write that XML value to a private data value. Selecting that dataset value via build location path is a pain in the ass, and if you XML schema ever changes, you're gonna have to fix it in a lot of places in your flow. Instead, if you use a script like
switch-private-data-write to write the value to a private data key, you can reference that key within the flow. Now, you can just update it in one place and have the benefit of simply referencing the private data key, which is quicker and easier to read. If you're interested in learning more about this, I recommend you check out this page:
https://github.com/open-automation/swit ... -practices