04-20-2021 05:34 AM
We would like to revisit a previous Snap in the Pipeline without having to create multiple branches and refer to multiple variables.
SnapLogic doesn’t seem to permit this so is there another way of achieving this in SnapLogic within the same Pipeline?
Here are the steps:
04-21-2021 05:09 AM
Hi @NAl,
You want to do something like while loop, but SnapLogic as I know is not supporting any type of loop.
SnapLogic is stateless platform. That means when some snap is executed you can’t go back again and execute it.
One solution to do loop is to create another one pipeline like this and at the end with ForEach snap call them each other.
To work as loop you will need to select in Execution Mode this FIRE_AND_FORGET.
With this FIRE_AND_FORGET it will execute the pipeline what we are calling and it will not wait for response.
If it’s not selected this FIRE_AND_FORGET it will work the same way as Pipeline Execute snap
and because it will wait for response of the called pipeline the instances will never be closed.
This is not best solution because:
04-21-2021 05:19 AM
@viktor_n is correct that SnapLogic is a streaming platform so there is no concept of looping logic. This is a shift in thought for many developers coming from a programming background.
Note that ForEach is a deprecated snap and is not guaranteed to be supported in the future. Instead use a Pipeline Execute snap to call a child pipeline.
My design recommendation is to create a child pipeline to get the SF record. In the child, you can do the lookup and either return the value, or perform the create record, then lookup again (if necessary) and return the record to the calling pipeline. Now it won’t matter if the record originally existed or not, the child takes care of it so the parent doesn’t have to know the difference.
04-29-2021 10:17 AM
One of the ways that you can use pipeline execute and not wait for the child to finish is in the child, have a Mapper Snap which is un-connected output, in which you map the pipepipe.ruuid to an output value. This will execute once the pipeline is started, and return to the parent the runtime id (which can be used to query for status if desired), This has the same effect as using Fire and Forget of the ForEach Snap.