|
Http Verb |
POST |
|---|---|
|
Url |
/integration/scheduling/manual/r1/scheduling/activities-assignments |
|
Permissions required |
Core Additional Parameters: Edit (fsm.core.additionalparameter.edit) Organizational Structure Entities: View (fsm.core.structure.view) or Organizational Structure Entities: Edit (fsm.core.structure.edit) Resource Configuration: View (fsm.core.resource.configuration.view) WorkOrder: View (fsm.core.workorder.view) or WorkOrder: Edit (fsm.core.workorder.edit) WO Configuration: View (fsm.core.workorder.configuration.view) or WO Configuration: Edit (fsm.core.workorder.configuration.edit) |
|
Last Modified Version |
r1 |
|
Tech Tags |
|
|
Available Async |
No |
BPMN Diagram
Business Logic
This Integration API assigns a single work order operation to a scheduling resource or team or crew shell.
System verifies that one of the fields between identificationNumber, crewShellCode and team must be present. If more than one of those fields are present, the system will return a validation error.
System verifies that object team, if populated, must contain at least one element.
System verifies Permission Required and starts the elaboration that is organized in steps.
STEP 1 - External System Validation
System takes Input fields and checks their existence in internal configuration.
API Verb: GET
Resource: External Systems
Input: externalSystemCode, active=true
Output: externalSystemId
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 2 - Operation Center Retrieval
System takes Input fields and extract the Operation Center id.
API Verb: GET
Resource: Operation Centers
Input: operationCenterCode, active=true
Output: operationCenterId
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 3 - Resource Retrieval
System takes Input fields and extract the Resource id.
This step is skipped if Input fields are absent.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 4 - Team Retrieval
System verifies of the presence of object team populated in order to extract team members.
This step is skipped if team is absent.
STEP 4a - Resource Retrieval
System takes Input fields and extract team resource id.
API Verb: GET
Resource: Resources
Input: list of [identificationNumber], operationCenterId
Output: list of [resourceId]
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 4b - Team Member Retrieval
System takes Input fields and extracts output field.
API Verb: GET
Resource: Team Members
Input: list of [resourceId]
Output: list of [resourceId, teamLeader, teamId]
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 4c - Team Validation
System takes Input fields and extracts output field to verify the presence of single team.
If System can obtain the Output fields, removes records with teamCardinalityId = 1 →
-
If output contains more than one record → responds with error. Elaboration is stopped.
-
Else -> continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 5 - Crew Shell Retrieval
System verifies of the presence of field crew shell in order to extract crew shell members.
This step is skipped if crewShellCode is absent.
STEP 5a - Crew Shell Retrieval
System takes Input fields and extract the Crew Shell.
This step is skipped if Input fields are absent.
API Verb: GET
Resource: Crew Shells
Input: crewShellCode, operationCenterId, active=true
Output: crewShellId
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 5b - Crew Shell Members Retrieval
System takes Input fields and extract Crew Shell Members
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 6 - Work Order Retrieval
System takes Input fields and extract the Work Order id.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 7 - Work Order Operation Retrieval
System takes Input fields and extract the Work Order Operation id.
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 8 - Resource Missing Skills Check
This step is executed only if skillCheck in input is TRUE.
System takes Input fields and checks if resource has missing skills.
API Verb: GET
Resource: Resource Missing Skills
Input: list of [resourceId], workOrderOperationId
Output: skillIdList
If System can obtain the Output fields → continue to next step.
System takes Input fields and extract the skillCode for each skillId in skillIdList.
Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 9 - Work Shift Retrieval
STEP 9a - Resource Work Shift Retrieval
System takes Input fields and extract the Work Shift id.
EndDate is calculated from startDate → startDate + 1day
This step is skipped if input fields are absent.
API Verb: GET
Resource: Work Shifts
Input: list of [resourceId], startDate, endDate
Output: list of [workShiftId]
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 9b- Crew Shell Work Shift Retrieval
System takes Input fields and extract the Crew Shell Shift id.
EndDate is calculated from startDate → startDate + 1day
This step is skipped if input fields are absent.
API Verb: GET
Resource: Crew Shell Shifts
Input: crewShellId, startDate, endDate
Output: workShiftId
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 10 - Activities Assignments
System takes Input fields and assigns a single work order operation to a scheduling resource.
In case of team assignment the system must send:
-
workShiftId: work shift related teamLeader
-
assistantWorkShiftsId: list of work shift related to other team members
API Verb: POST
Resource: Activities Assignments
Input: workShiftId, workOrderOperationId, assistantWorkShiftsId, automaticValidation, forceOvertimeAssignment
Output: schedulingIds
If Creation outcome is SUCCESS → elaboration is stopped. See Response payload fields.
If Creation outcome is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
-
Others - see link in Resource
Path Parameters
Not present.
Query String Parameters
Start with a ? and includes parameters listed one after the another separated by &.
Not applicable.
Header Parameters
Parameters included in the request headers. Generally, request headers are used to keep authorization parameters.
Default.
Request Body Parameters
Request body parameters are used when clients send data to the API. They are shipped in a JSON Object only in POST, PUT, or PATCH requests.
|
Field |
|
Description |
Mandatory |
Constraint |
|
|---|---|---|---|---|---|
|
1 |
externalSystemCode |
|
External system code |
Y |
Not Blank |
|
2 |
identificationNumber |
|
Resource identification number |
N |
Absent or not Blank |
|
3 |
crewShellCode |
|
Crew Shell Code |
N |
Absent or not Blank |
|
4 |
team (minOccurs=0, maxOccurs=N) |
identificationNumber |
Team Member identification Number |
N |
Absent or not Blank |
|
5 |
workOrderCode |
|
Work Order code |
Y |
Not Blank |
|
6 |
operationCenterCode |
|
Operation Center code |
Y |
Not Blank |
|
7 |
startDate |
|
Start date |
Y |
Not Null |
|
8 |
skillCheck |
|
Enable check on resource’s missing skills |
Y |
Not Null |
|
9 |
automaticValidation |
|
Flag to enable the automatic validation of the assignment. Default 'false' |
N |
Absent or Not Blank |
|
10 |
forceOvertimeAssignment |
|
Flag to allow the forcing of overtime assignment. Default 'false' |
N |
Absent or Not Blank |
The objects in input could have also the extension object that allows to add additional, customized data to this API. More info here How to use APIs: Custom data via Extension.
Request example
{
"extension": {
"myFieldName": "myValue"
},
"externalSystemCode": "string",
"identificationNumber": "string",
"workOrderCode": "string",
"operationCenterCode": "string",
"startDate": "2024-04-17T12:30:00.000Z",
"skillCheck": true
}
Response documentation
Response payload fields
Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html
Extension fields:
|
Field |
Description |
Note |
|---|---|---|
|
List of id |
Created scheduling ids |
Only for SUCCESS |
|
code |
Extension member of a Problem Details Object that contains the error code |
Only for ERROR |
Response example
Error example
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "External system string does not exist",
"instance": "/integration/scheduling/manual/r1/scheduling/activities-assignments",
"code": "IA001_001"
}