Skip to main content

system.mes.oee.getAllPerformanceReasonCodesByLocationHierarchical

Description

Retrieves all OEE Performance Reasons for a specific location, organized as a hierarchical tree structure. This method returns performance reasons with their parent-child relationships intact, allowing for easy navigation of the reason hierarchy.

Permissions

This method requires OEE.READ.GET permission.

Syntax

system.mes.oee.getAllPerformanceReasonCodesByLocationHierarchical(locationIdOrPath)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringTrueThe ID or path of the location. If null, returns reasons for all locations.

Returns

A list of JSON objects representing root-level OeePerformanceReasonHierarchicalDTO objects, each containing nested children.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the Performance Reasonnull
locationIdStringTrueIdentifier of the associated location (inherited from OeePerformanceReasonDTO)null
locationPathStringTruePath of the associated location (inherited from OeePerformanceReasonDTO)null
parentIdStringTrueIdentifier of the parent performance reason (inherited from OeePerformanceReasonDTO)null
codeIntegerFalseUnique fault code associated with this performance reason (inherited from OeePerformanceReasonDTO)0
nameStringFalseName of the performance reason (inherited from OeePerformanceReasonDTO)null
descriptionStringTrueDescription of the performance reason (inherited from OeePerformanceReasonDTO)null
pathStringTruePath representation of the performance reason (inherited from OeePerformanceReasonDTO)null
childrenList<OeePerformanceReasonHierarchicalDTO>TrueList of child performance reasonsnull
notesStringTrueNotes associated with the Performance Reasonnull
enabledbooleanTrueIndicates whether the Performance Reason is enabledtrue
spare1StringTrueExtra fieldnull
spare2StringTrueExtra fieldnull
spare3StringTrueExtra fieldnull

Code Examples

# Get hierarchical performance reasons for a specific location
location = "Site/Area/Line 1"
hierarchy = system.mes.oee.getAllPerformanceReasonCodesByLocationHierarchical(location)

def print_hierarchy(reasons, indent=0):
for reason in reasons:
print " " * indent + reason['name']
if reason['children']:
print_hierarchy(reason['children'], indent + 1)

print_hierarchy(hierarchy)