cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Pause for 10 to 15 minutes to trigger

Mahesh7225
New Contributor

In snaplogic is there any feature available while any process going on from third party , can we wait 10 -20 sec to get response, is such feature/logic is available?

Thanks
Mahesh

3 REPLIES 3

Supratim
Contributor III

@Mahesh7225 There is no in built snap available. You can use below python script to wait. But in case of 10/15mins to wait should use scheduler to trigger.

import time

Import the interface required by the Script snap.

from com.snaplogic.scripting.language import ScriptHook

class TransformScript(ScriptHook):
def init(self, input, output, error, log):
self.input = input
self.output = output
self.error = error
self.log = log

# The "execute()" method is called once when the pipeline is started
# and allowed to process its inputs or just send data to its outputs.
def execute(self):
    while self.input.hasNext():
        data = self.input.next()
        time.sleep(10)
        self.output.write(data)
    self.log.info("Finished executing the Transform script")

The Script Snap will look for a ScriptHook object in the โ€œhookโ€

variable. The snap will then call the hookโ€™s โ€œexecuteโ€ method.

hook = TransformScript(input, output, error, log)

Thanks from reply , Do you have any sample pipeline ?

Thanks
Mahesh

Hi,
Below is the sample pipeline that can be used to delay time. Right now this pipeline has delay time of 89 sec, you can change that according to your preference.sleep_2021_01_29.slp (3.7 KB)