system.mes.oee.findOeeWasteRecords
Description
Retrieves OEE Waste Records based on the specified pagination, sort, and column constraint parameters.
Permissions
This method requires the OEE.READ.GET permission.
Syntax
system.mes.oee.findOeeWasteRecords(**queryRequest)
Parameters
Using Python keyword arguments, a Query Request can be passed to the findOeeWasteRecords function
without specifying each parameter individually. Please refer to the Query Request documentation for a list of parameters.
| Parameter | Type | Nullable | Description |
|---|---|---|---|
queryRequest | Query Request | False | A Query Request with the desired pagination, sorting, and filtering parameters. |
Returns
Returns a Query Result object with the following properties:
| Name | Type | Description |
|---|---|---|
content | List<OeeWasteRecord> | The list of all records found that meet the specified criteria |
totalPages | Integer | If pagination is used, this is the number of total pages of records in the database for the specified page size. |
totalElements | Long | If pagination is used, this is the number of records in the database that meet the specified criteria. |
pageSize | Integer | If pagination is used, this is the specified page size. |
pageIndex | Integer | If pagination is used, this is the specified page index. |
hasContent | Boolean | True if any records were found that meet the specified criteria. |
isFirst | Boolean | If pagination is used, this is true if the first page was returned. |
isLast | Boolean | If pagination is used, this is true if the last page was returned. |
hasNext | Boolean | If pagination is used, this is true if there is a page of content available after this one. |
hasPrevious | Boolean | If pagination is used, this is true if there is a page of content available before this one. |
Each OeeWasteRecordDTO in content has the following properties:
| Name | Type | Nullable | Description | Default Value |
|---|---|---|---|---|
id | String | True | The id of the OEE Waste Record | null |
locationId | String | False | Identifier of the associated location where this OEE waste record was captured | null |
locationPath | String | True | Path of the location where this OEE waste record was captured | null |
locationName | String | True | Name of the associated location | null |
startDate | Instant | False | Start date and time of the OEE waste record | Instant.now() |
endDate | Instant | True | End date and time of the OEE waste record | null |
totalDurationSec | Double | False | Total duration of the OEE waste record in seconds | 0.0 |
qualityReasonId | String | True | Identifier of the associated quality reason, if applicable | null |
qualityReasonName | String | True | Name of the associated quality reason. (Name - Code) For display purposes only | null |
qualityReasonPath | String | True | Path to the current quality reason | null |
qualityReasonCode | String | True | Code of the associated quality reason | null |
wasteCount | Double | False | Total number of waste units recorded during this period | 0.0 |
wasteCountUnitOfMeasureId | String | True | Identifier of the unit of measure for the waste count | null |
wasteCountUnitOfMeasureName | String | True | Name of the unit of measure for the waste count | null |
wasteCountUnitOfMeasureSymbol | String | True | Symbol of the unit of measure for the waste count | null |
notes | String | True | Notes associated with the OEE Waste Record | null |
enabled | boolean | True | Indicates whether the OEE Waste Record is enabled | true |
spare1 | String | True | Extra field 1 | null |
spare2 | String | True | Extra field 2 | null |
spare3 | String | True | Extra field 3 | null |
Code Examples
Here is an example of how to use a Query Request to retrieve the first ten OEE waste records created in 2025, sorted by start date.
# Generate the object structure for a new query request
queryRequest = system.mes.query.newQueryRequest()
# Set the basic attributes of the query request
queryRequest['pageSize'] = 10
queryRequest['pageIndex'] = 0
queryRequest['sortFields'] = ['startDate']
queryRequest['sortDirections'] = ['Ascending']
# Generate the object structure for a filter for the query request
filterRequest = system.mes.query.newFilterRequest()
filterRequest['field'] = 'startDate'
filterRequest['condition'] = 'between'
filterRequest['minDateValue'] = '2025-01-01T00:00:00Z' # OR system.date.getDate(2025, 0, 1)
filterRequest['maxDateValue'] = '2026-01-01T00:00:00Z' # OR system.date.getDate(2026, 0, 1)
filters = [filterRequest]
queryRequest['filters'] = filters
# Retrieve the OEE waste records that match the filter
result = system.mes.oee.findOeeWasteRecords(**queryRequest)
# Output the OEE waste records that match the filter
print(result)