On This Page:
Related Pages:
The sp:EmpAddActRequest
API method can be used to create and allocate standard activities.
Description
Standard activities cannot exist on their own; they only exist when allocated to an employee (EmpID
). Therefore there is no "create" API method. Instead, the sp:EmpAddActRequest
API method is used to create new standard activities and allocate them at the same time.
Definition
The definition of this API is:
Click here to expand...
Web Service | Type | Description | Req? | Val? |
<sp:EmpAddActRequest>
| | | | |
| <empID>?</empID>
| EmpID
| is the identifier of the employee that the newly created standard activity will be allocated to. | | |
| <actType>?</actType>
| ActTypeStr
| is the type of standard activity which should be created | | |
| <expectedStart>?</expectedStart>
| spDateTime
| is the date and time of when the new standard activity should start (employee local or default – see 12). If the time part isn’t supplied, it defaults to the start of the operative’s day. | | |
| <expectedEnd>?</expectedEnd>
| spDateTime
| is the date and time (employee local or default) when the new standard activity should end. If the time part isn’t supplied, it defaults to the end of the operative’s day. If an empty string (“”) is supplied, the new activity will last indefinitely but this is only allowed if the employee is posted to the same FRU (but not necessarily to the same Team within that FRU) indefinitely, otherwise SP_POSTING_HAS_ENDDATE (285) will be returned. expectedEnd and expectedDuration cannot both be populated – if both are then SP_SA_CONFLICTING_END (665) will be returned. | | |
| <locType>?</locType>
| ActLocType
| specifies where the new standard activity is to be located: at a supplied postal code (in Act.EndPostCode (below)), at the employee’s home region, at the employee’s depot’s region (not available in V4.4 if the operative isn’t on shift), at the employee’s work region, at the employee’s start region on the day of the activity (if he’s on shift), taking overrides into account, at the employee’s end region on the day of the activity (if he’s on shift), taking overrides into account Note: Can be missing but, unless StandardActivityTravelMode has a value other than NoTravel, this will result in SP_ACT_LOC_TYPE_INVALID (152) being returned, since the activity’s location must be known to SERVICEOptimizer for travel to be included. | | |
| <locPostcode>?</locPostcode>
| Postcode
| is the postal code of the location of the new activity when the value of Act.EndLocType (above) is Supplied. | | |
| <notes>?</notes>
| ActNotes
| This field is for user annotation and can either be any text string or it can be empty (“”). It appears on the Gantt Show Activity Details window, where it can also be edited. | | |
| <TZType>?</TZType>
| StandardActivityTZType
| Defaults to Employee TZ. | | |
| <Dispatch>?</Dispatch>
| boolean
| Determines whether or not this specific standard activity will be included in any dispatching process. Defaults to value associated with actType. | | |
| <TravelMode>?</TravelMode>
| StandardActivityTravelMode
| Determines whether the standard activity will be allocated travel and, if so, how that travel behaves w.r.t the start of the SA | | |
| <Duration>?</Duration>
|
| The number of minutes the standard activity is expected to last. expectedEnd and expectedDuration cannot both be populated – if both are then SP_SA_CONFLICTING_END (665) will be returned. | | |
| <options>
| | Please refer to section 4.2.4 for defintions and settings values | | |
| | <CheckJobs>?</CheckJobs>
|
| | | |
| | <CheckStdActs>?</CheckStdActs>
|
| | | |
| | <CheckJobsDealloc>?</CheckJobsDealloc>
| | | | |
| | <CheckJobsShuffle>?</CheckJobsShuffle>
| | | | |
| | <CheckJobsAllowBreakAH>?</CheckJobsAllowBreakAH>
|
| | | |
| | <CheckFrozen>?</CheckFrozen>
| | | | |
| | <OverlapBreaks>?</OverlapBreaks>
| | | | |
| </options>
| | | | |
</sp:EmpAddActRequest>
|
| | | |
Both the ExpectedStart and the ExpectedEnd fields are local to the employee doing the activity or, if the employee has no timezone, local to the default timezone.
Return Structure
The API returns a non-standard return structure.
Web Service | Type | Description | Req? | Val? |
<sp:EmpAddActResponse>
| | | | |
| <actID>?</actID>
|
| (returned) is the unique identifier of the new standard activity generated by this function and returned to the caller. This field is ignored on input. | | |
</sp:EmpAddActResponse>
|
| | | |
Return Codes
In addition to the Standard Return Codes, the possible Return Codes from this API are:
Click here to expand...
SP_POSTCODE_INVALID (3)
SP_EMPID_INVALID (5)
SP_DURATION_INVALID (12)
SP_END_NOT_GT_START_TIME (31)
SP_OUTSIDE_HORIZON (53)
SP_START_TIME_INVALID (62)
SP_END_TIME_INVALID (63)
SP_OPTIONS_INVALID (80)
SP_NO_REG_TO_RU_MAPPING (115)
SP_ACTIVITY_TYPE_INVALID (120)
SP_ACTIVITY_NOTES_INVALID (123)
SP_EMP_NOT_IN_TEAM (124)
SP_TEAM_NOT_IN_RU (125)
SP_OVERLAPPED_JOBS (132)
SP_ACT_LOC_TYPE_INVALID (152)
SP_OPTION_COMBINATION_INVALID (159)
SP_OVERLAPPED_STDACTS (160)
SP_EMPID_DOES_NOT_EXIST (231)
SP_POSTING_HAS_ENDDATE (285)
SP_SPANS_POSTINGS (286)
SP_WOULD_BREAK_ACCESS_HOURS (371)
SP_OK_WITH_OVERLAPS (373)
SP_DST_TIME_INVALID (379)
SP_FROZEN_DAY (585)
SP_OK_CAPACITY_EXCEEDED (640)
SP_SA_CONFLICTING_END (665)
SP_SATM_INVALID (667)
SP_SA_DISPATCH_INVALID (670)
SP_SA_TRAVELMODE_ENDTIME_INVALID (672)
SP_SA_LOCATIONTYPE_MISSING_POSTCODE (673)