|
Http Verb |
POST |
|---|---|
|
Url |
/scheduling/manual/r1/scheduling/activities-assignments |
|
Permissions required |
|
|
Personally Identifiable Information (PII) |
No |
|
Sensitive Information |
No |
|
Last Modified Version |
r1 - 2024 W3 (FSM 18.0) |
|
Released since |
2024 W2 (FSM 17.0) |
|
Deprecated since |
|
|
Removed since |
|
|
Tech Tags |
|
Business Logic
This API is designed for assign a single work order operation to a scheduling resource (2024 W2 - FSM 17.0), a crew shell or a team (2024 W3 - FSM 18.0). This new assignation process is a simplified version respect to the assignation process of the daily plan.
It is possible to call:
-
GET /scheduling/r1/schedule-work to view the scheduling record created.
-
GET /work-orders/execution/r1/interventions to view the intervention record related to this scheduling.
Key Differences from the Daily Plan Functionality
-
Linked activity and work order by order are not supported.
-
Real-time management is not supported.
-
Activities cannot be split across multiple work shifts.
-
Timesheet, Multistage, Bundler, DCS, and other FSM modules are not managed.
-
Only one work order operation can be assigned at a time.
-
The activity can only be assigned as the last work shift activity.
-
Only the real plan is considered.
Preliminary Workflow
-
If
assistantsWorkShiftsIdisnull, the assignment is for a work shift related to a single resource or a Crew Shell. Otherwise, the request is related to a Team.
A - Case Single Resource or Crew Shell Assignment
-
Check Crew Shell Membership
-
If
workShiftIdis related to a member of a crew shell, return error MANUAL_SCHED_026.
-
-
If crew shell check that crew shell is active, if not return error MANUAL_SCHED_030.
-
Activity Check
-
Check if the workOrderOperation is schedulable. Examples:
-
Verify if
workOrderOperationId.statusIdis one of the following:SCHEDULABLE,TO_RESCHEDULE,LOCKED. If not, return error MANUAL_SCHED_003. -
Verify if
workOrderOperationId.workOrderId.operationsAssignmentisDISTINCT. If not, return error MANUAL_SCHED_028.
-
-
-
Check Freezing Day
-
Check if the operation center from workOrderOperationId.workOrderId.operationCenterId has daily freezing active. If yes, the start date of the work shift cannot be earlier than yesterday. If not active, calculate the date beyond which pasting is not allowed. If the start date of the work shift is earlier than this freezing day, the paste is not possible.
-
-
Retrieve Intervention
-
Search for an intervention record with
intervention.workOrderOperationId = {workOrderOperationId}. If a record is found use this record. -
Otherwise, create a new intervention.
-
-
Create Scheduling Record
-
Set
scheduling.workShiftId = {workShiftId}. -
Set
scheduling.interventionIdto the previously createdinterventionId. -
Set
scheduling.stateIdtoSCHEDULED. -
Set
scheduling.workOrderOperationId = {workOrderOperationId}. -
Set
scheduling.realPlantotrue. -
If
workOrderOperationId.currentDurationis notnull, getworkOrderOperationId.defaultDuration; otherwise, getcurrentDuration.-
Set the retrieved value to
scheduling.duration.
-
-
Calculate Coordinates of the Previous Activity (or Start of Shift Coordinates):
-
Uses the VRP using the coordinates of the previous activity and the coordinates of the new activity to determine the transfer time and distance for the new activity.
-
Set related scheduling fields:
-
Set
scheduling.distanceFromPrevious -
Set
scheduling.timeFromPrevious -
Set
scheduling.distanceToNext -
Set
scheduling.timeToNext -
Set
scheduling.startDate -
Set
scheduling.endDate -
Set
scheduling.arrivalDate -
Set
scheduling.breakTime
-
-
-
Update Work Shift Tour Data :
-
We take all the activities present in the shift and calculate the start and end coordinates and the time taken.
-
Check scheduled time on the work shift.
-
If
endTourDateis greater thanworkShiftId.endDate:-
If
operationCenterId.admittedOvertimeis greater than 0:-
Calculate
endOverTimeDatefromworkShiftId.endDateand admitted overtime. IfadmittedOvertimeis greater than0andendTourDateis greater thanendOvertimeDate, return error MANUAL_SCHED_022.
-
-
Otherwise, return error MANUAL_SCHED_021.
-
-
-
-
-
Update Intervention data:
-
If
automaticValidationistrueandscheduling.interventionId.statusIdisOPEN:-
Set
scheduling.interventionId.statusIdtoFIXED. -
If we are in crew shell assignment the business logic triggers the checks for crew shells(i.e. check if crew shell is not empty and with a foreman assigned).
-
-
set
scheduling.interventionId.defaultDuration = scheduling.duration -
set
scheduling.interventionId.foremanId = scheduling.foreman
-
-
Update Work Order and Work Order Operation Status:
-
Calculate and update
workOrderOperationId.stateId. -
Calculate and update
workOrderOperationId.workOrderId.stateId.
-
B - Case Team Assignment
-
Activity Check
-
Check if the workOrderOperation is schedulable. Examples:
-
Verify if
workOrderOperationId.statusIdis one of the following:SCHEDULABLE,TO_RESCHEDULE,LOCKED. If not, return error MANUAL_SCHED_003. -
Verify if
workOrderOperationId.workOrderId.operationsAssignmentisDISTINCT. If not, return error MANUAL_SCHED_028.
-
-
-
Check Freezing Day
-
Check if the operation center from workOrderOperationId.workOrderId.operationCenterId has daily freezing active. If yes, the start date of the work shift cannot be earlier than yesterday. If not active, calculate the date beyond which pasting is not allowed. If the start date of the work shift is earlier than this freezing day, the paste is not possible.
-
-
Retrieve Intervention
-
Search for an intervention record with
intervention.workOrderOperationId = {workOrderOperationId}. If a record is found use this record. -
Otherwise, create a new intervention.
-
-
Create Scheduling Record
-
For each Team resource member
-
Set
scheduling.workShiftId = {workShiftId}. -
Set
scheduling.interventionIdto the previously createdinterventionId. -
Set
scheduling.stateIdtoSCHEDULED. -
Set
scheduling.workOrderOperationId = {workOrderOperationId}. -
Set
scheduling.realPlantotrue. -
If
workOrderOperationId.currentDurationis notnull, getworkOrderOperationId.defaultDuration; otherwise, getcurrentDuration.-
Set the retrieved value to
scheduling.duration.
-
-
-
For each team member
schedulingrecord, set theschedulingIdrelated to the team foreman. The field on the internal entity is calledforemanScheduling, but for the moment it will be not exposed via API. -
For each Team resource member scheduling:
-
Calculate Coordinates of the Previous Activity (or Start of Shift Coordinates):
-
Uses the VRP using the coordinates of the previous activity and the coordinates of the new activity to determine the transfer time and distance for the new activity.
-
Set related scheduling fields:
-
Set
scheduling.distanceFromPrevious -
Set
scheduling.timeFromPrevious -
Set
scheduling.distanceToNext -
Set
scheduling.timeToNext -
Set
scheduling.startDate -
Set
scheduling.endDate -
Set
scheduling.arrivalDate -
Set
scheduling.breakTime
-
-
-
Update Work Shift Tour Data :
-
We take all the activities present in the shift and calculate the start and end coordinates and the time taken.
-
Check scheduled time on the work shift.
-
If
endTourDateis greater thanworkShiftId.endDate:-
If
operationCenterId.admittedOvertimeis greater than 0:-
Calculate
endOverTimeDatefromworkShiftId.endDateand admitted overtime. IfadmittedOvertimeis greater than0andendTourDateis greater thanendOvertimeDate, return error MANUAL_SCHED_022.
-
-
Otherwise, return error MANUAL_SCHED_021.
-
-
-
-
-
-
Update Intervention data:
-
If
automaticValidationistrueandscheduling.interventionId.statusIdisOPEN:-
Set
scheduling.interventionId.statusIdtoFIXED.
-
-
set
scheduling.interventionId.defaultDuration = scheduling.duration -
set
scheduling.interventionId.foremanId = scheduling.foreman
-
-
Update Work Order and Work Order Operation Status:
-
Calculate and update
workOrderOperationId.stateId. -
Calculate and update
workOrderOperationId.workOrderId.stateId.
-
Header Parameters
Default.
Request Body Parameters
|
Field |
Validations |
Note |
|---|---|---|
|
workOrderOperationId |
|
|
|
workShiftId |
|
|
|
forceOvertimeAssignment |
|
|
|
automaticValidation |
|
|
|
assistantsWorkShiftsId |
|
|
Response documentation
Response payload fields
|
Field |
Note |
|---|---|
|
schedulingId |
the list of created schedulings |
Response error codes
MANUAL_SCHED_001, MANUAL_SCHED_002, MANUAL_SCHED_003, MANUAL_SCHED_004, MANUAL_SCHED_005, MANUAL_SCHED_006, MANUAL_SCHED_007, MANUAL_SCHED_008, MANUAL_SCHED_009, MANUAL_SCHED_010, MANUAL_SCHED_011, MANUAL_SCHED_012, MANUAL_SCHED_013, MANUAL_SCHED_014, MANUAL_SCHED_015, MANUAL_SCHED_016, MANUAL_SCHED_018, MANUAL_SCHED_019, MANUAL_SCHED_021, MANUAL_SCHED_022, MANUAL_SCHED_023, MANUAL_SCHED_024, MANUAL_SCHED_025, MANUAL_SCHED_026, MANUAL_SCHED_027, MANUAL_SCHED_028, MANUAL_SCHED_030