Skip to main content

system.mes.oee.getAllDowntimeReasonCodesByLocationHierarchical

Description

Retrieves all OEE Downtime Reasons for a specific location, organized as a hierarchical tree structure. This method returns downtime 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.getAllDowntimeReasonCodesByLocationHierarchical(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 OeeDowntimeReasonHierarchicalDTO objects, each containing nested children.

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

Code Examples

# Get hierarchical downtime reasons for a specific location
location = "Site/Area/Line 1"
hierarchy = system.mes.oee.getAllDowntimeReasonCodesByLocationHierarchical(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)