Is there an effective way to prevent dropped variables in a MAP step to not affect other MAP steps in a BRANCH? I have the following:
BRANCH
%fault%: SEQUENCE
MAP (drop a set of variables
EXIT '$flow'
%result% != "Success": SEQUENCE
MAP (has a transformer)
%default: LOOP over xxx
LOOP over yyy
MAP
MAP
BRANCH
%var1% == %var2%: SEQUENCE
MAP (Set Found to true)
EXIT '$loop'
BRANCH
%Found% == true: EXIT '$loop'
MAP
In the above example if the MAP step in the %fault% SEQUENCE step drops any variables then they won’t show downstream. Is the scope global where it would affect the other MAPS and possible BRANCH conditions? Is this just a visual thing in the Designer?
I believe this is just a visual feature of Designer as it cannot know at design time all of the possible permutations.
variables that are dropped in a branch will still be available at runtime if that branch is NOT taken.
Interestingly any sequences that finish due to error will also have all locally defined variables dropped dynamically. Thus you should ensure that you define a variable outside of a sequence if you still want to be able to see it outside of the sequence where it gets assigned IF an error is triggered in the sequence somewhere after that assignment.
Makes sense. What I am trying to reduce is the amount of information showing on the pipeline going out so it doesn’t get sent to the calling service. The better option would probably move my $default above the other sequences.
General recommendation is to add a map step to the end of every service and label it “clean up”. Then drop all variables that are not explicitly defined in the output signature of your service. This will help ensure that the pipeline at runtime stays as close as possible to the design time.
regards,
John.