Create Global logic to understand trigger and kick off process

Problem statement : Reading Data service table and understands component schedule and adds to queue for further processing. For example

Component X, Frequency: Daily, Trigger : 15 minutes

Component Y, Frequency: Weekly, Trigger : 8 am (Every Monday)

Component Z, Frequency: Daily, Trigger : 2 hours

Component A, Frequency: Custom, Trigger : 6 pm (Monday to Friday)

And So on.

What would be best logic to create above components triggers by dispatcher and create queue item so that performer can pick those items.

Not sure what version are you on. a you may mention that.

In the current version it is possible via Orchestrator APIs.

Below doc has everything to know about including the steps.

So you’ll have to create a robot to have the API calls made that will read schedule for processes from data service and schedule it accordingly using the API

Orchestrator API to schedule a Robot

Hope this helps!

Thanks @rahulsharma : Let me rephrase my question.

Intention is not to create/add queue item by Dispatcher bot but generalise logic to work for multiple components and create queue item which can trigger performer bot as per trigger schedules (postponed period).

Problem is to define generalise logic of triggers as few components triggers are in minutes, hours (daily) and custom based on frequency (weekly).

Triggers definition is actually business requirements which can vary based on multiple components to run.

actually, i did not mention about this. Managing queue item is different…

can you show us the combinations you are referring to?

So that we can suggest the solution specifically to that?

Of what I understand is you will have queue items created and you need the items to be triggered as per the trigger.
And that triggers are taken from data service. is this correct?

can you show us the combinations you are referring to? → refer below scenarios

So that we can suggest the solution specifically to that?

Of what I understand is you will have queue items created and you need the items to be triggered as per the trigger.
And that triggers are taken from data service. is this correct?----> That’s true. I thought to keep two fields in DS entity to define triggers (frequency : daily, weekly, custom) but confused in trigger (daily(2 hours), daily(15 minutes)or weekly(8 pm on Monday, Thursday), monthly(22nd, 7 pm) or many more scenarios.
Ideally bot should understand each triggers before creating queue item to trigger on specified timings.

If that’s only have Two columns, then may be you can read the data and split with “,” you’ll have frequency and time.

Now to map the wording with actual syntax for trigger. You can create keyword mapping, so that you can get the data ia standardized form and then proceed.

Keyword mapping can be done using a dictionary too, or a datatable. Suggest you to create the dictionary for that, you can create a sheet in config sheet and mention the mapping

Key | Value
Once per day | Daily
Everyday | Daily
Weekly |
… and so on

Hope this gives some idea to approach towards the solution

@rahulsharma : Thanks for sharing the details. How to define triggers time logic in your example. In your table, you have referred two columns only but trigger time column is not mentioned.

For example if one component needs to run in every “15 min”. Is it fine to define triggers column as “15 min” as keyword so that dispatchers reads column value (15 min) and adds queue item for performer bot for trigger in every 15 minutes.

This logic is not scalable if triggers for another components are defined as weekly for e.g. (twice a week : Mon, Fri) at 2 pm etc or some other variations of schedule.

I am fine with key, value pair (daily, weekly) but dispatcher bot should understand trigger time column to schedule.

Note : i tried exploring triggers as cron expression but there is no activity found to read cron expression in Studio and create queue item for performer bot to trigger at defined trigger (cron expression).

I mentioned that the dictionary should be used to map the text entered by business to the standard keywords, so that we can have a common keyword used to schedule a particular job.

read the trigger, check if that starts with monthly, weekly or daily. Record that
If that is monthly → you will have the date and time
If that is weekly → you will have the days and time
If that is daily, it will be having a time or timegap

so you need to have all the above condition designed using switch OR if

then as per the syntax if those respective condition, you need to have the extraction. If that is monthly, then you can split the string using “,” then use the first part as date and second part as time. Similarly for others…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.