Skip to main content

system.mes.oee.getDetailedStateRecordsFiltered

Description

Retrieves OEE State Records with detailed information including related mode records, alarm records, and other associated data. This function provides more comprehensive filtering options than getStateRecordsFiltered, including microstop threshold filtering and event type filtering.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getDetailedStateRecordsFiltered(locationPath, startDate, endDate, microstopThreshold=None, microstopThresholdTimeUnits=None, eventTypes=None, modeCodes=None, availabilityReasonPath=None)

Parameters

ParameterTypeNullableDescription
locationPathStringFalseThe location path to find state records for.
startDateDateFalseStart date for the search window.
endDateDateFalseEnd date for the search window.
microstopThresholdIntegerTrueThreshold value for filtering microstops. Used in conjunction with microstopThresholdTimeUnits.
microstopThresholdTimeUnitsStringTrueTime units for the microstop threshold. Valid values: SECONDS, MINUTES, HOURS. Defaults to SECONDS if not specified.
eventTypesString[]TrueArray of event types to filter by. Valid values depend on OeeStateCalculationType enum (e.g., RUNNING, STOPPED, BLOCKED, STARVED).
modeCodesInteger[]TrueArray of mode codes to filter by.
availabilityReasonPathStringTrueFilter by availability reason path. If not specified or blank, defaults to % (matches all).

Returns

Returns a list of JSON objects representations of OeeStateRecordDetailedDTO objects with expanded information, including related entities.

Each object has the following properties:

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE State Recordnull
codeIntegerFalseInteger state numbernull
locationIdStringFalseIdentifier of the associated location where this state record was recordednull
locationNameStringTrueName of the associated locationnull
locationPathStringTruePath of the location where this state record was recordednull
nameStringFalseName of the recorded statenull
calculationTypeOeeStateCalculationTypeFalseSpecifies how this state contributes to OEE calculationsDOWNTIME
colorStringFalseHex color code representing the state visually"#000000"
statusStatusFalseStatus of the OEE record (e.g., running, faulted, canceled, complete)UNKNOWN
startDateInstantFalseStart date and time of the state recordInstant.now()
endDateInstantTrueEnd date and time of the state recordnull
durationDoubleFalseDuration of the state record in seconds0.0
availabilityReasonIdStringTrueIdentifier of the associated availability reason, if applicablenull
availabilityReasonStringTrueTitle of the availability reason. (Name - Code) For display purposes onlynull
availabilityReasonPathStringTruePath to the current availability reasonnull
interruptionLocationIdStringTrueLocation id that caused the blocked/starved state on the machinenull
interruptionLocationNameStringTrueName of the interruption location that caused the blocked/starved statenull
interruptionLocationPathStringTrueLocation path that caused the blocked/starved state on the machinenull
acknowledgedBooleanFalseBoolean indicating whether the state record has been acknowledgedfalse
acknowledgedByStringTrueAcknowledged By. This is the user who acknowledged the state recordnull
acknowledgedDateInstantTrueAcknowledged Date. This is the date when the state record was acknowledgednull
modeRecordIdStringTrueIdentifier of the associated mode recordnull
rootCauseStateRecordIdStringTrueIdentifier of the root cause state record, if applicablenull
primaryAlarmRecordIdStringTrueIdentifier of the associated OEE Alarm Record, if applicablenull
primaryAlarmNameStringTruePrimary alarm name, if applicablenull
primaryAlarmDisplayPathStringTruePrimary alarm display path, if applicablenull
primaryAlarmLabelStringTruePrimary alarm display name, if applicablenull
oeeProductionRecordsSet<OeeProductionRecordDTO>TrueList of associated OEE records that reference this state recordnull
oeeModeRecordOeeModeRecordDTOTrueOEE Mode Record associated with this state recordnull
rootCauseStateRecordOeeStateRecordDTOTrueRoot Cause State Recordnull
notesStringTrueNotes associated with the OEE State Recordnull
enabledbooleanTrueIndicates whether the OEE State 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 detailed state records with basic filters
endDate = Date()
startDate = Date(endDate.getTime() - TimeUnit.DAYS.toMillis(1))

detailed_records = system.mes.oee.getDetailedStateRecordsFiltered(
'DairyCo/Plant1/Line1',
startDate,
endDate
)

# Filter by availability reason path
detailed_records = system.mes.oee.getDetailedStateRecordsFiltered(
'DairyCo/Plant1/Line1',
startDate,
endDate,
availabilityReasonPath='Equipment Failure'
)

# Filter by mode codes
detailed_records = system.mes.oee.getDetailedStateRecordsFiltered(
'DairyCo/Plant1/Line1',
startDate,
endDate,
modeCodes=[1, 2, 3]
)

# Filter by event types
detailed_records = system.mes.oee.getDetailedStateRecordsFiltered(
'DairyCo/Plant1/Line1',
startDate,
endDate,
eventTypes=['RUNNING', 'IDLE']
)

# Filter microstops with threshold
detailed_records = system.mes.oee.getDetailedStateRecordsFiltered(
'DairyCo/Plant1/Line1',
startDate,
endDate,
microstopThreshold=300,
microstopThresholdTimeUnits='SECONDS'
)

# Combine multiple filters
detailed_records = system.mes.oee.getDetailedStateRecordsFiltered(
'DairyCo/Plant1/Line1',
startDate,
endDate,
availabilityReasonPath='Maintenance',
modeCodes=[1, 2],
eventTypes=['IDLE'],
microstopThreshold=600,
microstopThresholdTimeUnits='SECONDS'
)