Use of ClearPipeline in the flow services

Hello There,

Is it a best practice to use Clear Pipeline in main flow service and also some of util services where we have a bulk of code?

Did anyone saw any issues using clearPipeline service.

Many Thanks,
Veera.

Hello,

Its always advisable to drop the variable whenever they are not used instead of using clearPipeline(). ClearPipeline destroy the existing pipeline and create a new pipeline with the preserve variables, which is not a good practice.

Regards,
Sasanka

True… Drop variables whenever they are not used… Do not wait untill the last line of code to drop unused ones…

I generally avoid clearPipeline for various reasons.

No issues with clearPipeline per se, but its use tends to encourage sloppy pipeline management. I’ve seen pipelines with so many variables that it makes support a real pain. A good FLOW coding practice is to explicitly drop vars as soon as possible.

In top-level services, it may be useful to use clearPipeline to help overcome what I call “pipeline litterbugs”. Services that don’t clean up after themselves. This can prevent the litter from getting sent back to the external caller (depending upon the details of the service). But I’d suggest doing this judiciously.

Thanks Sasanka, Senthil and Reamon for your inputs.