• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

ToiSchedulerService

Class Summary

Extends:
  • ToiEventTarget
See also:
  • ToiSchedulerObserver

The Scheduler Service handles scheduling and conflict management of resources. A configuration file defines the possible activities and how many resources each activity consume. The application refers to these activities by name when a new booking is created to make it possible for the service to ensure there are no resource conflicts.

Resource management is naive, in that it only indicates potential conflicts. The application layer may still over-use the underlying resources in a way that creates a conflict, e.g. by starting more recordings than the network bandwidth, demuxing hardware or disk bandwidth can handle. It is up to the applications to actually indicate all resource usage by doing bookings and resolving the resulting conflicts.

Service:

This is a service and can be accessed through toi.schedulerService
  • Methods
  • Members
  • Types
  • Events
  • Constants

Method Summary

addTrigger ( id , delta )

Add triggers to a booking.

addTriggerOnBookings ( ids , delta )

Add triggers to a number of bookings. If such a trigger is already define for a booking, no new trigger will be added.

getBooking ( id )  → booking

Get information about a booking.

getBookingIds ( categoryExpression , start , stop )  → Array.<ToiSchedulerService.ToiBookingId>

Get the bookings during start and stop time, with the same category.

getBookingIdsForSeries ( seriesId )  → Array.<ToiSchedulerService.ToiBookingId>

Get the bookings associated with a series.

getConflicts ( id , category , activity , start , duration )  → Array.<ToiSchedulerService.ToiSolution>

Detect conflicts without actually creating a booking.

getNextStartTime ( categoryExpression )  → nextStart

Get the expected starting time for next scheduled booking with matching category.

getParameter ( id , name )  → value

Get user defined parameters associated with a booking.

getParameterNames ( id )  → Array.<string>

Get all user defined parameters names of a booking

getSeries ( id )  → series

Get the info of the series with a certain series identifier

getSeriesConflicts ( id , category , activity , start , duration , weekdays , occurrence )  → Array.<ToiSchedulerService.ToiSolution>

Detect conflicts for a new series booking or a series booking about to be rescheduled, but without actually booking any activities.

getSeriesIds ( categoryExpression )  → Array.<ToiSchedulerService.ToiSeriesId>

Get the all series identifiers with the given category.

getSeriesParameter ( id , name )  → value

Get user defined parameters associated with a series.

getSeriesParameterNames ( id )  → Array.<string>

Get all user defined parameters names associated with a series.

getTriggers ( id )  → Array.<ToiSchedulerService.ToiDelta>

Get triggers associated with a booking.

remove ( id )

Remove a booking.

removeSeries ( id )

Remove a booked recurrent scheduling.

removeTrigger ( id , delta )

Remove trigger from a booking.

removeTriggerOnBookings ( ids , delta )

Remove triggers from a number of bookings. If there is no trigger with the specified delta - nothing will be changed for that booking.

reschedule ( id , category , activity , start , duration )

Requests changing and rescheduling of a booking.

schedule ( category , activity , start , duration )  → id

Requests scheduling of a new booking.

scheduleSeries ( category , activity , start , duration , weekdays , numberOfOccurrences , conflictStrategy )  → id

Requests scheduling of a recurrent booking.

setCategorySubscription ( eventListener , categoryExpression )

This method is used to filter which categories the application is notified about.

setParameter ( id , name , value )

Add user defined parameters to a booking.

setParametersOnBookings ( ids , names , values )

Add user defined parameters to a set of bookings.

setSeriesParameter ( id , name , value )

Add user defined parameters to a scheduled series.

unsetParameter ( id , name )

Remove user defined parameters from a booking.

unsetSeriesParameter ( id , name )

Remove user defined parameters from a scheduled series.

Inherited Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Type Definitions

ToiBookingId (Type: number)

Identifier for scheduler bookings.

  • BOOKING_ID_NONE
ToiConflictStrategy (Type: enum)

Conflict handling strategy to apply when trying to schedule a series that results in conflicts with previous bookings.

  • CONFLICT_STRATEGY_FAIL
  • CONFLICT_STRATEGY_SKIP_BOOKINGS
ToiDelta (Type: number)

Type representing time in seconds since start point of a certain booking. It might be negative to indicate a start point in the past.

ToiSeriesId (Type: number)

Identifier for a series of bookings.

  • SERIES_ID_NONE
ToiSolutionType (Type: enum)

Conflict solution type. ToiSchedulerService.SOLUTION_TYPE_NONE means there is no solution and the booking is impossible. ToiSchedulerService.SOLUTION_TYPE_REMOVE means one or more solutions exist.

  • SOLUTION_TYPE_NONE
  • SOLUTION_TYPE_REMOVE
ToiTime (Type: number)

Type representing time in seconds since the Unix epoch (1970-01-01 00:00:00).

  • TIME_NOW
ToiWeekdayMask (Type: number)

Type representing weekday masks. This is a bitwise OR between weekday constants.

Events

  • ON_BOOKINGS_ADDED
  • ON_BOOKINGS_CHANGED
  • ON_BOOKINGS_REMOVED
  • ON_SCHEDULED_DISCONTINUITY
  • ON_SCHEDULED_START
  • ON_SCHEDULED_STOP
  • ON_SCHEDULED_TRIGGER
  • ON_SERIES_CHANGED

Constants

  • WEEKDAY_ALL_WEEKDAYS
  • WEEKDAY_FRIDAY
  • WEEKDAY_MONDAY
  • WEEKDAY_SATURDAY
  • WEEKDAY_SUNDAY
  • WEEKDAY_THURSDAY
  • WEEKDAY_TUESDAY
  • WEEKDAY_WEDNESDAY

Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Inherited From:

  • ToiEventTarget#addEventListener

Parameters:

Name Type Description
type number

The event type of the event to subscribe to.

listener ToiEventListener

The JavaScript function that will receive events.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.

addTrigger ( id , delta )

Add triggers to a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

delta ToiSchedulerService.ToiDelta

The delta time in seconds since start point of an booking, may be negative to trigger a callback before the booking shall occur.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

addTriggerOnBookings ( ids , delta )

Add triggers to a number of bookings. If such a trigger is already define for a booking, no new trigger will be added.

Parameters:

Name Type Description
ids Array.<ToiSchedulerService.ToiBookingId> (Or a single ToiSchedulerService.ToiBookingId.)

A sequence of booking identifiers that should use the new trigger. A single element can be passed directly and does not need to be passed in an array.

delta ToiSchedulerService.ToiDelta

The delta time in seconds since start point of a booking.

Throws:

ToiInvalidArgumentException

Raised if one or more bookings can not be found.

getBooking ( id )  → booking

Get information about a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier to find information about.

Throws:

ToiInvalidArgumentException

The exception will be thrown if can not find a booking with the identifier.

Returns:

The booking information.

Type: ToiSchedulerService.ToiBooking
getBookingIds ( categoryExpression , start , stop )  → Array.<ToiSchedulerService.ToiBookingId>

Get the bookings during start and stop time, with the same category.

Parameters:

Name Type Description
categoryExpression string

The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService#setCategorySubscription.

start ToiSchedulerService.ToiTime

Start time of the booking in seconds since the Unix epoch. A value of 0 means no limit.

stop ToiSchedulerService.ToiTime

End time of the booking in seconds since the Unix epoch. A value of 0 means no limit.

Throws:

ToiInvalidArgumentException

The exception will be thrown if start is later than stop.

Returns:

The sequence of booking identifiers found.

Type: Array.<ToiSchedulerService.ToiBookingId>
getBookingIdsForSeries ( seriesId )  → Array.<ToiSchedulerService.ToiBookingId>

Get the bookings associated with a series.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
seriesId ToiSchedulerService.ToiSeriesId

The identifier of the series to retrieve bookings for

Throws:

ToiInvalidArgumentException

Raised if the identifier does not exist.

Returns:

The sequence of booking identifiers found.

Type: Array.<ToiSchedulerService.ToiBookingId>
getConflicts ( id , category , activity , start , duration )  → Array.<ToiSchedulerService.ToiSolution>

Detect conflicts without actually creating a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The identifier of the booking which need to be tested (in case of a rescheduling to be performed) or ToiSchedulerService.BOOKING_ID_NONE (in case of a new booking to be performed).

category string

The category info for the attempted booking.

activity string

The activity type for the attempted booking.

start ToiSchedulerService.ToiTime

The start time for the attempted booking. Seconds since the Unix epoch.

duration number

The duration time in seconds for the attempted booking.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the identifier cannot be found.

Returns:

If the attempt fails, this parameter will contain lists of existing bookings which have conflicts with the schedule request. Time and resources are considered here to determine whether conflicts exist.

Type: Array.<ToiSchedulerService.ToiSolution>
getNextStartTime ( categoryExpression )  → nextStart

Get the expected starting time for next scheduled booking with matching category.

Parameters:

Name Type Description
categoryExpression string

The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService#setCategorySubscription.

Returns:

The expected starting time of next scheduled booking. If a booking is currently ongoing, 0 will be returned.

Type: ToiSchedulerService.ToiTime
getParameter ( id , name )  → value

Get user defined parameters associated with a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

name string

The name of the parameter.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

Returns:

The value of the parameter.

Type: string
getParameterNames ( id )  → Array.<string>

Get all user defined parameters names of a booking

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

Returns:

A sequence with names of the parameters.

Type: Array.<string>
getSeries ( id )  → series

Get the info of the series with a certain series identifier

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The series identifier to find information about.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the series can not be found.

Returns:

The info of the scheduled series

Type: ToiSchedulerService.ToiSeries
getSeriesConflicts ( id , category , activity , start , duration , weekdays , occurrence )  → Array.<ToiSchedulerService.ToiSolution>

Detect conflicts for a new series booking or a series booking about to be rescheduled, but without actually booking any activities.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The identifier of the series which need to be tested (in case of a rescheduling to be performed) or ToiSchedulerService.SERIES_ID_NONE (in case of a new scheduling to be performed).

category string

The category info for the attempted series.

activity string

The activity type for the attempted series.

start ToiSchedulerService.ToiTime

The start time for the attempted series. Seconds since the Unix epoch.

duration number

The duration time in seconds for each occurrence in the attempted series.

weekdays number

Weekday mask indicating which days the series shall happen.

occurrence number

The number occurrences to be tested. Must be greater than zero.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the series can not be found.

Returns:

If the attempt fails, this parameter will contain lists of existing bookings which have conflicts with the schedule request. Time and resources are considered here to determine whether conflicts exist.

Type: Array.<ToiSchedulerService.ToiSolution>
getSeriesIds ( categoryExpression )  → Array.<ToiSchedulerService.ToiSeriesId>

Get the all series identifiers with the given category.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
categoryExpression string

The category to use as filter. Wildcard "*" is partly supported. ToiSchedulerService#setCategorySubscription.

Returns:

The sequence of series identifiers found.

Type: Array.<ToiSchedulerService.ToiSeriesId>
getSeriesParameter ( id , name )  → value

Get user defined parameters associated with a series.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The identifier of the series.

name string

The name of the parameter.

Throws:

ToiInvalidArgumentException

Raised if the series does not exist.

Returns:

The value of the parameter.

Type: string
getSeriesParameterNames ( id )  → Array.<string>

Get all user defined parameters names associated with a series.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The identifier of the series.

Throws:

ToiInvalidArgumentException

Raised if the series does not exist.

Returns:

A sequence of names of the parameters.

Type: Array.<string>
getTriggers ( id )  → Array.<ToiSchedulerService.ToiDelta>

Get triggers associated with a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

Returns:

Sequences of trigger delta times associated with the booking.

Type: Array.<ToiSchedulerService.ToiDelta>
remove ( id )

Remove a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The identifier of the booking to be removed.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the booking identifier does not exist.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Inherited From:

  • ToiEventTarget#removeEventListener

Parameters:

Name Type Description
type number

The event type of the event to remove the listener from.

listener ToiEventListener

The JavaScript function that was previously added as an event listener.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.

removeSeries ( id )

Remove a booked recurrent scheduling.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The identifier of the recurrent series to be removed.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the series identifier does not exist.

removeTrigger ( id , delta )

Remove trigger from a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

delta ToiSchedulerService.ToiDelta

The delta time in seconds since start point of an booking, may be negative to trigger a callback before the booking shall occur.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

removeTriggerOnBookings ( ids , delta )

Remove triggers from a number of bookings. If there is no trigger with the specified delta - nothing will be changed for that booking.

Parameters:

Name Type Description
ids Array.<ToiSchedulerService.ToiBookingId> (Or a single ToiSchedulerService.ToiBookingId.)

A sequence of booking identifiers that should remove the trigger. A single element can be passed directly and does not need to be passed in an array.

delta ToiSchedulerService.ToiDelta

The delta time in seconds since start point of an booking.

Throws:

ToiInvalidArgumentException

Raised if one or more bookings can not be found.

reschedule ( id , category , activity , start , duration )

Requests changing and rescheduling of a booking.

Note:

If a booking has been started, and the reschedule function is called, the scheduler does not care about the start time as long as the end time is after current time. The new end time is calculated based on the newly provided start time and duration. When ToiSchedulerService#getBooking is called after the reschedule of a started booking, the start time is the same as when the booking start event was fired, and only the duration is updated and calculated from the first start time and the new end time.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The identifier of the booking which needs to be rescheduled.

category string

The new category info for the booking.

activity string

The new activity type for the booking.

start ToiSchedulerService.ToiTime

The start time for the booking. Seconds since the Unix epoch.

duration number

The duration time in seconds for the booking.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the booking identifier does not exist, if changing to a time in the past, or if the new activity used other resources.

ToiNotEnoughResourcesException

The exception will be thrown if the reschedule request fails due to resource conflict.

schedule ( category , activity , start , duration )  → id

Requests scheduling of a new booking.

Parameters:

Name Type Description
category string

The category info for the booking.

activity string

The activity type for the booking.

start ToiSchedulerService.ToiTime

The start time for the booking. Seconds since the Unix epoch.

duration number

The duration time in seconds for the booking.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the activity type does not exist or if start or time is in the past.

ToiNotEnoughResourcesException

The exception will be thrown if the schedule request fails because requested resources exceeds the amount of resources available on the system.

Returns:

A generated booking identifier that will be used in further communication with the client. If the request fails due to conflicts with other bookings this value will be set to ToiSchedulerService.BOOKING_ID_NONE.

Type: ToiSchedulerService.ToiBookingId
scheduleSeries ( category , activity , start , duration , weekdays , numberOfOccurrences , conflictStrategy )  → id

Requests scheduling of a recurrent booking.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
category string

The category info for the series.

activity string

The activity type for the series.

start ToiSchedulerService.ToiTime

The start time for the first occurrence of the series. Seconds since the Unix epoch.

duration number

The duration time in seconds for each occurrence of the series.

weekdays number

Weekday mask indicating which days the recurring series shall happen.

numberOfOccurrences number

The number of occurrences for the series.

conflictStrategy ToiSchedulerService.ToiConflictStrategy

The type of conflict handling strategy to use if a conflict with previously scheduled bookings is detected.

Throws:

ToiInvalidArgumentException

The exception will be thrown if the activity type does not exist or if start or time is in the past.

ToiNotEnoughResourcesException

The exception will be thrown if the schedule request fails because requested resources exceeds the amount of resources available on the system.

Returns:

A generated series identifier that will be used in further communication with the client. If the request fails due to conflicts with other bookings this value will be set to ToiSchedulerService.SERIES_ID_NONE.

Type: ToiSchedulerService.ToiSeriesId
setCategorySubscription ( eventListener , categoryExpression )

This method is used to filter which categories the application is notified about.

Parameters:

Name Type Description
eventListener ToiEventListener

The eventListener that has been registered.

categoryExpression string

The category expression of the bookings to be notified about. Wildcard "" is supported when it is at the beginning or end of a string. And a single "" match all category. Supported wildcard is like that "dvr", "dvr", "*". Otherwise it is treated as an ordinary character.

Throws:

ToiInvalidArgumentException

Raised if the observer/listener is unknown.

setParameter ( id , name , value )

Add user defined parameters to a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

name string

The name of the parameter to set. If a parameter with the same name already exists, it will be overwritten.

value string

The value of the parameter to set.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

setParametersOnBookings ( ids , names , values )

Add user defined parameters to a set of bookings.

Parameters:

Name Type Description
ids Array.<ToiSchedulerService.ToiBookingId> (Or a single ToiSchedulerService.ToiBookingId.)

A sequence of booking identifiers to update with parameters. A single element can be passed directly and does not need to be passed in an array.

names Array.<string>

A sequence of parameter names to be set. Existing parameters with matching names will be overwritten.

values Array.<string> (Or a single string.)

A sequence of parameter values to be set, matching the parameter names. A single element can be passed directly and does not need to be passed in an array.

Throws:

ToiInvalidArgumentException

Raised if any of the bookings do not exist.

setSeriesParameter ( id , name , value )

Add user defined parameters to a scheduled series.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The identifier of the series.

name string

The name of the parameter to set. If a parameter with the same name already exists, it will be overwritten.

value string

The value of the parameter to set.

Throws:

ToiInvalidArgumentException

Raised if the series does not exist.

unsetParameter ( id , name )

Remove user defined parameters from a booking.

Parameters:

Name Type Description
id ToiSchedulerService.ToiBookingId

The booking identifier.

name string

The name of the parameter to remove.

Throws:

ToiInvalidArgumentException

Raised if the booking does not exist.

unsetSeriesParameter ( id , name )

Remove user defined parameters from a scheduled series.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
id ToiSchedulerService.ToiSeriesId

The identifier of the series.

name string

The name of the parameter to remove.

Throws:

ToiInvalidArgumentException

Raised if the series does not exist.

Members

ON_BOOKINGS_ADDED (Type: ToiSchedulerBookingsAddedEvent) (value = 2204) (static, constant)

This is an Event identifier for ToiSchedulerBookingsAddedEvent.

This function will be called when one or several bookings are created.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_BOOKINGS_ADDED.
ON_BOOKINGS_CHANGED (Type: ToiSchedulerBookingsChangedEvent) (value = 2206) (static, constant)

This is an Event identifier for ToiSchedulerBookingsChangedEvent.

This function will be called when one or several bookings are changed.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_BOOKINGS_CHANGED.
ON_BOOKINGS_REMOVED (Type: ToiSchedulerBookingsRemovedEvent) (value = 2205) (static, constant)

This is an Event identifier for ToiSchedulerBookingsRemovedEvent.

This function will be called when one or several bookings are removed.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_BOOKINGS_REMOVED.
ON_SCHEDULED_DISCONTINUITY (Type: ToiSchedulerScheduledDiscontinuityEvent) (value = 2203) (static, constant)

This is an Event identifier for ToiSchedulerScheduledDiscontinuityEvent.

This function will be called in the rare condition when there has been a discontinuity in time and any notification timestamp (start, stop or trigger) of a booking has already expired (after adjusting time). The expired notifications will be missed and any remaining notifications will be sent as normal at the correct time.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SCHEDULED_DISCONTINUITY.
ON_SCHEDULED_START (Type: ToiSchedulerScheduledStartEvent) (value = 2200) (static, constant)

This is an Event identifier for ToiSchedulerScheduledStartEvent.

This function will be called when the start timestamp of a booking is reached. If an application starts observing the booking after start timestamp has passed, it will receive no such callback.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SCHEDULED_START.
ON_SCHEDULED_STOP (Type: ToiSchedulerScheduledStopEvent) (value = 2201) (static, constant)

This is an Event identifier for ToiSchedulerScheduledStopEvent.

This function will be called when the stop timestamp of a booking is reached.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SCHEDULED_STOP.
ON_SCHEDULED_TRIGGER (Type: ToiSchedulerScheduledTriggerEvent) (value = 2202) (static, constant)

This is an Event identifier for ToiSchedulerScheduledTriggerEvent.

This function will be called when the delta timestamp before or after the start of a booking is reached.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SCHEDULED_TRIGGER.
ON_SERIES_CHANGED (Type: ToiSchedulerSeriesChangedEvent) (value = 2207) (static, constant)

This is an Event identifier for ToiSchedulerSeriesChangedEvent.

This function will be called when a series is changed.

This constant can also be accessed from toi.consts.ToiSchedulerService.ON_SERIES_CHANGED.
BOOKING_ID_NONE (Type: ToiSchedulerService.ToiBookingId) (value = 0) (static, constant)

When schedule failed, the application may call ToiSchedulerService#getConflicts with a booking identifier of ToiSchedulerService.BOOKING_ID_NONE to get a list of suggested solutions.

This constant can also be accessed from toi.consts.ToiSchedulerService.BOOKING_ID_NONE.
CONFLICT_STRATEGY_FAIL (Type: ToiSchedulerService.ToiConflictStrategy) (value = 0) (static, constant)

Scheduling will fail without scheduling any bookings when conflicts are detected.

This constant can also be accessed from toi.consts.ToiSchedulerService.CONFLICT_STRATEGY_FAIL.
CONFLICT_STRATEGY_SKIP_BOOKINGS (Type: ToiSchedulerService.ToiConflictStrategy) (value = 1) (static, constant)

Scheduling will proceed to book only those bookings that are not in conflict.

This constant can also be accessed from toi.consts.ToiSchedulerService.CONFLICT_STRATEGY_SKIP_BOOKINGS.
SERIES_ID_NONE (Type: ToiSchedulerService.ToiSeriesId) (value = 0) (static, constant)

Indicates that there is no recurrent booking associated.

This constant can also be accessed from toi.consts.ToiSchedulerService.SERIES_ID_NONE.
SOLUTION_TYPE_NONE (Type: ToiSchedulerService.ToiSolutionType) (value = 0) (static, constant)

There is no solution.

This constant can also be accessed from toi.consts.ToiSchedulerService.SOLUTION_TYPE_NONE.
SOLUTION_TYPE_REMOVE (Type: ToiSchedulerService.ToiSolutionType) (value = 1) (static, constant)

The solution is to remove conflicts.

This constant can also be accessed from toi.consts.ToiSchedulerService.SOLUTION_TYPE_REMOVE.
TIME_NOW (Type: ToiSchedulerService.ToiTime) (value = -1) (static, constant)

Indicates that the requested scheduled time is the current time (now).

This constant can also be accessed from toi.consts.ToiSchedulerService.TIME_NOW.
WEEKDAY_ALL_WEEKDAYS (Type: number) (value = 127) (static, constant)

Bit mask value for all week days.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_ALL_WEEKDAYS.
WEEKDAY_FRIDAY (Type: number) (value = 16) (static, constant)

Bit mask value for Friday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_FRIDAY.
WEEKDAY_MONDAY (Type: number) (value = 1) (static, constant)

Bit mask value for Monday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_MONDAY.
WEEKDAY_SATURDAY (Type: number) (value = 32) (static, constant)

Bit mask value for Saturday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_SATURDAY.
WEEKDAY_SUNDAY (Type: number) (value = 64) (static, constant)

Bit mask value for Sunday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_SUNDAY.
WEEKDAY_THURSDAY (Type: number) (value = 8) (static, constant)

Bit mask value for Thursday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_THURSDAY.
WEEKDAY_TUESDAY (Type: number) (value = 2) (static, constant)

Bit mask value for Tuesday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_TUESDAY.
WEEKDAY_WEDNESDAY (Type: number) (value = 4) (static, constant)

Bit mask value for Wednesday.

This constant can also be accessed from toi.consts.ToiSchedulerService.WEEKDAY_WEDNESDAY.
ToiBooking (Type: struct) (static)

Structure containing information about an existing booking

Struct fields

Name Description
activityType

The activity type.

Type: string
category

The category the booking belongs to.

Type: string
duration

The duration. A value < 0 means no OnScheduledStop will be sent

Type: number
id

Booking identifier.

Type: ToiSchedulerService.ToiBookingId
seriesId

If the booking is part of a series, the parameter refers to the identifier of the series, otherwise set to ToiSchedulerService.SERIES_ID_NONE.

Type: ToiSchedulerService.ToiSeriesId
start

The start time.

Type: ToiSchedulerService.ToiTime

ToiSeries (Type: struct) (static)

Structure containing information about an existing series

Technical Preview:

This structure is a TECHNICAL PREVIEW, it may change.

Struct fields

Name Description
activityType

The activity type.

Type: string
category

The category the series belongs to.

Type: string
duration

The duration. A value < 0 means no OnScheduledStop will be sent

Type: number
id

Series identifier.

Type: ToiSchedulerService.ToiSeriesId
originalNumberOfOccurrences

The number of occurrences originally scheduled for this recurrent booking. If some occurrences have been removed, the value might not reflect the actual number of bookings connected to this recurrent booking.

Note:

This attribute can also be accessed using the alias originalNumberOfOccurences. The alias will be removed in TOI/JS version 2.5.
Type: number
start

The start time of the series.

Type: ToiSchedulerService.ToiTime
weekdays

Bit mask indicating which days a recurring booking shall happen.

Type: number

ToiSolution (Type: struct) (static)

Conflict solution struct

Struct fields

Name Description
affectedBookings

The bookings that need to be resolved according to solution type, i.e. removed if the solution type is ToiSchedulerService.SOLUTION_TYPE_REMOVE.

Note that TOI always provides an Array, even if there is only a single value.

Type: Array.<ToiSchedulerService.ToiBookingId> (Or a single ToiSchedulerService.ToiBookingId.)
type

The solution type.

Type: ToiSchedulerService.ToiSolutionType

Events

ON_BOOKINGS_ADDED ( )

This is an Event identifier for ToiSchedulerBookingsAddedEvent.

Value: 2204

ON_BOOKINGS_CHANGED ( )

This is an Event identifier for ToiSchedulerBookingsChangedEvent.

Value: 2206

ON_BOOKINGS_REMOVED ( )

This is an Event identifier for ToiSchedulerBookingsRemovedEvent.

Value: 2205

ON_SCHEDULED_DISCONTINUITY ( )

This is an Event identifier for ToiSchedulerScheduledDiscontinuityEvent.

Value: 2203

ON_SCHEDULED_START ( )

This is an Event identifier for ToiSchedulerScheduledStartEvent.

Value: 2200

ON_SCHEDULED_STOP ( )

This is an Event identifier for ToiSchedulerScheduledStopEvent.

Value: 2201

ON_SCHEDULED_TRIGGER ( )

This is an Event identifier for ToiSchedulerScheduledTriggerEvent.

Value: 2202

ON_SERIES_CHANGED ( )

This is an Event identifier for ToiSchedulerSeriesChangedEvent.

Value: 2207

5.1.1.p8

Copyright (c) 2018 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.