Design trigger

Hi All,
I want to design a robot in a such way that it will check input file after every 30 min for 4 hour if input file found then start the processing.
condition 1: if input file is found after 1 hr then robot will process it and then it will not check again input file. ie. only one input for a day

@TUSHAR_DIWASE,

This could be one of the approach:

  1. Setup a trigger to run the job every 30 minutes for the desired 4 hours of the day
  2. Create a text asset to maintain status of the file if it’s processed or not with todays timestamp in the value.
  3. Add logic at initialize part of the bot if using REFramework to check if file found and processed today or not

Here bot will be triggered but will not look for file if it found the file is already processed for today.

Adding delay and keep running the bot for 4 hours won’t be a good solution here.

Also, if the file could be placed on a SharedPoint or any online storage, you can use Integration Services to trigger the bot only when the file is placed at the location. This will be the best practice.

thansk for response.
i am also having same view . setting up cron expression for time based trigger to check input for every 30 min.

2nd approach i was thinking to use queue based trigger and use postponed property.
ex. when i/p not found , robot will add one transaction into queue with 30 min postponed and stop execution.

i guess when any fresh transaction is added to queue it added in “new” status and not in “postponed” status.
queue based trigger will work with only new status.

will 2nd approach work?

@TUSHAR_DIWASE,

I think combining 1st and second will work. Alone second approach can’t work. In case we postpone a queue item, it’s status gets changed from In Progress to New.

So better approach would be schedule a dispatcher job to check file available or not. Once the file found, add a queue item.

Set Queue trigger for Performer part which will trigger only after the queue item added.

@TUSHAR_DIWASE

2nd would work in following way

  1. Create a queue item for today …this is a one time task for the first time
  2. Now enable queue trigger
  3. and in process store the time for first run of the day in an asset…like date and time of first run…if date is same then it is already set today so no need to set again
  4. now whenever you have the process start…
  5. check if the file present if not present and if the assettime + 4 hours crossed then add new item with postponed time as needed…for tomorrow run…and then throw an exception to close the queue item for today as no file is found
  6. if file not present and if asset item + 4 hours not crossed then postpone item by 30 mins…for next run
  7. if file present then add new item with postponed time as needed again for next day and then process the item and let the item be marked as successful
  8. make sure to handle postpone scenario in set transaction status so that it does not f ail…when postponed set a flag to true and pass it to set transaction status to ignore set queue status activity

hope this helps

cheers