Document toolboxDocument toolbox

Shift and Location Restore SOAP API

The sp:EmpRestoreRequest API method can be used to restore an operative's shift and/or locations.

Description

Shifts and locations can be restored to their original values by the removal of any overrides.

A public holiday is restored as a holiday; i.e. the operative’s shift pattern won’t be restored. If an operative has assigned jobs on a public holiday, the call will succeed and return SP_OK_JOBS_ON_HOLIDAY (328). The jobs won’t be de-allocated, but, unless they are fixed, or have a status > tentative, the Optimizer may de-allocate them when it next runs if it can’t re-allocate them.

Similarly, if an operative has assigned jobs on a no-shift day, the call to sp:EmpRestoreRequest will succeed and return SP_OK_JOBS_ON_NO_SHIFT (329). The jobs won’t be de-allocated, but, unless they are fixed or have a status > tentative, the Optimizer may de-allocate them when it next runs if it can’t re-allocate them.

This SOAP API is implemented in real time, i.e. the original shift/locations can be assumed to have been restored on a successful return from the call.

Definition

The definition of this API is:

 Click here to expand...

Web Service

Type

Description

Req?

Val?

<sp:EmpRestoreRequest>

 

 

 

 

 

<empID>?</empID>

EmpID

The operative’s ID

(tick)

(tick)

 

<date>?</date>

 

The date that the override is on

(tick)

 

 

<options>

 

 

 

 

 

 

<RestoreShift>?</RestoreShift>

 

If RestoreShift is set then the shift override on Date will be removed from the operative EmpID. This will have the effect of restoring the shift period shift start and end times, breaks and capacity/all day job settings, to the values from his currently assigned shift pattern, if there is one, for that Date; previous overrides will be lost.

If there is a Public Holiday on Date then the Public Holiday will be restored i.e. on removing the override there will be no shift on that Date.

 

 

 

 

<RestoreLocs>?</RestoreLocs>

 

If RestoreLocs is set then the locations overridden on Date will be removed from the operative EmpID. This will have the effect of restoring the original start, end and Local Knowledge Centroid locations for that Date; previous overrides will be lost.

 

 

 

</options>

 

 

 

 

</sp:EmpRestoreRequest>

 

 

 

 

Return Structure

The API returns the standard return structure.

Return Codes

In addition to the Standard Return Codes, the possible Return Codes from this API are:

 Click here to expand...
  • SP_OK (0)
  • SP_EMPID_INVALID (5)
  • SP_DATE_INVALID (14)
  • SP_OUTSIDE_HORIZON (53)
  • SP_OPTIONS_INVALID (80)
  • SP_EMP_NOT_IN_TEAM (124)
  • SP_EMPID_DOES_NOT_EXIST (231)
  • SP_OK_JOBS_ON_HOLIDAY (328)
  • SP_OK_JOBS_ON_NO_SHIFT (329)
  • SP_SHIFTS_WOULD_OVERLAP (344)
  • SP_SHIFTS_TOO_CLOSE (345)
  • SP_OK_WITH_OVERLAPS (373)
  • SP_SO_NWD_TOO_SHORT (551)
  • SP_SO_ADJ_IN_SHIFT (558)
  • SP_OK_NO_SHIFT_OVERRIDE (560)
  • SP_OK_NO_LOC_OVERRIDES (561)
  • SP_NO_RESTORES (562)
  • SP_OK_CAPACITY_EXCEEDED (640)
  • SP_BREAKTYPE_INVALID (650)

 

 

Where SP_BREAKTYPE_INVALID (650)is returned for this particular API, it means that a fixed break has been encountered when attempting to restore breaks.