Dear Readers,

this article is Related to PD 16.1.0, i had no chance to test it on higher versions and maybe the usecase i describe is already implemented in higher versions.

i had the Problem that i wanted to get the LIST of extended Attributes of an Object, but i couldn´t find a function which serves my needs. So i wrote it.

using Output obj.ExtendedAttributesText, you´ll get somethig like this:

(depending on the Extended Attrivutes connected to your object)

    {0314A162-4CAB-4A79-8573-B9CAB3523844},EMD_EAM_INF,201=

    {412A2209-6EDA-4F0D-9A49-AD4CD90A201D},Delete_ErrorHandling,4=true

    {D96ADDC0-370E-485C-84EF-127BA7D58CA3},Kommentar,8=Kein ODP

    {D3D34E15-E7A7-4FFC-843F-7815EFC1702E},InformaticaFolder,10=0000_WSHIS

The values in {} are the internal ID´s of the EA´s folloed by ea´s name and a size=value tuple

Function getExtendedAttributes(obj)

    Dim eaArray , eaValues

    eaArray  = Split(obj.ExtendedAttributesText, “{“)

    Dim i

    ReDim eaNames(UBound(eaArray ) – 1)

    For i = 2 To UBound(eaArray )

        eaValues = Split(eaArray (i), “,”)

        eaNames(i – 1) = eaValues(1)

    Next ‘i

    ‘For i = 1 To UBound(eaNames)

    ‘   Output i &”:” & eaNames(i)

    ‘Next ‘i

    getExtendedAttributes = eaNames

End Function

Feel free to extend or comment this article , but also to show me the right function to get the List of EA´s in Metamodel Objects Help

cu

DJ

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. M. Schot

    Hi Dirk,

    This might be an option as well:

    dim l_extAttrs, l_extAttr

    dim l_fullName

    set l_extAttrs = <<your model>>.GetMetaExtensionsForInstance(<<your object>>, PdCommon.Cls_ExtendedAttributeTargetItem)

    for each l_extAttr in l_extAttrs

         l_fullName = l_extAttr.target.code & “.” & l_extAttr.name

         output “Attribute: ” & l_fullName & ” has the value: ” & cstr(<<your object>>.getExtendedAttribute(l_fullName))

    next

    It should be somthing like that. Let me know if you can’t get it to work.

    Regards,

    Marcel

    (0) 

Leave a Reply