SOAP API - saveCalendar

The table summarizes the SOAP API - saveCalendar.

Request Uses the saveCalendar element (from the WorkCalService schema)
Parameter notes
  • <base-calendar > , <overlay-calendar >   You have a choice of entering either base or overlay details in one saveCalendar operation.
  • calendar-type  one of BASE or OVERLAY.
  • namespace, name  identify the calendar to be saved. If a calendar of the specified name does not exist in the specified namespace, it is created. If the specified namespace does not exist, it is created.
  • date-created, date-modified  these are optional in the request, but the response returns the date that this calendar was created, and the date it was last amended.
  • time-zone  use one of the values returned by listTimeZones . If no timezone is specified, the timezone of the BPM server is used.
  • min-hours  a value that defines the minimum number of hours in a working day. This may differ from the normal working hours defined on the base calendar.

    When calcDeadline is used to calculate a deadline using a duration parameter defined in units of working days, any day with a number of available hours less than min-hours is ignored. The deadline calculation moves on to the next available day, where again the number of available hours is compared.

  • day-of-week  for a base calendar, up to seven entries. Each is the name of one day of the week in abbreviated form: MO, TU, WE, TH, FR, SA, SU.
  • time-slot start and end  for each day-of-week specified in a base calendar, there can be up to five entries, each entry giving the start and end times of a working period within the specified day. Morning and afternoon separated by a meal break, for example, would be two time slots. Specify times as hh:mm.SSSTZ, where:

    SSS is the 3-digit millisecond value

    TZ is the timezone: for example, UTC is represented by ’Z’.

    TIBCO strongly recommends that you specify a timezone of Z for all entries. If no timezone is specified, some APIs used by TIBCO ActiveMatrix BPM will automatically convert the value to the timezone used by the server, regardless of the calendar’s time-zone specification. This may not always be the timezone required.

    BPM stores time-slot start and end times as UTC, regardless of any timezone specified. However the base calendar’s time-zone value is used to adjust these times for display purposes in Openspace.

Response Returns a saveCalendarResponse element (from the WorkCalService schema).
Example 1: Create a base calendar
  Request:
<soapenv:Body>
      <wor:saveCalendar>
         <base-calendar calendar-type="BASE" namespace="LONDON" name="EMEA-N" date-created="?" date-modified="?" version="-1" time-zone="Europe/London" min-hours="4">
            <working-days day-of-week="MO">
               <time-slot start="08:00:00.000Z" end="12:00:00.000Z"/>
               <time-slot start="13:00:00.000Z" end="18:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="TU">
               <time-slot start="08:00:00.000Z" end="12:00:00.000Z"/>
               <time-slot start="13:00:00.000Z" end="18:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="WE">
               <time-slot start="08:00:00.000Z" end="12:00:00.000Z"/>
               <time-slot start="13:00:00.000Z" end="18:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="TH">
               <time-slot start="08:00:00.000Z" end="12:00:00.000Z"/>
               <time-slot start="13:00:00.000Z" end="18:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="FR">
               <time-slot start="08:00:00.000Z" end="12:00:00.000Z"/>
               <time-slot start="13:00:00.000Z" end="16:00:00.000Z"/>
            </working-days>
         </base-calendar>
      </wor:saveCalendar>
   </soapenv:Body>
  Response:
  <SOAP-ENV:Body>
      <saveCalendarResponse xmlns="http://workcal.api.dac.n2.tibco.com">
         <base-calendar calendar-type="BASE" date-created="2012-03-01T15:04:40.713Z" date-modified="2012-03-01T15:04:40.739Z" min-hours="4" name="EMEA-N" namespace="LONDON" time-zone="Europe/London" version="0" xmlns="">
            <working-days day-of-week="MO">
               <time-slot end="12:00:00.000Z" start="08:00:00.000Z"/>
               <time-slot end="18:00:00.000Z" start="13:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="TU">
               <time-slot end="12:00:00.000Z" start="08:00:00.000Z"/>
               <time-slot end="18:00:00.000Z" start="13:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="WE">
               <time-slot end="12:00:00.000Z" start="08:00:00.000Z"/>
               <time-slot end="18:00:00.000Z" start="13:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="TH">
               <time-slot end="12:00:00.000Z" start="08:00:00.000Z"/>
               <time-slot end="18:00:00.000Z" start="13:00:00.000Z"/>
            </working-days>
            <working-days day-of-week="FR">
               <time-slot end="12:00:00.000Z" start="08:00:00.000Z"/>
               <time-slot end="16:00:00.000Z" start="13:00:00.000Z"/>
            </working-days>
         </base-calendar>
      </saveCalendarResponse>
   </SOAP-ENV:Body>
Example 2: Create an overlay calendar
  Request:
<soapenv:Body>
      <wor:saveCalendar>
        <overlay-calendar calendar-type="OVERLAY" namespace="LONDON" name="PUB_HOL" date-created="?" date-modified="?" version="-1"/>
      </wor:saveCalendar>
</soapenv:Body>
  Response:
<SOAP-ENV:Body>
      <saveCalendarResponse xmlns="http://workcal.api.dac.n2.tibco.com">
         <overlay-calendar calendar-type="OVERLAY" date-created="2012-03-01T16:05:10.649Z" date-modified="2012-03-01T16:05:10.649Z" name="PUB_HOL" namespace="LONDON" version="0" xmlns=""/>
      </saveCalendarResponse>
</SOAP-ENV:Body>