Skip to main content

system.mes.oee.getAllOeeWasteRecords

Description

Retrieves all OEE Waste Records for a specific location within a given time range.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getAllOeeWasteRecords(locationIdOrPath, startDate, endDate)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID (ULID) or path to retrieve OEE waste records for.
startDateDateFalseThe start date/time for the query range.
endDateDateTrueThe end date/time for the query range. If null, uses current time.

Returns

A list of JSON representations of OeeWasteRecordDTO objects for the specified location and time range.

Each object has the following properties:

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Waste Recordnull
locationIdStringFalseIdentifier of the associated location where this OEE waste record was capturednull
locationPathStringTruePath of the location where this OEE waste record was capturednull
locationNameStringTrueName of the associated locationnull
startDateInstantFalseStart date and time of the OEE waste recordInstant.now()
endDateInstantTrueEnd date and time of the OEE waste recordnull
totalDurationSecDoubleFalseTotal duration of the OEE waste record in seconds0.0
qualityReasonIdStringTrueIdentifier of the associated quality reason, if applicablenull
qualityReasonNameStringTrueName of the associated quality reason. (Name - Code) For display purposes onlynull
qualityReasonPathStringTruePath to the current quality reasonnull
qualityReasonCodeStringTrueCode of the associated quality reasonnull
wasteCountDoubleFalseTotal number of waste units recorded during this period0.0
wasteCountUnitOfMeasureIdStringTrueIdentifier of the unit of measure for the waste countnull
wasteCountUnitOfMeasureNameStringTrueName of the unit of measure for the waste countnull
wasteCountUnitOfMeasureSymbolStringTrueSymbol of the unit of measure for the waste countnull
notesStringTrueNotes associated with the OEE Waste Recordnull
enabledbooleanTrueIndicates whether the OEE Waste Record is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

from java.util import Date
from java.util.concurrent import TimeUnit

# Get all OEE waste records for the last 24 hours
locationPath = "Enterprise/Site/Production/Line1"
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.HOURS.toMillis(24))

wasteRecords = system.mes.oee.getAllOeeWasteRecords(locationPath, startTime, endTime)

for record in wasteRecords:
print record['wasteCount'], record['qualityReasonName']