I just completely changed this question.
I have a batch macro. I am trying to optimize it to work for each file as there are minor variations in the data fields present.
Here is a classic problem I confront.
The question / issue pertains to the split down from the first Select Tool.
First box - the XML parse tool parses [Field_X] and its outer_xml and filters out any records where the resulting outer_xml is null.
Second box - the XML parse tool expects there to be at least 1 record that requires the outer_xml field from the first box.
Problem, one of my files passes ZERO records from the first box to the second box killing the workflow and killing the batch macro.
I blame Congress as the split down pertains to Congressional actions (or lack thereof).
How can I work around this?
Solved! Go to Solution.
Hi @hellyars
Try adding a browse tool or any other tool after the macro. Otherwise only the first item processed will show.
@mceleaveyI just totally changed the question. I discovered that 1 of the files was not passing an xml field to parse stopping everything (and likely contributing to the batch macro not processing all the files).
@Luke_C Yes. I forgot about that strange behavior. Except, I have discovered that one of my files does throw a proper error when passing thru the macro.
Hi @hellyars ,
yes, this is a common problem. One easy fix is to create a text input with the headers expected and using a union tool to create a null row. This will allow the workflow to continue without throwing an error, as the headers will be there, but with no records.
Another more complicated method is to embed the second part of the process into another macro and pass through the record count as a control parameter. You can then use this influence a detour tool. If there are no records go right else left (or any other logic).
It's fiddly but this is a common problem.
If you can determine the record count before the macro, then you can feed this in to the first macro and simply build your detour in the existing macro.
M.
@hellyars Just checking to see if it is possible for you to share your macro. I am also currently working with XMLs and would like to grab the complete data from top to bottom.