|
Http Verb |
POST |
|---|---|
|
Url |
/integration/territory/organizational-structures/r1/work-centers |
|
Permissions required |
Core Additional Parameters: Edit (fsm.core.additionalparameter.edit)
or WO Configuration: Edit (fsm.core.workorder.configuration.edit) |
|
Last Modified Version |
r1 |
|
Tech Tags |
MULTILANGUAGE-FIELDS |
|
Available Async |
No |
BPMN Diagram
Business Logic
This Integration API creates or updates a Work Center.
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.
API Verb: GET
Resource: Operation Center
Input: list of [operationCenterCode]
Output: list of [operationCenterId,operationCenterCode]
If Response State is SUCCESS → continue to next step.
If Response State is ERROR → elaboration is stopped. See Response payload fields.
STEP 3 - Work Center Validation
System takes Input fields and checks their existence.
If System can obtain the Output fields → Update → continue to next step.
If System can’t obtain the Output fields → Creation → continue to Work Center Creation STEP.
STEP 4 - Work Center Update
System takes Input fields and updates Work Center.
API Verb: PATCH
Resource: Work Centers/{workCenterId}
Input: workCenterId, code, description, active, order
Output: Response State, code
If Response State is SUCCESS → continue to Operation Center and Work Center Relationship Validation step
If Response State is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
Others - see link in Resource
STEP 5 - Work Center Creation
System takes Input fields and creates Work Center.
API Verb: POST
Resource: Work Centers
Input: code, description, active, order
Output: Response State, code, workCenterId
If Response State is SUCCESS → continue to Operation Center and Work Center Relationship Creation step
If Response State is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
Others - see link in Resource
STEP 6 - Operation Center and Work Center Relationship Validation
System takes Input fields and verifies the relationship between Work Center and its Operation Centers.
API Verb: GET
Resource: /{workCenterId}/operation-centers
Input: workCenterId
Output: list of [operationCenterId]
If System can obtain the Output fields → system evaluate the object operationCenter in Input:
-
If operationCenterId is not present in the object → continue to STEP Operation Center and Work Center Relationship Creation
-
If operationCenterId is not present in the object but a row exists in the system for the same operationCenterId → continue to STEP Operation Center and Work Center Relationship Cancellation
-
If operationCenterId is present in the object → no update needed
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
Others - see link in Resource
STEP 7 - Operation Center and Work Center Relationship Deletion
For each operationeCenterId retrieved in the previous step but not present in input operationCenter object.
API Verb: DELETE
Resource: /work-centers/{workCenterId}
Input: operationCenterId, workCenterId
Output: Response State
If Response State is SUCCESS → continue to next step.
If Response State is ERROR → elaboration is stopped. See Response payload fields.
Error Type:
Others - see link in Resource
STEP 8 - Operation Center and Work Center Relationship Creation
For each input operationCenterId but not present in the operation center list.
API Verb: POST
Resource: /{operationCenterId}/work-centers
Input: operationCenterId, workCenterId
Output: Response State
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
Path Parameters
As their name suggests, they are included in the URL path of the endpoint.
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 |
code |
|
Work Center Code |
Y |
Not Blank |
|
3 |
description |
|
Work Center Description |
Y |
Not Blank |
|
4 |
active |
|
Flag for activation/deactivation (default=true) |
N |
|
|
5 |
order |
|
Sorting order |
N |
|
|
6 |
operationCenter (minOccurs=0, maxOccurs=N) |
operationCenterCode |
Associated Operation Center Codes |
N |
|
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
{
"externalSystemCode": "SAP_S4",
"code": "WC_MECH_01",
"description": "Mechanical Maintenance",
"active": true,
"order": 1,
"operationCenter": [
{
operationCenterCode:"AAAAAA"
}
]
"extension": {
"costCenter": "CC-1001",
"plant": "BAY_AREA"
}
}
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": 1581,
"code": "OC_PGE_BAYAREA"
}
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "Structure code STR_MAIN does not exist",
"instance": "/integration/territory/organizational-structures/r1/operation-centers",
"code": "IA001_001"
}