โ07-27-2018 01:09 PM
Contributed by @nsohal
This pipeline pattern enables or disables an existing task by using the SnapLogic Read and Update Snaps.
Source: SnapLogic Read
Target: SnapLogic Task
Snaps used: SnapLogic Read, Mapper, SnapLogic Update
enable or disable task.slp (4.1 KB)
โ10-08-2018 08:51 AM
This is very helpful. Iโm trying to build a โJob Schedulingโ system that will enable and disable tasks when they are ready to run based on another systemโs scheduling.
I have it โretryโ each task 5 times, so that if the pipeline fails it will auto retryโฆ but if it succeeds, then it will disable its own task and shouldnโt run again. Unfortunately even after the task has been disabled, the pipeline will run a second time โ so it appears that scheduling is added to a queue, and if itโs within 1-2 minutes of runningโฆ disabling a task doesnโt remove it from the queue.
Does anyone have any ideas? I thought about using the Task Execute, but thatโs being deprecated (documentation says so). I donโt want to use the pipeline execute because I donโt want them all related, because Iโll have 1 master scheduler pipeline related to every single execution.
EDIT: Maybe itโs that Iโve got the retry interval set to 3 minutes? Iโm dropping it to 5 and will see if that fixes it.
โ10-09-2018 08:32 AM
Yeah it looks like thereโs some type of pipeline run queueโฆ so if you disable a task at the end of its own pipeline, thereโs still a chance it runs again because itโs already in the queueโฆ โน๏ธ
FIX: I added a task reader snap and a filter for โ$parameters.enabled == trueโ at the start of the pipelineโฆ so if the task has been disabled it will stop execution.