Execute Action Rules as Part of the Inspection Process
When you perform an inspection, inspection plan action rules are triggered based upon the result values entered.
You can execute applicable inspection plan actions rules whenever a result value is updated as part of the inspection process, or you can execute rules for one or more inspections as needed.
-
Executing rules as part of an inspection process using the Inspection Events resource.
-
Executing rules for one or more inspections needed using the Inspection Actions resource.
- Executing rules for one or more inspections on an ad hoc basis using the Inspection Actions resource.
Executing Rules Using Inspection Events
Let's consider that Richard Jones, a Quality Engineer in Vision City Organization, has created an inspection plan with two specifications LOG-CH and Color for sub inventory ABCSUB01. He has defined a rule in the inspection plan to create a quality issue, send a notification, and change the material status when Color is not equal to the target value defined in the inspection plan specification. Richard can complete the inspection with actions created for the inspection by following these sequence of REST calls.
- Create an inspection indicating that actions rules should be executed when a result value is updated.
-
Update the sample result in the inspection.
- Verify the action taken for the inspection.
Create an Inspection Indicating Actions Rules Be Executed When a Result Is Updated
Example URL
Use this resource URL format:
POST
curl -u username:password -X POST -H "Content-Type:application/vnd.vision.adf.resourceitem+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/inspectionEvents"
Example Request
{ "EventType":"INV", "Inline":"N", "InspectedBy":"QUALITY_ENGINEER", "InspectionDate":"2023-09-19", "OrganizationCode":"V1", "QuantityRequested":1, "ItemNumber" : "QIMItem1", "SubinventoryCode" : "ABCSUB01", "INVInspectionPlanName":"QA-2023-18 Demo Plan", "ExecuteActionRulesFlag": true }
Example Response
Here's an example of the response body in JSON format:
{ "CategoryId": null, "CategorySetId": null, "CustomerId": null, "DispatchStatus": null, "DispositionDate": null, "DocumentLineNumber": null, "DocumentNumber": null, "DocumentScheduleNumber": null, "DocumentType": null, "Draft": "N", "EventType": "INV", "Inline": "N", "InspectedBy": "QUALITY_ENGINEER", "InspectionDate": "2023-09-19T00:00:00+00:00", "InspectionLevelId": 100, "InspectionPlanId": 300100591205147, "InspectionStatus": "PENDING", "InterfaceTransactionId": null, "InventoryItemId": 300100151162705, "IpCriteriaId": null, "IpEventId": 300100592271192, "LocatorId": null, "LotNumber": null, "ObjectVersionNumber": 4, "OperationSequenceNumber": null, "OrganizationId": 204, "OriginalDisposition": "PENDING", "QuantityAccepted": 0, "QuantityInspected": 0, "QuantityRejected": 0, "QuantityRequested": 1, "ReceiptNumber": null, "ResourceId": null, "RevisionId": null, "SamplingQuantity": 1, "ShipmentHeaderId": null, "ShipmentLineId": null, "SourceLineQuantity": null, "SourceOrgId": null, "SubinventoryCode": "ABCSUB01", "SupplierId": null, "SupplierLotNumber": null, "SupplierSiteId": null, "TransactionType": null, "UOMCode": "Ea", "WoOperationId": null, "WorkAreaId": null, "WorkCenterId": null, "WorkOrderId": null, "OrganizationCode": "V1", "WorkOrderNumber": null, "ItemNumber": "QIMItem1", "WIPInspectionPlanName": null, "ItemRevision": null, "WoOperationCode": null, "SubinventoryId": 100000015305185, "Locator": null, "INVInspectionPlanName": "QA-2023-18 Demo Plan", "ResourceInspectionPlanName": null, "WorkCenterCode": null, "ResourceCode": null, "InspectionLevelName": "100%", "isSkiplotEnabled": "N", "SamplingRate": 100, "NumofLotsInspect": 0, "NumofLots": 0, "InspectionPlanType": "INVENTORY", "InspectionPlanVersion": "1", "InspectionPlanVersionDescription": null, "isSamplingEnabled": "N", "FromOrganizationId": null, "ItemDescription": null, "VendorId": null, "VendorSiteId": null, "SourceDocumentCode": null, "EventTypeLOV": null, "InspectAllSamplesFlag": null, "SerialResultsEntryFlag": null, "SourceOrganizationCode": null, "Supplier": null, "SupplierSite": null, "InspectionName": "QIMItem1ABCSUB01", "RCVInspectionPlanName": null, "WoOperationName": null, "AcceptanceNumber": null, "NonConformanceCount": null, "RejectionNumber": null, "SampleSizeCode": null, "TotalSampleQuantity": null, "PreAssignedLotNumber": null, "AssetId": null, "AssetNumber": null, "AssetInspectionPlanName": null, "AssetWorkOrderId": null, "AssetWorkOrderNumber": null, "AssetSerialNumber": null, "ExecuteActionRulesFlag": true, "links": [ { "rel": "self", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192", "name": "inspectionEvents", "kind": "item", "properties": { "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000478" } }, { "rel": "canonical", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192", "name": "inspectionEvents", "kind": "item" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/WorkOrderNumberLOV", "name": "WorkOrderNumberLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/OrganizationCodeLOV", "name": "OrganizationCodeLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/ResourceInspPlanNameLOV", "name": "ResourceInspPlanNameLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/INVInspPlanNameLOV", "name": "INVInspPlanNameLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/WorkOrderProductLotLOV", "name": "WorkOrderProductLotLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/ItemRevisionLOV", "name": "ItemRevisionLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/InspectionTypeLOV", "name": "InspectionTypeLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/LotNumberLOV", "name": "LotNumberLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/LocatorLOV", "name": "LocatorLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/WorkCenterCodeLOV", "name": "WorkCenterCodeLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/WIPInspPlanNameLOV", "name": "WIPInspPlanNameLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/ResourceCodeLOV", "name": "ResourceCodeLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/WoOperationCodeLOV", "name": "WoOperationCodeLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/AssetLOV", "name": "AssetLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/InventoryItemLOV", "name": "InventoryItemLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/InspectedByLOV", "name": "InspectedByLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/AssetInspPlanNameLOV", "name": "AssetInspPlanNameLOV", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/WorkOrderAssetInfoVVA", "name": "WorkOrderAssetInfoVVA", "kind": "collection" }, { "rel": "lov", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/lov/SubInventoryLOV", "name": "SubInventoryLOV", "kind": "collection" }, { "rel": "child", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/child/Attachments", "name": "Attachments", "kind": "collection" }, { "rel": "child", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/child/EventDisposition", "name": "EventDisposition", "kind": "collection" }, { "rel": "child", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/child/Sample", "name": "Sample", "kind": "collection" }, { "rel": "child", "href": "https://servername/fscmRestApi/resources/version/inspectionEvents/300100592271192/child/inspectionEventActions", "name": "inspectionEventActions", "kind": "collection" } ] }
Update the Sample Result
- Get the inspection event
header:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/
- Using event header, get a sample child
URL:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/
- Get the context URL of the sample for which the result value must be
updated:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/SampleId/
- Using sample context URL, get a SampleDisposition child
URL:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/SampleId/child/SampleDisposition/
- Get the context URL of the sample disposition for which the result value must be
updated:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId}/child/Sample/SampleId/child/SampleDisposition/SampleDispositionId/
- Using the sample disposition context URL, get the SampleResult child
URL:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/SampleId/child/SampleDisposition/SampleDispositionId/child/SampleResult/
- Get the context URL of the sample result for which the result value must be
updated:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/SampleId/child/SampleDisposition/SampleDispositionId/child/SampleResult/SampleResultId/
- Perform a PATCH operation on the sample result context URL to update the result
value:
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/SampleId/child/SampleDisposition/SampleDispositionId/child/SampleResult/SampleResultId/
Example URL
Use this resource URL format:
PATCH
curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/Sample/SampleId/child/SampleDisposition/SampleDispositionId/child/SampleResult/SampleResultId"
Example Request
Here's an example of the request body in JSON format. You can update the result value based on the data type of the associated characteristic; for example, ResultValueNumber for NUMBER, ResultValueChar for validated CHARACTER, ResultValueCharNonValidated for a non-validated CHARACTER, and ResultValueDate for date.
{ "ResultValueChar": "GREEN" }
Example Response
Here's an example of the response body in JSON format. The evaluation will be modified based on the result value and target defined in the inspection plan.
{ "CharacteristicId": 300100587923941, "Comments": null, "Disposition": "REJECT", "Evaluation": "Y", "InSpecification": "N", "InspectionDate": "2023-09-19T10:59:07.254+00:00", "IpEventId": 300100592271192, "ObjectVersionNumber": 2, "Quantity": 1, "ResultValueChar": "GREEN", "ResultValueDate": null, "ResultValueNumber": null, "SampleId": 300100592271194, "SampleResultId": 300100592271198, "UOMCode": null, "UserSequence": 20, "CharacteristicName": "Color", "DataType": "CHARACTER", "ResultValueCharNonValidated": "GREEN", "OptionalFlag": null, "links": [ { "rel": "self", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195/child/SampleResult/300100592271198", "name": "SampleResult", "kind": "item", "properties": { "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000278" } }, { "rel": "canonical", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195/child/SampleResult/300100592271198", "name": "SampleResult", "kind": "item" }, { "rel": "parent", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195", "name": "SampleDisposition", "kind": "item" }, { "rel": "lov", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195/child/SampleResult/300100592271198/lov/CharacteristicValueLOV", "name": "CharacteristicValueLOV", "kind": "collection" }, { "rel": "lov", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195/child/SampleResult/300100592271198/lov/CharacteristicNameLOV", "name": "CharacteristicNameLOV", "kind": "collection" }, { "rel": "child", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195/child/SampleResult/300100592271198/child/Attachments", "name": "Attachments", "kind": "collection" }, { "rel": "child", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/Sample/300100592271194/child/SampleDisposition/300100592271195/child/SampleResult/300100592271198/child/ResultEvaluation", "name": "ResultEvaluation", "kind": "collection" } ] }
Verify Action Taken for the Inspection
You can get a list of all actions taken for the inspection using following URL.
Example URL
https://servername/fscmRestApi/resources/version/inspectionEvents/ipEventId/child/inspectionEventActions
Example Response
{ "items": [ { "IpEventId": 300100592271192, "SampleId": 300100592271194, "SampleResultId": 300100592271198, "ActionTaken": "ISSUE", "MessageName": "S", "MaterialStatusLevel": null, "StatusId": null, "StatusCode": null, "Notifiers": null, "IssueId": 300100592283095, "MessageText": null, "SerialNumber": null, "SampleNumber": "00001", "IssueNumber": "NC157", "IssueName": "QIMItem1-00001-Color", "IssueDescription": "The characteristic Color is out of specification limits.", "AsActionTakenDate": "2023-09-19T00:00:00+00:00", "WorkOrderId": null, "WorkOrderNumber": null, "links": [ { "rel": "self", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions/300100592271192", "name": "inspectionEventActions", "kind": "item" }, { "rel": "canonical", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions/300100592271192", "name": "inspectionEventActions", "kind": "item" }, { "rel": "parent", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192", "name": "inspectionEvents", "kind": "item" } ] }, { "IpEventId": 300100592271192, "SampleId": 300100592271194, "SampleResultId": null, "ActionTaken": "NOTIFICATION", "MessageName": null, "MaterialStatusLevel": null, "StatusId": null, "StatusCode": null, "Notifiers": "quality_engineer_KO", "IssueId": null, "MessageText": "Color out of spec", "SerialNumber": null, "SampleNumber": null, "IssueNumber": null, "IssueName": null, "IssueDescription": null, "AsActionTakenDate": "2023-09-19T11:12:06.002+00:00", "WorkOrderId": null, "WorkOrderNumber": null, "links": [ { "rel": "self", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions/300100592271192", "name": "inspectionEventActions", "kind": "item" }, { "rel": "canonical", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions/300100592271192", "name": "inspectionEventActions", "kind": "item" }, { "rel": "parent", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192", "name": "inspectionEvents", "kind": "item" } ] }, { "IpEventId": 300100592271192, "SampleId": null, "SampleResultId": null, "ActionTaken": "MTL_STATUS_CHANGE", "MessageName": "E", "MaterialStatusLevel": "LOT", "StatusId": 1, "StatusCode": "Active", "Notifiers": null, "IssueId": null, "MessageText": null, "SerialNumber": null, "SampleNumber": null, "IssueNumber": null, "IssueName": null, "IssueDescription": null, "AsActionTakenDate": "2023-09-19T11:12:07.833+00:00", "WorkOrderId": null, "WorkOrderNumber": null, "links": [ { "rel": "self", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions/300100592271192", "name": "inspectionEventActions", "kind": "item" }, { "rel": "canonical", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions/300100592271192", "name": "inspectionEventActions", "kind": "item" }, { "rel": "parent", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192", "name": "inspectionEvents", "kind": "item" } ] } ], "count": 3, "hasMore": false, "limit": 25, "offset": 0, "links": [ { "rel": "self", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionEvents/300100592271192/child/inspectionEventActions", "name": "inspectionEventActions", "kind": "collection" } ] }
Executing Rules for One or More Inspections on an Ad Hoc Basis Using Inspection Actions
Consider a case where a quality engineer hasn't indicated that action rules must be executed while creating an inspection, that's when ExecuteActionRulesFlag is null/N/false. In such a case, rules won't be executed when the result value is updated and no actions will be created for the inspection. The quality engineer can then use following resource to execute rules for the inspection.
cURL Command
curl -u username:password -X POST -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload'
"https://servername/fscmRestApi/resources/version/inspectionActions"
Example Request
Here's an example of the request body in JSON format:
{ "IpEventId": 300100592271192 }
Example Response
Here's an example of the response body in JSON format:
{ "IpEventId": 300100592271192, "InspectionPlanId": 300100591205147, "InspectionPlanName": "QA-2023-18 Demo Plan", "ActionStatus": "SUCCESS", "MessageText": null, "links": [ { "rel": "self", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionActions/300100592271192", "name": "inspectionActions", "kind": "item" }, { "rel": "canonical", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionActions/300100592271192", "name": "inspectionActions", "kind": "item" }, { "rel": "child", "href": "https://fa-wrsp-pintlabfadev.fa.ocs.oc-test.com:443/fscmRestApi/resources/11.13.18.05/inspectionActions/300100592271192/child/inspectionEventActions", "name": "inspectionEventActions", "kind": "collection" } ] }
Note:
You can execute action rules for one or more inspections using the BATCH operation using the Inspection Actions resource.