Annotate Production Records
-
Allows adding textual comments to existing batch production records.
-
For annotating Batch Production Records stored in the default system Production Tracking data store, access to the equipment model is required.
-
For annotating Batch Production Records stored in a custom Production Tracking data store, WRITE permission on the data store object is required.
-
HTTP methods supported: POST.
Description
The annotate batch production record endpoint allows adding textual comments to an existing Batch Production Records (BRP). The endpoint logic makes use of the Lua function isa88.db.update().
Parameters
Name | Type | Optional | Description |
---|---|---|---|
body |
body |
no |
A list of BPR annotation items. Each annotation will be added into the BPR as a "Comment" document type. |
data_store |
long / string |
depends |
Specifies a data store. If not specified, this defaults to the System Production Tracking Data Store for Master Cores. For Local Cores, this option is required.The value is an object ID or path, identifying the System object or a custom store object. |
wait_for_completion |
boolean |
yes |
Option to force the server to just queue the MongoDB operations and return as quickly as possible. In this case the outcome of the annotate operations will not be part of the response. |
fields |
string |
yes |
Comma separated string to customize which fields should be included in the response, by default 'n,update_id'. Supported fields are |
insights |
boolean |
yes |
Indicates application insights should be included in the response, by default false. |
BPR annotation item
Should be a valid JSON document representing a single 'update' operation to perform. The following fields are supported:
-
bpr
Used to specify the parent Batch Production Record to insert the annotation. -
annotation
Annotation to insert as a S88 'Comment' document to the provided Batch Production Record. -
validate_refs
If true, DataReference attributes in the Comment document will be validated by checking the existence of the referenced document attribute in the database. Optional, by default false. -
wait_for_completion
Option to force the server to just queue the MongoDB operations and return as quickly as possible. If set to false the outcome of the update operations will not be part of the response. Optional, by default true.
Response structure
The response structure is the same as the response structure of the mass endpoint. The items in the response contain an update_id
field, which can be matched later with the results published by the BPR Publisher class.
Examples
Annotation example without data reference
Annotation example with data reference and data reference validation
HTTP POST
Request body
{
"items": [
{
"bpr": {
"BatchProductionRecord" : {
"BatchID": "13"
}
},
"annotation" : {
"Comment" : "My First comment.",
"PersonID" : "My Name",
"DataReference" : {
"ReferenceObjectType" : 21,
"ReferenceEntryID" : "64703f65-b4f9-11e9-b77c-6c2b59d68f72"
}
},
"validate_refs" : true
}
]
}
The value (21) of the field ReferenceObjectType
points to the object type 'Batch Production Record' as defined in the S88ProductionRecordEntryType
coding group.