Document toolboxDocument toolbox

14.1 sp100_activities

On This Page:

This table records details of all activities which have been assigned to employees: each record represents one activity being carried out by one employee between specified start and end dates and times. "Activity" is used in rather a broad sense, because a record may actually represent lack of activity, e.g. annual leave or sick leave. On the Gantt chart, each bar in the body of the chart corresponds to one record in the sp100_activities table.

An "employee" may be an individual (engineer / operative) or a crew.

Activity records are also used as a means of constructing crews: in this case, each record represents the assignment of an operative to a specified crew for a specified period of time. Constructing crews in this way (as opposed to having a separate crew membership table) has the convenient side effect of making the individuals who make up the crew unavailable to the schedulers: they are seen to be fully occupied because of the crew member activity.

A job that lasts more than one day (a "long job") is represented in this table as a single row, although this will in fact represent several site visits. The start and travel of the first part of the job, and the end of work of the last part of the job, are held.

The Standard Activities in this table are tidied by sp_dbtidy's Global group and the Jobs are tidied by sp_dbtidy's Job group.


 

Table Definition

Field
Type
Default
Nullable

activity_no

number(9)

 (error)

employee_no

number(9)

  

resp_unit_no

number(4)

 (error)

activity_type

number(2)

 (error)

crew_no

number(9)

  

crew_leader

number(1)

  

job_no

number(9)

  

expected_start

date

  

expected_end

date

  

notes

clob

  

overtime

number(6)

  

travel_time

number(6)

  

lunch_time

number(6)

  

activity_status

number(2)

  

schedule_status

number(5)

  

jeopardy_warnings

number(9)

  

time_scheduled

date

  

postcode

varchar2(30)

 

(error)

region_no

number(9)

 

(error)

unalloc_reason

number(2)

  

last_dispatched_eta

date

  

earmark_dispatch_status

number(2)

  

earmark_dispatch_type

number(2)

  

jeopardy_report_marker

number(1)

  

EOD_travel

number(6)

  

last_dispatched

date

  

expected_start_is_dst

number(1)

  

expected_end_is_dst

number(1)

  

jeopardy_warnings2

number(9)

default 0

 

ssr_marked

number(1)

  

transaction_id

number(9)

  

local_knowledge

number(2)

  

expected_duration

number(8) 

  

expected_overhead

number(8) 

  

scheduled_duration

number(8) 

  

scheduled_overhead

number(8) 

  

actual_duration

number(8) 

  

has_been_or_is_logged_on

number(1)

  

confirmed_state

number(1) 

  

dispatch

number(1)

  

travel_mode

number(1)

  

booked_start

date

  

last_update

date

default sysdate

 

last_jeopardy_update

date

  
rtt_travel_timenumber(5)default -1(error)
rtt_route_idvarchar2(512) (tick)
rtt_travel_homenumber(5)default -1(error)
manually_scheduled
number(1)
default 0
(error)

Keys 

  • Primary key (activity_no

Primary Key Referenced From

Column Descriptions

FieldDescription
activity_noServiceOptimizer generated unique identifier. 
employee_no

The identifier of the employee undertaking the activity.

Earlier versions of ServiceOptimizer set employee_no to -1 to indicate that the activity is an unscheduled appointment or fault fixing activity (so if the employee_no is -1 then job_no should not be NULL.) From ServiceOptimizer version 3.2 onwards, however, it is not sufficient simply to test for an employee_no of -1 when trying to establish whether or not a job is unresourced. 

When an appointment is booked through the ABS, it will be nominally associated with an employee by setting this column. It is not until the job has been scheduled, or manually allocated via the Gantt interface, that it can be said for certain that the job will be carried out by the specified employee. Until that time, the job is still said to be unresourced, notwithstanding the fact that employee_no has been set. 

To discover whether or not a job is resourced, therefore, it is necessary to check the value of schedule_status (see below). 

resp_unit_noInterim Responsibility Unit (IRU) to which the employee is posted (for standard activities) or to which the job belongs (for resourced jobs). For unresourced jobs, resp_unit_no is set from the customer postcode, via its region, and by finding all the IRUs that cover this region. Of these IRUs the one whose resp_unit_ref is least alphabetically is chosen. The resp_unit_no of this IRU is used in this SP100 field. 
activity_typeA number indicating the type of the activity. 
crew_noWhere the activity represents crew membership, this is the identifier of the crew to which the employee belongs; otherwise, the column is NULL
crew_leaderWhere crew_no is not NULL, this is a flag indicating whether or not the employee is to be treated as a leader of the crew: 1 indicates that the employee is a crew leader, 0 otherwise. This column should be NULL if crew_no is null. 
job_noWhere the activity relates to an appointment or fault, this is the job's unique identifier; otherwise, the column is NULL.
expected_startThe date and time at which the activity is expected to start - uses FRU Time Zone. For a job that spans more than one operative day, this is the start of the first part job.This column is always NULL for an unresourced job. 
expected_endThe date and time at which the activity is expected to end. A NULL value indicates that the activity continues indefinitely. Uses FRU Time Zone. For a job that spans more than one operative day, this is the end of the last part job. This column is always NULL for an unresourced job. 
notesFree text description. For a job, this is constructed from the 4 description fields supplied when the job was booked, separated by newline characters. These description fields are held separately in 14.1 sp111_jobs. If a job's notes are modified, this field is changed but the description fields in 14.1 sp111_jobs are unchanged. Note that the job's "more notes" are held in table 14.1 sp153_job_more_notes
overtimeThe number of minutes that a job is outside of a shift. Including any time before or after the shift period. This time is not adjusted for operative efficiency. This column is always NULL for an unresourced job. 
travel_timeThe amount of travel time, in seconds, which is included in the activity duration. This is used only for faults and appointments. For a job that spans more than one operative day, this is the travel to the first part job. This column is always NULL for an unresourced job.
lunch_time

The amount of time, in seconds, included in the job duration for the employee to take a break.

This is only relevant to jobs (not Standard Activities).

If the job has no break included, this is set to NULL.

If an All Day job (ref. 14.1 sp111_jobs.job_status) has a break allocated to it, the break duration is always zero. 

It is possible to resize a job such that its break duration is zero. 

For a job that spans more than one operative day, this is the break duration for the first part job. This column is always NULL for an unresourced job. 

activity_statusA number indicating the current status of a scheduled task. 
  • 0: Tentative.
  • 1: (Deprecated).
  • 2: Engineer earmarked.
  • 3: Engineer contacted.
  • 4: Travelling.
  • 5: Engineer logged on.
  • 6: Engineer logged off.
  • 7: Job clearedThis column is always NULL for an unresourced job. 
schedule_status

A number denoting the current scheduling status of the activity, for appointments and fault fixing activities. For Standard Activities, see below. 

This value is a bit pattern, as follows: 

  • Scheduled field - 2 bits.
  • Bit 0: Manually allocated.
  • Bit 1: Auto allocated.

Note that a job will remain unresourced until it has been automatically scheduled, or manually allocated. That is, it is unresourced if neither the Manually allocated or the Auto allocated bits are set - i.e. if schedule_status = 0

For Standard Activities, this field is 1 if the standard activity wishes to include breaks, and 0 otherwise. 

jeopardy_warnings

Flag indicating whether the activity is in some kind of jeopardy. If this value and the value of jeopardy_warnings2 are both zero, then the activity is not in jeopardy. Zero for Standard Activities. Jeopardy conditions are identified in FS020 and FS175.

This value is treated as a bit pattern as follows:

  • Bit 0: late contacted (SPJM_LATE_CONTACT) (C).
  • Bit 1: late log on (SPJM_LATE_LOGON) (N).
  • Bit 2: late log off (SPJM_LATE_LOGOFF) (F).
  • Bit 3: job overlap (SPJM_OVL_JOB) (J).
  • Bit 4: late earmarked (SPJM_LATE_EARMARK) (E).
  • Bit 5: late travelling (SPJM_LATE_TRAVEL) (T).
  • Bit 6: (Reserved).
  • Bit 7: shift overlap (SPJM_OVL_SHIFT) (S).
  • Bit 8: overtime overlap (SPJM_OVL_OT) (O).
  • Bit 9: activity overlap (SPJM_OVL_STDACT) (X).
  • Bit 10: (Reserved).
  • Bit 11: broken promise (SPJM_PROMISE) set whenever any of bits 14 to 19 and jeopardy_warnings2 bits 0 to 2 are set.
  • Bit 12: (Reserved).
  • Bit 13: unresourced job (SPJM_UNSCHEDULED) (U).
  • Bit 14: missed appointment (SPJM_MISSED_APPT) set when bits 18 & 19 are set. 
  • Bit 15: (Reserved).
  • Bit 16: early – before contract earliest (SPJM_BEFORE_CONTRACT) (B).
  • bit 17: overdue - past contract latest (SPJM_PAST_CONTRACT) (P).
  • Bit 18: missed appointment (early) (SPJM_MISSED_APPT_EARLY) (Me).
  • Bit 19: missed appointment (late) (SPJM_MISSED_APPT_LATE) (M).
  • Bit 20: (Reserved).
  • Bit 21: (Reserved).
  • Bit 22: (Reserved).
  • Bit 23: dispatch failure (earmark) (SPJM_DISPATCH_FAIL_EARMARK) (De).
  • Bit 24: dispatch failure (unearmark) (SPJM_DISPATCH_FAIL_UNEARMARK) (Du).
  • Bit 25: dispatch failure (re-earmark) (SPJM_DISPATCH_FAIL_REEARMARK) (Dr).
  • Bit 26: dispatch failure (batch) (SPJM_DISPATCH_FAIL_BATCH) (Db).
  • Bit 27: unsuitable shift for all day job (SPJM_ADJ_UNSUITABLE_SHIFT) (A).
  • Bit 28: (Reserved).
  • Bit 29: job in No Go region for this operative (SPJM_NOGO) (Ng).
time_scheduledThe date and time at which the activity was assigned to the employee by the automatic scheduler. This column will be null for activities not allocated by the scheduler. Uses the time zone of the DBMS server machine. 
postcodePostcode of the employee's location at the time the activity is completed. 
region_noThe identifier of the region in which the activity takes place. 
unalloc_reason

Reason job is unallocated: 

  • 1: (Obsolete) (Forced: no RU available).
  • 2: Forced: no operative is working.
  • 3: Forced: no operative has local knowledge.
  • 4: Forced: no operative has skills.
  • 5: Forced: no operative has spares.
  • 6: Forced: schedule capacity would be exceeded.
  • 7: Forced: no time available within access hours.
  • 8: Forced: without skill check.
  • 9: Forced: with skill check.
  • 10: (Obsolete) (Forced: mandatory operative's RU not available).
  • 11: Forced: mandatory operative is not working.
  • 12: Forced:  mandatory operative has no local knowledge.
  • 13: Forced: mandatory operative doesn't have skills.
  • 14: Forced: mandatory operative doesn't have spares.
  • 15: Forced: mandatory operative would exceed schedule capacity.
  • 16: Manually de-allocated.
  • 17: De-allocated by the optimizer.
  • 18: Forced: no operative has time available.
  • 19: Replaced by a more important job.
  • 20: (Obsolete).
  • 21: Operative found to not have a shift (for an AllDayJob) when ServiceOptimizer started up.
  • 22: De-allocated because the job spanned postings after an API call.
  • 23: Forced: no operative has suitable shift for AllDay job.
  • 24: Forced: mandatory operative has no suitable shift for AllDay job.
  • 25: De-allocated because the job spanned shift pattern assignments after an API call.
  • 26: De-allocated because the job spanned an operative day boundary after an API call.
  • 27: De-allocated because the job overlapped a standard activity after an API callThis column is always NULL if the job is resourced (i.e. not unallocated). 
last_dispatched_etaThe ETA of the job when it was earmarked and dispatched - uses FRU Time Zone. If a job has not yet been earmarked, or when it is unearmarked this column will be null.This column is always NULL for an unresourced job. 
earmark_dispatch_statusThe current delivery status of the earmark message related to this job. Corresponds to a value in 14.1 sp287_dispatch_statuses. Will be NULL if the job is not yet earmarked or when it is unearmarked. This column is always NULL for an unresourced job. 
earmark_dispatch_typeThe type of earmark message to be delivered. Corresponds to 14.1 sp290_dispatch_types. Will be NULL if the job is not yet earmarked or when it is unearmarked.This column is always NULL for an unresourced job. 
jeopardy_report_marker

Flag which records a job on the Gantt's Jeopardy Report as 'marked'. Takes one of two values:

  • 0: not marked.
  • 1: marked job.
EOD_travel

The amount of travel time, in seconds, which is required to travel from the job location to the end-of-day location. This is only relevant to the last job of a day. This column is always NULL for an unresourced job.

last_dispatchedThe date/time the job was earmarked and dispatched - uses FRU Time Zone.This column is always NULL for an unresourced job. 
expected_start_is_dst

Flag indicating which time the job start is in when the time is during Daylight Saving. For example, in the UK:

  • 0: the job starts in GMT.
  • 1: the job starts in BST.

This column is always NULL for an unresourced job. 

expected_end_is_dst

Flag indicating which time the job end is in when the time is during Daylight Saving. For example, in the UK: 

  • 0: the job ends in GMT.
  • 1: the job ends in BST.
jeopardy_warnings2

An additional flag indicating further jeopardy conditions in addition to those indicated by jeopardy_warnings.

Zero for Standard Activities. Jeopardy conditions are identified in FS020 and FS175. This value is treated as a bit pattern as follows:

  • Bit 0: outside access hours (SPJM2_OUTSIDE_ACC_HOURS) (Ac).
  • Bit 1: (Reserved).
  • Bit 2: outside service hours (SPJM2_OUTSIDE_SERV_HOURS) (Se).
  • Bit 3: job in a dependency group with an unresourced job (SPJM2_DEP_UNSCHEDULED) (Gu).
  • Bit 4: broken dependency group – should be same operative (SPJM2_DEP_NOT_SAME_OPER) (Gs).
  • Bit 5: broken dependency group – should be different operative (SPJM2_DEP_NOT_DIFF_OPER) (Gd).
  • Bit 6: broken dependency group – time constraint violated (SPJM2_DEP_MISSED_TIME) (Gt).
  • Bit 7: not all spares in van (SPJM2_EXT_SPARES) (Sv).
ssr_marked

Indicates whether the marked check box on the Gantt client Same Site Report is checked or not.

  • 0: not marked.
  • 1: marked.
transaction_idSee sp599_transaction_audit for details. 
local_knowledgeThis is the local knowledge that this employee has to do this job. This is an output only field, i.e. the server updates it but does not rely on its value. For Standard Activities and Unresourced Jobs its value is NULL
expected_duration

Working time (in minutes) the job was predicted to take when it was booked, given its current position in the schedule.

For a resourced job this:

  • Takes account of operative efficiency.
  • Includes overhead time (where applicable).
  • Excludes travel and break.
  • Does not reflect modifications to the job's duration after booking.

For an unresourced job this is the same as its booked duration (14.1 sp108_job_details.booked_duration). 

expected_overhead

Overhead time (in minutes) the job was predicted to take when it was booked, given its current position in the schedule.

For a resourced job this takes account of same-site groups and does not reflect modifications to the job's duration after booking.

For an unresourced job this is the same as its booked overhead (sp108_job_details.booked_overhead). 

scheduled_duration

Working time (in minutes) that the job was predicted to take - up to the time when the Actual Duration became known.

For a resourced job this:

  • Takes account of operative efficiency.
  • Includes overhead time (where applicable).
  • Excludes travel and break.
  • Is updated to reflect modifications to the job's duration after booking.

For an unresourced job this is the same as its normalised scheduled duration (14.1 sp108_job_details. normalised_scheduled_duration). 

scheduled_overhead

Overhead time (in minutes) that the job was predicted to take - up to the time when the Actual Duration became known.

For a resourced job this:

  • Takes account of same-site groups.
  • Is updated to reflect modifications to the job's duration after booking.

For an unresourced job this is the same as its normalised scheduled overhead (14.1 sp108_job_details. normalised_scheduled_overhead). 

actual_duration

Working time (in minutes) that the job actually took and hence only known after the job has been Logged Off or Cleared: until then this is NULL. Only represents the true actual duration of the job if SP was supplied with the job's real LoggedOn time. (i.e. has_been_or_is_logged_on set to 1). Otherwise, represents the time from the estimated ETA to the actual ETF. Includes overhead, excludes break and travel. An unresourced job has no actual duration hence this field will be NULL.

has_been_or_is_logged_onFor a resourced job, indicates whether this job's dispatch status is currently LoggedOn or has ever been LoggedOn. Set to 1 if it has or 0 if it has not. If this flag is set to 1, then the job's ETA is the actual ETA as opposed to an estimated ETA. This field will be NULL for an unresourced job 
confirmed_state 

Identifies whether arrangements for the site visit have been confirmed with the customer.

  • 0: Not yet been confirmed.
  • 1: Is in the process of being confirmed.
  • 2: Has been confirmed.
  • 3: Is in the process of being reconfirmed.

NULL for a standard activity.

dispatch

Identifies whether a standard activity is dispatchable.

  • 0: no dispatch.
  • 1: dispatch. 
travel_mode

Specifies the travel mode for the standard activity.

  • 0: No travel mode.
  • 1: Given start time is also the start time for travelling.
  • 2: Given start time is the arrival time so start time needs to be adjusted to accommodate travel time. 
booked_startOriginal start time used with travel mode to determine the actual start time. 
last_updateThe date and time the job was last updated. Uses FRU time zone. 
last_jeopardy_updateThe date and time of the last update to the jeopardy conditions of the job. Uses FRU time zone.
rtt_travel_time

The travel time to the job, in seconds, returned by the Real Time Travel Server (only used if RTT enabled with SP083 postcode_tm_lookup)

rtt_route_idA string which uniquely identifies the route used by the Travel Server to get the RTT Travel Time (only used if RTT enabled with SP083 postcode_tm_lookup)
rtt_travel_homeThe Real Time Traffic travel time from the job to the Employee home. Only expected to be used for the last job in the day (only used if RTT enabled with SP083 postcode_tm_lookup)
manually_scheduled

Indicates if the job has been manually moved on the Gantt; 1 means that the job has been moved;  0 means the job has not been moved. A job is considered to have been moved when the following manual actions have been performed:

    • Change to a job's start time or arrival time.
    • Change to a job's end time.
    • Change to a job's operative.
    • Dragging a job from the in-tray (unresourced) to the schedule (not ABS allocate).