Skip to content

GET_MODEL_HIERARCHY

GET_MODEL_HIERARCHY returns a submodel tree of a model as XML.

Syntax

leo-grammar
CC "Core" GET_MODEL_HIERARCHY modelid:intValue 

#--> RESULT ecode:intValue hierarchy:strValue
CC "Core" GET_MODEL_HIERARCHY modelid:intValue 

#--> RESULT ecode:intValue hierarchy:strValue

Parameters

  • modelid (idValue) - ID of the root model

Returns

  • ecode (intValue) - Contains the error code or is 0 in case of success.
  • hierarchy (strValue) - has the same structure as the tree in the hierarchy explorer. For each model contained in the hierarchy the retured XML contains a <model> node with an id attribute. Direct submodels of a model are written as direct children of the related model tag in the XML.

Details

When the hierarchy builder detects a cycle one model is visited which has already been visited in the path, the model closing the cycle is listed as leaf node.

See Also

Examples

For a call

leo-grammar
CC "Core" GET_MODEL_HIERARCHY modelid:16083
CC "Core" GET_MODEL_HIERARCHY modelid:16083

the result hierarchy could look like this

leo-grammar
<?xml version="1.0" encoding="UTF-8"?>
<model id="16083">
  <model id="15918">
    <model id="15976">
      <model id="15918" />
    </model>
  </model>
  <model id="15976">
    <model id="15918">
      <model id="15976" />
    </model>
  </model>
</model>
<?xml version="1.0" encoding="UTF-8"?>
<model id="16083">
  <model id="15918">
    <model id="15976">
      <model id="15918" />
    </model>
  </model>
  <model id="15976">
    <model id="15918">
      <model id="15976" />
    </model>
  </model>
</model>

Versions and Changes

Available since ADOxx 1.3