Create or Cancel a Work Order for a Forecast

post

/fscmRestApi/resources/11.13.18.05/maintenanceForecasts/action/manageForecastWorkOrders

Create a work order for a forecast due date, if there isn't already a work order associated to the forecast due date. If there is a work order already associated to the forecast due date, you can cancel the existing order and optionally create a new work order.

Request

Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Supported Media Types
Request Body - application/vnd.oracle.adf.action+json ()
Root Schema : schema
Type: object
Show Source
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Body ()
Root Schema : schema
Type: object
Show Source
  • If the action completes successfully, then manageForecastWorkOrders returns the identification of the maintenance work order.
Back to Top

Examples

Example 1

This example describes how to use a special action to create a work order for a maintenance forecast due date that's not skipped and when there's no existing active work order.

Example 1 cURL Command

Use the following cURL command to submit a request on the REST resource.

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/maintenanceForecasts"

Example 1 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
"name": "manageForecastWorkOrders",
"parameters": [
    {
    "forecastId": 13465
    },
    {
    "workOrderActionCode": "ORA_CREATE"
    }
]
}

Example 1 Response Body

The following example includes the contents of the response body in JSON format:

{
    "ForecastId": 20354,
    "ForecastStatusCode": "ORA_SCHEDULED",
    "ForecastStatus": "Scheduled",
    "ProgramOrganizationId": 300100113363336,
    "ProgramOrganizationCode": "OPS_ORG_A",
    "ProgramId": 300100583272981,
    "ProgramCode": "MAINTENANCE_PROGRAM",
    "ProgramName": "MAINTENANCE_PROGRAM",
    "ProgramTypeCode": "ORA_MAINTENANCE",
    "ProgramType": "Maintenance",
    "ProgramSubTypeCode": "Subtype 1",
    "ProgramSubType": "Subtype 1 M",
    "ProgramReference": "PREF123",
    "GlobalAssetsFlag": true,
    "RequirementName": "ACO_WR_1",
    "ItemId": 300100581367310,
    "ItemNumber": "ALM-MX-ITEM-001",
    "AssetId": 300100581367872,
    "AssetNumber": "ALM_ASSET_002",
    "AssetDescription": "ALM-MX-ITEM-001-DESC",
    "AssetSerialNumber": "ALM_ASSET_002",
    "AssetOperatingOrgId": 300100113363336,
    "AssetOperatingOrgCode": "OPS_ORG_A",
    "AssetLocationCode": "ORA_UNKNOWN",
    "AssetLocation": "Unknown",
    "RootAssetId": 300100581367872,
    "RootAssetNumber": "ALM_ASSET_002",
    "ForecastDueDate": "2023-08-08",
    "SkipDueDateFlag": false,
    "ForecastOrganizationId": 300100113363336,
    "ForecastOrganizationCode": "OPS_ORG_A",
    "RequestedWoStartDate": "2023-08-08",
    "RequestedWoOrganizationId": 300100113363336,
    "RequestedWoOrganizationCode": "OPS_ORG_B",
    "WorkOrderId": 987634234234,
    "WorkOrderNumber": WO_NUM_12345,
    "WorkOrderOrganizationId": 300100113363336,
    "WorkOrderOrganizationCode": "OPS_ORG_A",
    "WorkOrderStartDate": "2023-08-08"
    "WorkOrderStatusCode": "ORA_UNRELEASED",
    "WorkOrderStatus": "Unreleased",
    "WarrantyRepairFlag": false,
    "CreatedBy": "MNT_QA",
    "CreationDate": "2023-08-01T20:46:40+00:00",
    "LastUpdatedBy": "MNT_QA",
    "LastUpdateDate": "2023-08-01T20:46:40+00:00",
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/maintenanceForecasts/20354",
            "name": "maintenanceForecasts",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
            }
        },
        {
            "rel": "canonical",
            "href": "https://servername/fscmRestApi/resources/version/maintenanceForecasts/20354",
            "name": "maintenanceForecasts",
            "kind": "item"
        },
        {
            "rel": "child",
            "href": "https://servername/fscmRestApi/resources/version/maintenanceForecasts/20354/child/forecastLines",
            "name": "forecastLines",
            "kind": "collection"
        }
    ]
}

Example 2

This example describes how to use a special action to cancel an existing work order for a maintenance forecast due date.

Example 2 cURL Command

Use the following cURL command to submit a request on the REST resource.

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/maintenanceForecasts"

Example 2 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
"name": "manageForecastWorkOrders",
"parameters": [
    {
    "forecastId": 13465
    },
    {
    "workOrderActionCode": "ORA_CANCEL"
    }
]
}

Example 2 Response Body

The following example includes the contents of the response body in JSON format:

{
    "ForecastId": 20354,
    "ForecastStatusCode": "ORA_CANCELED",
    "ForecastStatus": "Canceled",
    "ProgramOrganizationId": 300100113363336,
    "ProgramOrganizationCode": "OPS_ORG_A",
    "ProgramId": 300100583272981,
    "ProgramCode": "MAINTENANCE_PROGRAM",
    "ProgramName": "MAINTENANCE_PROGRAM",
    "ProgramTypeCode": "ORA_MAINTENANCE",
    "ProgramType": "Maintenance",
    "ProgramSubTypeCode": "Subtype 1",
    "ProgramSubType": "Subtype 1 M",
    "ProgramReference": "PREF123",
    "GlobalAssetsFlag": true,
    "RequirementName": "ACO_WR_1",
    "ItemId": 300100581367310,
    "ItemNumber": "ALM-MX-ITEM-001",
    "AssetId": 300100581367872,
    "AssetNumber": "ALM_ASSET_002",
    "AssetDescription": "ALM-MX-ITEM-001-DESC",
    "AssetSerialNumber": "ALM_ASSET_002",
    "AssetOperatingOrgId": 300100113363336,
    "AssetOperatingOrgCode": "OPS_ORG_A",
    "AssetLocationCode": "ORA_UNKNOWN",
    "AssetLocation": "Unknown",
    "RootAssetId": 300100581367872,
    "RootAssetNumber": "ALM_ASSET_002",
    "ForecastDueDate": "2023-08-08",
    "SkipDueDateFlag": true,
    "ForecastOrganizationId": 300100113363336,
    "ForecastOrganizationCode": "OPS_ORG_A",
    "RequestedWoStartDate": "2023-08-08",
    "RequestedWoOrganizationId": 300100113363336,
    "RequestedWoOrganizationCode": "OPS_ORG_B",
    "WorkOrderId": 987634234234,
    "WorkOrderNumber": WO_NUM_12345,
    "WorkOrderOrganizationId": 300100113363336,
    "WorkOrderOrganizationCode": "OPS_ORG_A",
    "WorkOrderStartDate": "2023-08-08"
    "WorkOrderStatusCode": "ORA_CANCELED",
    "WorkOrderStatus": "Canceled",
    "WarrantyRepairFlag": false,
    "CreatedBy": "MNT_QA",
    "CreationDate": "2023-08-01T20:46:40+00:00",
    "LastUpdatedBy": "MNT_QA",
    "LastUpdateDate": "2023-08-01T20:46:40+00:00",
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/maintenanceForecasts/20354",
            "name": "maintenanceForecasts",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
            }
        },
        {
            "rel": "canonical",
            "href": "https://servername/fscmRestApi/resources/version/maintenanceForecasts/20354",
            "name": "maintenanceForecasts",
            "kind": "item"
        },
        {
            "rel": "child",
            "href": "https://servername/fscmRestApi/resources/version/maintenanceForecasts/20354/child/forecastLines",
            "name": "forecastLines",
            "kind": "collection"
        }
    ]
}
Back to Top