|
Http Verb |
GET |
|---|---|
|
Url |
/integration/work-orders/r1/work-orders |
|
Permissions required |
Core Additional Parameters: Edit (fsm.core.additionalparameter.edit) WorkOrder: View (fsm.core.workorder.configuration.view) WO Configuration: View (fsm.core.workorder.configuration.view) Organizational Structure Entities: View (fsm.core.structure.view) Technical Object: View (fsm.core.technicalobject.facility.view) |
|
Last Modified Version |
r1 |
|
Tech Tags |
MULTILANGUAGE-FIELDS |
|
Available Async |
No |
BPMN Diagram
Business Logic
This Integration API gets a Work Order with all its Operations.
One of code or externalCode must be present. If code is provided it has the precedence among the other fields. TypeCode, if present, is used with externalSystemCode (If present) and externalCode for filtering.
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.
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 - Work Order Type Validation
System takes Input fields and checks their existence in internal configuration.
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 3 - Work Order Retrieve
System takes Input fields and checks their existence.
API Verb: GET
Resource: Work Orders
Input: [code] OR [externalSystemId, externalCode, typeId] OR [externalSystemId, externalCode]
Output: id, code, startDate, endDate, description, releaseDate, closingDate, externalCode, operationsAssignment, notes, appointmentStartDate, appointmentEndDate, assetCode, accountCode, type, status, operationCenter, aggregateDuration, aggregateCardinality, aggregateResidualDuration, urgency, workCenter, parentWorkOrderId, extension
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 - Work Order Operation Retrieve
System takes Input fields and checks the existence of the operation.
API Verb: GET
Resource: Operations
Input: workOrderId, page,0, num,0
Output: id, defaultDuration, executionOrder, description, currentDuration, code, startDate, endDate, outcomeStartDate, outcomeEndDate, note, status, type, assetCode, accountCode, activityId, cardinality, activityAddressId
If System can obtain the Output fields → continue to next step.
If System can’t obtain the Output fields → continue to next step.
Error Type:
-
Others - see link in Resource
STEP 5 - Parent Work Order Transcode
System takes Input fields and checks their existence.
This step is skipped if Input field is absent or value is -1.
API Verb: GET
Resource: work-orders/{workOrderId}
Input: id (parentWorkOrderId)
Output: externalCode (parentExternalCode)
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 6 - Address Transcode
System takes Input fields and gets the resource.
In the request there are the address inside Work Order and all the addresses and activityAddress inside the Operations' array.
API Verb: GET
Resource: Addresses
Input: list of [addressId]
Output: description, countryCode, districtCode, municipality, municipalityCode, locality, postalCode, street, streetNumber, streetNumberExtension, floor, lot, staircase, apartment, directions, yCoordinate, xCoordinate, toponym, targetId, extension
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 - Country Transcode
System takes Input fields and gets the resource.
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 - District Transcode
System takes Input fields and gets the resource.
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 9 - Asset Transcode
System takes Input fields and gets the resource.
If System can obtain the Output fields → continue to step Work Order Type Transcode.
If System can’t obtain the Output fields → continue to next step because it is possible that the Work Order is associated to an Account.
Error Type:
-
Others - see link in Resource
STEP 10 - Asset Types Retrieve
System takes Input fields and gets the resource..
This step is skipped if step Asset Transcode didn’t retrieve any assetCode
If System can obtain the Output fields → continue to step Work Order Type Transcode.
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
Error Type:
-
Others - see link in Resource
STEP 11 - Linear Asset Locations Retrieve
System takes Input fields and gets the resource.
System performs a call for each assetId associated with a linearAsset=true belonging to work order header and work order operations .
This step is skipped if step Asset Transcode didn’t retrieve any assetCode
API Verb: GET
Resource: Linear Asset Locations
Input: assetId
Output: startXCoordinate, startYCoordinate, endPointXCoordinate, endPointYCoordinate, accessTime, accessXCoordinate, accessYCoordinate, accessEndPointXCoordinate, accessEndPointYCoordinate, accessEndPointAccessTime, invertible
If System can obtain the Output fields → continue to step Work Order Type Transcode.
If System can’t obtain the Output fields → continue to step Work Order Type Transcode.
Error Type:
-
Others - see link in Resource
STEP 12 - Account Transcode
System takes Input fields and gets the resource.
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 13 - Work Order Type Transcode
System takes Input fields and gets the resource.
This step is skipped if step Work Order Type Validation was done.
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 14 - Status Transcode
System takes Input fields and gets the resource.
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 15 - Operation Center Transcode
System takes Input fields and gets the resource.
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 16 - Team Cardinality Transcode
System takes Input fields and gets the resource.
This step is done only if operationsAssignment='AGGREGATED' and System uses Cardinality taken from Work Order header.
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 17 - Urgency Type Transcode
System takes Input fields and gets the resource.
This step is skipped if Input fields are null.
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 18 - Work Center Transcode
System takes Input fields and gets the resource.
This step is skipped if Input fields are null.
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 19 - Work Cycle Transcode
System takes Input fields and gets the resource.
This step is skipped if Input fields are null.
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 20 - Operations Transcode
The following steps are executed for each Operations retrieved.
STEP 20a - Operation Status Transcode
System takes Input fields and gets the resource.
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 20b - Operation Type Transcode
System takes Input fields and gets the resource.
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 20c - Team Cardinality Transcode
System takes Input fields and gets the resource.
This step is done only if operationsAssignment='DISTINCT' and System uses Cardinality taken from Work Order operations.
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 20d - Activity Transcode
System takes Input fields and gets the resource.
If System can obtain the Output fields → elaboration is stopped. See Response payload fields
If System can’t obtain the Output fields → responds with error. Elaboration is stopped.
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 &.
Filter
|
Field |
Description |
Mandatory |
Constraint |
|
|---|---|---|---|---|
|
1 |
_language |
Language option for the response. It supports the following values: - ALL: Request the server to return every possible translation of the response data. - USER |
N |
Null or Not Blank |
|
2 |
_exclude |
Allows to specify a subset of data that need to be excluded from the response |
N |
Null or Not Blank |
|
3 |
_fields |
Allows to specify a subset of data that need to be returned |
N |
Null or Not Blank |
|
4 |
externalSystemCode |
External System Code |
N |
Null or Not Blank |
|
5 |
code |
Work Order Code |
N |
Null or Not Blank |
|
6 |
externalCode |
Work Order Code in External System |
N |
Null or Not Blank |
|
7 |
typeCode |
Work Order Type Code |
N |
Null or Not Blank |
Fields
The parameter _fields allows to choose output fields. More info here How to use APIs: Output fields selection.
Header Parameters
Parameters included in the request headers. Generally, request headers are used to keep authorization parameters.
Default.
Request example
{baseUrl}/integration/work-orders/r1/work-orders?externalSystemCode=SAP&externalCode=N008965
Response documentation
Response payload fields
|
|
Field |
Field Type |
Description |
|
|---|---|---|---|---|
|
1 |
|
id |
|
Id |
|
2 |
|
address |
|
|
|
3 |
|
type |
|
|
|
4 |
|
status |
|
|
|
5 |
|
externalSystem |
|
|
|
6 |
|
code |
|
Code |
|
7 |
|
externalCode |
|
External Code |
|
8 |
|
externalParentCode |
|
External Parent Code |
|
9 |
|
creationDate |
|
Creation Date |
|
10 |
|
startDate |
|
Start Date |
|
11 |
|
endDate |
|
End Date |
|
12 |
|
operationCenter |
|
|
|
13 |
|
description |
|
Description |
|
14 |
|
releaseDate |
|
Release Date |
|
15 |
|
closingDate |
|
Closing Date |
|
16 |
|
operationsAssignment |
|
Type of Operation Assignment: DISTINCT or AGGREGATED |
|
17 |
|
aggregateDuration |
|
Duration for ‘operationsAssignment’='AGGREGATED' |
|
18 |
|
aggregateCardinality |
|
|
|
19 |
|
aggregateResidualDuration |
|
Residual Duration for ‘operationsAssignment’='AGGREGATED' |
|
20 |
|
notes |
|
Notes |
|
21 |
|
urgency |
|
|
|
22 |
|
workCenter |
|
|
|
23 |
|
workCycle |
|
|
|
24 |
|
appointmentStartDate |
|
Appointment Start Date |
|
25 |
|
appointmentEndDate |
|
Appointment End Date |
|
26 |
|
accountCode |
|
Code of Account |
|
27 |
|
assetCode |
|
Code od Asset |
|
28 |
|
linearAssetLocation
|
Linear Asset Location |
|
|
29 |
operations |
id |
|
Operation Id |
|
30 |
status |
|
||
|
31 |
type |
|
||
|
32 |
defaultDuration |
|
Operation Default Duration |
|
|
33 |
executionOrder |
|
Operation Execution Order |
|
|
34 |
description |
|
Operation Description |
|
|
35 |
currentDuration |
|
Operation Remaining Time |
|
|
36 |
code |
|
Operation Code |
|
|
37 |
startDate |
|
Operation Start Date |
|
|
38 |
endDate |
|
Operation End Date |
|
|
39 |
outcomeStartDate |
|
Operation Outcome Start Date |
|
|
40 |
outcomeEndDate |
|
Operation Outcome End Date |
|
|
41 |
accountCode |
|
Operation Account Code |
|
|
42 |
linearAssetLocation |
Linear Asset Location |
||
|
43 |
assetCode |
|
Operation Asset Code |
|
|
44 |
address |
|
||
|
45 |
activityAddress |
|
||
|
46 |
cardinality |
|
||
|
47 |
activity |
|
||
|
48 |
note |
|
Operation Note |
urgencyObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
workCenterObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
cardinalityObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
operationCenterObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
externalSystemObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
statusObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
typeObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
workCycleObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
addressObject
|
Field |
Description |
|
|---|---|---|
|
1 |
description |
Description |
|
2 |
countryIsoAlphaCode |
Acronym of Nation (3 letters acronym) |
|
3 |
districtAcronym |
Acronym of District |
|
4 |
municipality |
Municipality |
|
5 |
municipalityCode |
Municipality Code |
|
6 |
locality |
Locality |
|
7 |
postalCode |
Postal Code |
|
8 |
street |
Street |
|
9 |
streetNumber |
Street Number |
|
10 |
streetNumberExtension |
Street Number Extension |
|
11 |
floor |
Floor |
|
12 |
lot |
Lot |
|
13 |
staircase |
Staircase |
|
14 |
apartment |
Apartment |
|
15 |
directions |
Directions |
|
16 |
yCoordinate |
Latitude |
|
17 |
xCoordinate |
Longitude |
|
18 |
toponym |
Toponym |
operationStatusObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
operationTypeObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
activityObject
|
Field |
Description |
|
|---|---|---|
|
1 |
code |
Code |
|
2 |
description |
Description |
Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html
Extension fields:
|
Field |
Description |
Note |
|---|---|---|
|
code |
Extension member of a Problem Details Object that contains the error code |
Only for ERROR |
Response example
{
"extension": {
"myFieldName": "myValue"
},
"id": 9007199254740991,
"code": "string",
"externalSystem": {
"code": "SAP",
"description": "SAP"
},
"startDate": "2024-02-07T10:16:34.196Z",
"endDate": "2024-02-07T10:16:34.196Z",
"description": "string",
"releaseDate": "2024-02-07T10:16:34.196Z",
"closingDate": "2024-02-07T10:16:34.196Z",
"creationDate": "2024-02-07T10:16:34.196Z",
"externalCode": "string",
"operationsAssignment": "AGGREGATED",
"notes": "string",
"appointmentStartDate": "2024-02-07T10:16:34.196Z",
"appointmentEndDate": "2024-02-07T10:16:34.196Z",
"address": {
"extension": {},
"countryCode": "string",
"districtCode": "string",
"street": "string",
"streetNumber": 9007199254740991,
"yCoordinate": 0.1,
"xCoordinate": 0.1,
"postalCode": "string",
"toponym": "string",
"municipality": "string",
},
"activityAddress": {
"extension": {},
"countryCode": "string",
"districtCode": "string",
"street": "string",
"streetNumber": 9007199254740991,
"yCoordinate": 0.1,
"xCoordinate": 0.1,
"postalCode": "string",
"toponym": "string",
"municipality": "string",
},
"type": {
"extension": {},
"code": "EXT-EXCAV-IELBT",
"description": [
{
"lang": "en",
"value": "Extraordinary maintenance / Excavation / Electrical system LV"
}
]
},
"status": {
"extension": {},
"code": "5",
"description": "Schedulable"
},
"operationCenter": {
"extension": {},
"code": "OCGAS",
"description": [
{
"lang": "en",
"value": "Center Gass OC"
}
]
},
"aggregateDuration": 9007199254740991,
"aggregateCardinality": {
"extension": {},
"code": "1",
"description": "SINGOLA"
},
"aggregateResidualDuration": 9007199254740991,
"urgency": {
"extension": {},
"code": "BLOCK",
"description": [
{
"lang": "en",
"value": "Blocking"
}
]
},
"workCycle": {
"code": "WC_001",
"description": "Work Cycle 001"
},
"accountCode": "ACC_001",
"assetCode": "",
"operations":[
{
"extension": {
"myFieldName": "myValue"
},
"id": 9007199254740991,
"defaultDuration": 9007199254740991,
"executionOrder": 9007199254740991,
"description": "string",
"currentDuration": 9007199254740991,
"code": "string",
"startDate": "2024-02-07T10:20:12.344Z",
"endDate": "2024-02-07T10:20:12.344Z",
"outcomeStartDate": "2024-02-07T10:20:12.344Z",
"outcomeEndDate": "2024-02-07T10:20:12.344Z",
"note": "string",
"status": {
"code": "2",
"description": "Schedulabile"
},
"type": {
"extension": {},
"code": "ING-INT-DEF-EPOM",
"description": [
{
"lang": "en",
"value": "Generic inspection/Internal/Default"
}
]
},
"assetCode": "ACC_001",
"accountCode": "",
"address": {
"extension": {},
"description": "INITIAL ADDRESS",
"countryIsoAlphaCode": "IT",
"districtAcronym": "MI",
"municipality": "MILANO",
"municipalityCode": "015146",
"locality": "MILANO",
"postalCode": "20161",
"street": "FRATELLI BELTRAMI",
"streetNumber": 21,
"streetNumberExtension": "A",
"yCoordinate": 0.1,
"xCoordinate": 0.1,
"toponym": "VIA"
},
"cardinality": {
"extension": {},
"code": "1",
"description": "SINGOLA"
},
"activity": {
"extension": {},
"code": "01",
"description": "Activity 1"
}
}
]
}
{
"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"
}