|
Http Verb |
POST |
|---|---|
|
Url |
/integration/work-orders/multistages/r1/groups |
|
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) 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 (TBD)
Business Logic
This Integration API creates or updates a multistage relationship group between Work Order Operations.
Both sourceOperation and targetOperation object, one of workOrderCode or workOrderExternalCode must be present. If workOrderCode is provided it has the precedence among the other fields.
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 Validation
System takes Input fields and checks their existence in internal configuration.
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 - Work Order Validation
System takes sourceOperation and targetOperation input fields for each dependency item and checks their existence.
API Verb: GET
Resource: Work Orders
Input: workOrderCode OR [externalSystemId, workOrderExternalCode]
Output: workOrderId
If System can obtain the Output fields for all input fields → continue to next step.
If System can’t obtain the Output fields for at least one input field → responds with error. Elaboration is stopped.
STEP 4 - Work Order Operation Validation
System takes sourceOperation and targetOperation input fields for each dependency item and checks their existence.
API Verb: GET
Resource: Work Order Operations
Input: workOrderId, workOrderOperationCode
Output: workOrderOperationId
If System can obtain the Output fields for all input fields → continue to next step.
If System can’t obtain the Output fields for at least one input field → responds with error. Elaboration is stopped.
STEP 5 - Dependency Type Validation
System takes each dependency type code and verifies that the relationship type is configured in Multistage domain.
serve lo step o lo mettiamo come logica di input iniziale?
If System can obtain the Output fields for all dependency types → continue to next step.
If System can’t obtain the Output fields for at least one dependency type → responds with error. Elaboration is stopped.
STEP 6 - Multistage Group Validation (TDB)
System takes Input fields and checks their existence.
If System can obtain the Output fields → continue to step Multistage Group Update.
If System can’t obtain the Output fields → continue to step Multistage Group Creation.
STEP 7 - Multistage Group Update (TDB)
System takes Input fields and updates the multistage group.
API Verb: PATCH
Resource: Multistages
Input: multistageGroupId, operationCenterId, description, resolved operations, dependencies
Output: Response State, id, code
If Response State is SUCCESS → elaboration is stopped. See Response payload fields.
If Response State is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
-
Others - see link in Resource
STEP 8 - Multistage Group Creation (TDB)
O. ly if validation is passed and the group does not exist, system takes Input fields and creates the multistage group dependencies.
API Verb: POST
Resource: Multistages
Input: externalSystemId, operationCenterId, externalCode, description, resolved operations, dependencies
Output: Response State, id, code
If Response State is SUCCESS → elaboration is stopped. See Response payload fields.
If Response State is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
-
Others - see link in Resource
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 |
|---|---|---|---|---|
|
|
externalSystemCode |
External System Code |
Y |
Not Blank |
|
operationCenterCode |
Operations Center Code |
Y |
Not Blank |
|
|
externalCode |
External Code |
Y |
Not Blank |
|
|
description |
Description |
N |
|
|
|
dependencies |
typeCode |
Relationship Type Code Value: SS, FS, SD |
Y |
Not Blank |
|
minOffset |
Min Offset Tolerance (minutes) |
N |
|
|
|
maxOffset |
Max Offset Tolerance (minutes) |
N |
|
|
|
critical |
Flag critical |
N |
|
|
|
sourceOperation |
workOrderCode |
Work Order Code |
N |
|
|
workOrderExternalCode |
Work Order External Code |
N |
|
|
|
workOrderOperationCode |
WO Operation Code |
Y |
|
|
|
targetOperation |
workOrderCode |
Work Order Code |
N |
|
|
workOrderExternalCode |
Work Order External Code |
N |
|
|
|
workOrderOperationCode |
WO Operation Code |
Y |
|
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": "SAP",
"operationCenterCode": "OC_PGE_BAYAREA",
"externalCode": "PRJ-2026-XYZ",
"description": "North Area Phase 1",
"dependencies": [
{
"extension": {
"myFieldName": "myValue"
},
"typeCode": "FS",
"minOffset": 10,
"maxOffset": 30,
"critical": true,
"sourceOperation": {
"workOrderExternalCode": "400012345",
"workOrderOperationCode": "0010"
},
"targetOperation": {
"workOrderExternalCode": "400012346",
"workOrderOperationCode": "0020"
}
},
{
"typeCode": "SS",
"minOffset": 0,
"maxOffset": 15,
"critical": false,
"sourceOperation": {
"workOrderCode": "WO-00045871",
"workOrderOperationCode": "0030"
},
"targetOperation": {
"workOrderExternalCode": "400012347",
"workOrderOperationCode": "0010"
}
}
]
}
Response documentation
Response payload fields
Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html
Extension fields:
|
Field |
Description |
Note |
|---|---|---|
|
id |
Id of the resource created |
Only for SUCCESS |
|
code |
String Code of the resource created |
Only for SUCCESS |
|
code |
Extension member of a Problem Details Object that contains the error code |
Only for ERROR |
Response example
{
"id": 123456,
"code": "CO0234590"
}
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "External system string does not exist",
"instance": "/integration/work-orders/r1/work-orders",
"code": "IA001_001"
}
Response error codes