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:
MAP (drop a set of variables
%result% != "Success": SEQUENCE
MAP (has a transformer)
%default: LOOP over xxx
LOOP over yyy
%var1% == %var2%: SEQUENCE
MAP (Set Found to true)
%Found% == true: EXIT '$loop'
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.
Alternatively you can use pub.flow:clearPipeline and specify the variables you want to keep for output.
In this case even those variables, which are not directly visible in the pipeline in Designer can be removed.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.