I have a requirement where I have two file types upload in a location. Now, 1st type of file should get processed at specific interval say (11 am - 3 pm) and 2nd type of file should get processed from (3 pm - 7 pm) interval immediately.
Is there any possibility of scheduling Listners as of agents. Please suggest any approaches how to achieve this scenario.
I need some clarification. Are those the intervals in which you want the files to be processed no matter when they are made available in the source folder or are those the intervals in which the files are made available in the source folder? Have you considered using asynchronous processing of files using an agent? Execute asynchronously (queue for Agent) option on Service File rule.
Check out Execution mode drop down on Service File rule. Select queue for agent option and configure a service requestor processor. The queue entries will be processed by ProcessServiceQueue agent in Pega-IntSvcs ruleset. There will be an agent schedule instance created for every node where this agent runs. You need to change pattern for each node's agent schedule instance from Periodic to Recurring and set the time when the agent has to run on that particular node.
I just read your original post again. Can you differentiate between files of type 1 and 2 in your service activity? If yes, why don't you create two agents of your own with different recurring patterns and conditionally invoke one or the other agent using Queue-For-Agent method in your activity?
On further inspection, the file name can be retrieved from the Log-Service-File page whose name can be configured on the file listener. So you can use this name and conditionally invoke agents as I mentioned earlier.