Schedule Listener

In this section:

Reference:

Scheduling provides a way to automatically start a process at a predefined interval or time.

The Schedule listener automates routine tasks and database maintenance so they occur without manual intervention. It automatically calls an iWay-supplied agent or a user coded custom agent at a predefined interval. The custom agent then executes the required business logic.


Top of page

x
Schedule Listener Properties

The following table lists and describes the Schedule listener properties. For instructions on creating a listener, see Configuring Listeners.

Property Name

Property Description

Execution Interval (required)

Frequency in seconds that the agent is triggered. (This is a standard duration expression.)

Pass Document

Name of the XML document to pass. If omitted, <clock/> is passed.

Time Zone

Time zone to use.

Start Time

Time when the document can first be sent (hh:mm:ss, using a 24-hour clock).

End Time

Time when the document can no longer be sent.

Monday through Sunday

Indicate the days on which the schedule is active.

Send Document on Start

Select whether to send the document when the listener starts or wait until the next interval.

Accepts non-XML (flat only)

Select this option if you expect non-XML input. XML input can still be passed to the listener if the setting is enabled.

Multithreading

Indicates the number of worker threads. (Equivalent to the number of requests that iWay Service Manager can handle in parallel.) Setting this to a value greater than 1 enables the listener to handle a second request while an earlier request is still being processed. The total throughput of a system can depend on the number of threads operating.

Default: 1

Max value: 99

Listener is Transaction Manager

If true, agents run within a local transaction managed by the listener. This property is set to false by default.

Execution Time Limit

Maximum time it takes to complete a request. Prevents runaway requests. iWay Service Manager attempts to terminate a request that takes longer to complete.

Record in Activity Log(s)

If set to true, activity on this channel will be recorded in the activity logs. If set to false, the activity will not be recorded.


Top of page

x
Reference: Schedule Listener Special Registers

The following table lists and describes the special registers (SREGs) available on the Schedule listener.

Name

Source

Level

Type

Description

iwayconfig

Listener

System

String

Current active configuration name

name

Listener

System

String

Assigned name of the master (listener)

protocol

Listener

System

String

Protocol on which this message was received

tid

Listener

Document

String

Unique transaction ID.


Top of page

x
Daily Scheduler Activation

The Schedule listener can activate every 24 hours.

The Schedule listener works by checking to see if the current day is not active (set to true). If it is not active then it will go back to sleep for a set amount of seconds known as the Execution Interval.

If Start Time is less than current time or current time is greater than End Time, it returns to sleep for the amount of time (seconds) specified for the Execution Interval parameter.

Note: Because the listener has an Execution Interval of 50 minutes and the time that the listener starts has to be considered, there is a window of 9 minutes 59 seconds (between 01:50:00 and 01:59:59) where the Schedule listener could execute twice.

The current Schedule listener can activate every 24 hours. However, that 24 hours will start right after the Schedule listener is started. If the user is looking to have the listener activate at the same time each day, then the Schedule listener, along with the process flow, needs to be developed. The Schedule listener is configured to activate along a set period of time, depending on how it was configured. The process flow would then check the time of day against the time of day configured in a special register. If the current time of day is greater or equal to the special register value, then a channel start can be executed.

The time that the listener activates is dependent on the time it was started. So if the listener was started at 12:01 am on a Monday, the Monday flag is checked to see if the listener can start. If Monday is set, the listener starts processing. When the processing completes, the listener then goes to sleep for however many seconds it is set to (84400 seconds if a day delay is wanted). The Schedule listener then activates on Tuesday at 12:01 am. It checks the Tuesday flag and does not start if Tuesday is not set. The whole process repeats for the rest of the days of the week, but only at 12:01 am on those days.

Note: If iWay Service Manager is being stopped and restarted between 01:50:00 and 02:50:00 and the Send Document on Start parameter is set to false, then the listener will wait 50 minutes and miss the window that the user has set.


iWay Software