Skip to main content
Version: V2 (Ignition 8.1)

tamaki.mes.backup.compare.flattenEntities

Description

Flattens the nested structures in an entity-lists dictionary so they can be compared, by calling flattenDashboardWidgets, flattenMaterials, flattenLocations, and flattenProductionOrders in turn. For example, the property values nested inside each location are lifted into a single top-level locationPropertyValues list, with each value annotated with the path of its owning location. The dictionary is mutated in place and also returned.

Raises a TypeError if entityLists is not a dictionary.

Syntax

tamaki.mes.backup.compare.flattenEntities(entityLists)

Parameters

ParameterTypeNullableDescription
entityListsDictFalseA mapping of entity type to a list of entity dictionaries.

Returns

The same Dict, mutated in place with nested structures flattened into new top-level lists.

Code Examples

data = tamaki.mes.backup.compare.extractJsonFromBytes(backupBytes)
tamaki.mes.backup.compare.flattenEntities(data)
print(data["locationPropertyValues"]) # lifted out of each location