Hello,
I would suggest you not you the new820array as the “out array”. You can use the in arrray and branch into the a sequence where the ISA06 is not “ABC”, use a reg expression to filter. You would then do an appendToDocumentList to build your new820array as it should have been declared blank in a map prior to the loop. Your result will only contain a list of what you approved as valid. If you start with 7 structures and 2 had the “ABC”, your final new820array would only have 5 strutures for later processing.
[MAP] (blank) -> new820
[LOOP]{in array} <- x12
-[BRANCH] {switch} <- x12/ISA/ISA06
–[SEQ] {label} <- ABC
–[SEQ] {label} <- $default
—[appendToDocumentList] {toList} new820, {fromItem} x12 -> {toList} new820
-[BRANCH] {switch} <- new820/ISA
–[SEQ] {label} <- $null
–[SEQ] {label} <- $default
—[MAP] ## further validate
Your other approach would be to keep your top code the same and filter on non presence in your later validation. So you would have:
[LOOP]{in array} <- x12, {out array} <- new820
-[BRANCH] {switch} <- x12/ISA/ISA06
–[SEQ] {label} <- ABC
–[SEQ] {label} <- $default
—[MAP] x12/ISA -> new820/ISA
-[BRANCH] {switch} <- new820/ISA
–[SEQ] {label} <- $null
–[SEQ] {label} <- $default
—[MAP] ## further validate
You would continue down that last map then only work on the structure since you found it to exist. You can do extra splits on other parts of the structure. I still think the earlier pre filter is better to understand, manipulate and debug later.
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods