NOTE: This code won't show some objects like Jobs or Shared/Private Projects. It really shows everything you'd want. This is only because the last join to parentModelElement doesn't display records where modelElement.ParentModelElement == 0.
Just comment out the last block to get some of those odd-objects.
/* join Name from parentModelElement where parentModelElement.RecId == modelElement.ParentModelElement */
static void listAllModelObjects(Args _args) { SysModelElement modelElement, parentModelElement; SysModelElementType modelElementType; SysModelElementData modelElementData; SysModelManifest modelManifest; while select Name from modelElement join Name from modelElementType where modelElementType.RecId == modelElement.ElementType join modelElementData where modelElementData.ModelElement == modelElement.RecId join modelManifest where modelManifest.Name == 'USR Model' && modelManifest.Model == modelElementData.ModelId join Name from parentModelElement where parentModelElement.RecId == modelElement.ParentModelElement { info(strFmt("%1, %2, %3, %4", parentModelElement.Name, modelElementType.Name, modelElement.Name, SysTreeNode::modelElement2Path(modelElement))); } }
No comments:
Post a Comment