cancel
Showing results for 
Search instead for 
Did you mean: 

How access Extended Subobject ?

Former Member
0 Kudos

Hi,

It's about XEM

In the following example, the "TableData" is an entirely new type of object created by adding the ExtendedSubObject metaclass and defining a stereotype on it.

How set and get Extended SubObject from VB using Extended Composition ?

When we create "ExtensibleObject" with "Extended Attributes" we can set and get with the following commands :

tbl.setExtendedAttribute "FillDataTable.Attribut_1", "BLN"

output "Output" & tbl.GetExtendedAttribute ("FillDataTable.Attribut_1")

  • Tbl is my current Table object
  • FillDataTable is my Extension name
  • Attribut_1 is my Extended Attribut
  • "BLN"' is my data

For each records under "Donnees" (see Extended Compositions) we have three columns (COL1, COL2, COL3) (see Extended Attributes under ExtendedSubObject)

Note : FillDataTable.Nom is the label corresponding to COL1, etc.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Benoit,

on attached example, you can see all commands necessary to manipulate values of extended subobjects.

Here is the script I used:

For each t in activemodel.tables

  output t.name

  Set kolekce = t.GetCollectionByName("Donnees")  ' initialization of ext.composition if it does not exist (=is empty)

 

  For each extComp in t.ExtendedCompositions

    If extComp.Name = "Donnees" then

      output "extComp.name: " + extComp.name

      Set newRecord = extComp.content.CreateNewAt(0, PdCommon.cls_ExtendedSubObject)

      newRecord.Stereotype = "TableData"

      For each ESO in extComp.Content

        output ESO.name

        output ESO.GetExtendedAttributeText("COL1")

        ESO.SetExtendedAttributeText "COL2", "my value"

      Next

      Exit For

    End if

  Next

Next

HTH,

Ondrej Divis

Answers (0)