|
Http Verb |
POST |
|---|---|
|
Url |
/integration/assets/r1/asset-measuring-elements/measures |
|
Permissions required |
Technical Object: View (fsm.core.technicalobject.facility.view) or Technical Object: Edit (fsm.core.technicalobject.facility.edit) and Measuring Element: Edit (fsm.core.technicalobject.measure.edit) |
|
Last Modified Version |
r1 |
|
Tech Tags |
|
|
Available Async |
No |
BPMN Diagram
Business Logic
This Integration API inserts, updates and validates a measure related to an asset measuring element.
At least one between assetCode and assetExternalCode must be specified.
At least one between identificationNumber and secondaryIdentificationNumber must be specified.
At least one between value and deltaValue must be specified.
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 - Asset Existence
System takes Input fields and checks their existence.
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 - Operation Center Validation
System takes Input fields and checks their existence in internal configuration.
This step is skipped if input fields are absent.
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 4 - Measuring Element Existence
System takes Input fields and checks their existence and their correct state.
System transcode status “WORKING” to statusId = 27001.
API Verb: GET
Resource: Measuring Element
Input: assetId, code, statusId = 27001
Output: measuringElementId, catalogGroupId, characteristicId
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 5 - Measure Existence
System takes Input fields and existing measures to validate
This step is skipped if input field are absent.
API Verb: GET
Resource: Measuring-elements/{measuringElementId}/measures
Input: assetId, measuringElementId, list of [externalCode]
Output: list of [measureId, externalCode, statusId]
If System can obtain the Output fields and at least one measureId has statusId != 1 → responds with error. Elaboration is stopped.
If System can obtain the Output fields and no measureId has statusId != 1 → Continue to next step.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
STEP 6 - Catalog Code Existence
System takes Input fields and checks their existence.
This step is skipped if input fields are absent.
API Verb: GET
Resource: Catalog Codes
Input: catalogGroupId, catalogCode, active=true
Output: catalogCodeId
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 7 - Resource Existence
System takes Input fields and checks their existence.
API Verb: GET
Resource: Resources
Input: identificationNumber, secondaryIdentificationNumber, operationCenterId
Output: measuringUserId (resourceId), operationCenterId, loan
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
If System can obtain the Output fields → system evaluates the operationCenterId in Input:
-
if operationCenterId in Input is not present, system takes only the resource in output with loan=false → continue to next step.
-
if operationCenterId in Input is present, System verifies that in output
-
if resource not exist → responds with error. Elaboration is stopped.
-
If a resource exists, the system verify if exists a resource with same operationCenter
-
if exists selects the one with loan=false→ continue to next step.
-
if not exist → responds with error. Elaboration is stopped.
-
-
Error Type:
-
Others - see link in Resource
STEP 8 - Measures Measure Creation or Update
System verifies the presence of existing measure to be updated from STEP Measure Existence
Step 8b - Measure Update
System takes Input fields and updates already existing entities.
API Verb: PATCH
Resource: Measuring-elements/{measuringElementId}/measures (Batch)
Input: assetId, measuringElementId, list of [measureId, measuringDate, measuringUserId, value, deltaValue, rotations, note, unfeasible, catalogCodeId]
Output: Response State (only for SUCCESS)
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 8c - Measure Creation
System takes Input fields and creates the entity.
The system generates a unique identifier for each externalCode if not populated from external system.
API Verb: POST
Resource: Measuring-elements/{measuringElementId}/measures (Batch)
Input: assetId, measuringElementId, list of [externalCode, measuringDate, measuringUserId, value, deltaValue, rotations, note, unfeasible, catalogCodeId]
Output: Response State, list of [measureId] (only for SUCCESS)
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 9 - Measure Validation
System takes Input fields and validates measures.
This step is skipped if validateMeasures is false.
API Verb: POST
Resource: Measuring-elements/{measuringElementId}/measures/validations (Batch)
Input: assetId, measuringElementId, list of [measureId]
Output: Response State (only for SUCCESS)
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 10 - Measure Retrieval
System takes Input fields and retrieves output fields.
API Verb: GET
Resource: Measuring-elements/{measuringElementId}/measures
Input: assetId, measuringElementId, list of [measureId]
Output: list of [measureId, externalCode]
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 applicable.
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 |
assetCode |
|
Asset code |
N |
Null or Not Blank |
|
3 |
assetExternalCode |
|
Asset External Code |
N |
Null or Not Blank |
|
4 |
operationCenterCode |
|
Operation Center Code related to the measure registered. |
N |
Null or Not Blank |
|
5 |
measuringElementCode |
|
Measuring Element Code |
Y |
Not Blank |
|
6 |
validateMeasures |
|
Flag that indicates if that measure validation should be performed or not |
N |
Null or Not Blank Default: true |
|
7 |
measures (minOccurs=1, maxOccurs=N) |
resourceIdentificationNumber |
Identification Number of the resource that registered the measure |
N |
Null or Not Blank
|
|
8 |
resourceSecondaryIdentificationNumber |
Secondary Identification Number of the resource that registered the measure |
N |
Null or Not Blank |
|
|
9 |
externalCode |
Identifier of the measure. Alias ‘uuid’ (will be deprecated in 2027W2) |
N |
Null or Not Blank |
|
|
10 |
measuringDate |
Measuring Date |
Y |
Not Blank |
|
|
11 |
value |
Measure value related to measuring elements with characteristic defined |
N |
Null or Not Blank |
|
|
12 |
deltaValue |
Measure delta value related to measuring elements with characteristic defined |
N |
Null or Not Blank |
|
|
13 |
rotations |
Rotations related to measuring elements with characteristic defined |
N |
Null or Not Blank |
|
|
14 |
catalogCode |
Catalog Code related to measuring elements with catalog group defined |
N |
Null or Not Blank |
|
|
15 |
note |
Note |
N |
Null or Not Blank |
|
|
16 |
unfeasible |
Unfeasible flag. Set it to true if the measure was impossible to do and you want to create a new measure that gets the values from the previous measure |
N |
Null 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
Insert
{
"extension": {},
"externalSystemCode": "SYS001",
"assetCode": "ASSET123",
"operationCenterCode": "OC-ROME",
"measuringElementCode": "TEMP-SENSOR-001",
"measure": [ {
"extension": {},
"externalCode": "1234",
"resourceIdentificationNumber": "RESOURCE-XYZ-OC-ROME",
"measuringDate": "2025-06-06T15:00:00Z",
"value": 25.5,
"rotations": 1200,
"catalogCode": "CAT-A",
"note": "Standard Temperature Registered.",
"unfeasible": false
} ]
}
Response documentation
Response payload fields
Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html
Extension fields:
|
Field |
Description |
Note |
|---|---|---|
|
id |
List of id of the resource created |
Only for SUCCESS case |
|
externalCode |
List of externalCode of the resource created Alias uuid (will be deprecated in 2027W2) |
Only for SUCCESS case |
|
code |
Extension member of a Problem Details Object that contains the error code |
Only for ERROR |
Response example
[
{
"id": 123456,
"externalCode":"1234"
},
{
"id": 123457,
"externalCode":"4567"
}
]
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "External system string does not exist",
"instance": "/integration/workforce/r1/resources",
"code": "IA001_001"
}