A scheduled order service runs periodically to review the order repository and determine if any scheduled orders are due to be filled. Out of the box, this service is not set to run, so you must provide a frequency for it before scheduled orders can work.

To set the initial frequency of the scheduled order service, you issue a POST request to the scheduledJobs endpoint, with a payload that defines the schedule, an example of which is provided below. To update the schedule, you issue a PUT request to the same endpoint.

POST /ccadmin/v1/merchant/scheduledJobs

{
"componentPath": "/atg/commerce/order/scheduled/ScheduledOrderService",
"scheduleType": "periodic",
"schedule":
  {
   "period" : 1000000
  }
}

The scheduleType and schedule properties determine the frequency used when running the scheduled order service. The scheduleType property may be either periodic (time-based) or calendar (calendar-based).

If you specify periodic for the scheduleType property, you must also provide a period property in milliseconds.

If you specify calendar, you must provide additional properties that further define the frequency. These properties include:

The following combinations of these properties are allowed:

Note: If both daysInMonth and daysOfWeek are sent in the payload, then daysInMonth takes priority.

To help you better understand how to combine these properties, some examples are provided below.

This schedule runs twice on Sunday, Monday, and Tuesday of the first, second and third weeks of February and April.

"schedule":{
   "daysOfWeek":[1,2,3],
   "weeksInMonth":[1,2,3],
   "monthsInYear":[1, 3],
   "occurrenceInDay":2
}

This schedule runs twice a day:

"schedule":{
   "occurrenceInDay":2
}

This schedule runs once every Sunday:

"schedule":{
   "daysOfWeek":[1]
}

This schedule runs twice on Monday in the second and third weeks of every month:

"schedule":{
   "daysOfWeek":[2],
   "weeksInMonth":[2,3],
   "occurrenceInDay":2
}

This schedule runs once on the first day of every month:

"schedule":{
   "daysInMonth ":[1]
}

This schedule runs once on the fifth day of June:

"schedule":{
   "daysInMonth ":[5],
   "monthsInYear": [5]
}

This schedule runs once on the first day of January, March, May, July, September, and November:

"schedule":{
   "daysInMonth ":[1]
   "monthsInYear":[0, 2, 4, 6, 8, 10]
}

This schedule runs on the 10th, 15th, 20th, and 21st days of February and December:

"schedule":{
   "daysInMonth":[10,15,20,21],
   "monthsInYear":[1, 11]
}

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices