Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This pipeline will loop it's the execution looking for a match to a clause with the final, this looping includes the process and the post process, and it will exit the loop on a match or if it reaches the maximum iterations (by default 2). If it exits because of the maximum iteration, and it has a default response configured, it will merge the default response into the final (this could overwrite repeated keys in the final) 

Properties

PropertyDescriptionDefaultTypeRequired
enableEnable pipeline configuration for execution.truebooleanNo
stagesList of stages to be executed by the pipeline.
listYes
max_iterationsMaximum number of iterations the pipeline can perform.2integerNo
default_responseIn case the maximum iterations are reached, the value to merge with the final response.nullobject or nullNo
exit_field_conditionField of the final response where values will be checked; a JMESPath expression for path formats.
stringYes
match_any_valuesIf any value in this list is in the field, the pipeline will exit the loop.nullarray or nullNo
match_all_valuesIf all the values in this list are in the field, the pipeline will exit the loop.nullarray or nullNo
match_none_of_valuesIf none of the values in this list are in the field, the pipeline will exit the loop.nullarray or nullNo

Example Usage

Code Block
languagepy
themeDJango
PIPELINE = PipelineLoop(
    enable=True,
    stages=[self.stage1, self.stage2],
    max_iterations=3,
    exit_field_condition='prime.a',
    match_any_value=[1],
    match_none_value=[5], 
    match_any_value=[2, 3], 
    default_response={'prime': {'a': 0, 'msg': 'Default message overriding part of the original'}}
)