Skip to main content

system.mes.oee.getAllAvailabilityReasonCodesByLocationHierarchical

Description

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

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

Code Examples

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