cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with extended attributes

Former Member
0 Kudos

Hello,

I'm currently working on an extended model for EAM model (technology diagram).  My goal is to build a view of a SAP BI 4.0 CMS to provide an architecture visual map.  Everything is working fine accessing all needed elements (reports, universes, ...) but I have a strange behavior using extended attributes.

Here's how it was done in PowerDesigner:

1. At the model level, few extended attributes and a form is defined to capture CMS connection parameters

2. I defined extended objects for a generic "BO Document" with specific stereotypes RichClient and Webi Document (to be extended later)

3. I defined also several extended objects for universes, connection, report instance

4. A specific script has been developped to connect and capture elements from the CMS

Problem description:

When capturing BO Document information, I use "SetExtendedAttribute" to save values but, in some cases, nothing is saved in the extended attribute.

Here's part of the script (decomposed for the demonstration):

and here's the result:

I really don't understand why I don't have the value in the extended attribute ?

Can you help ?

Kr,

Thierry

Accepted Solutions (0)

Answers (1)

Answers (1)

arnaud_laurent
Employee
Employee
0 Kudos

I recommend you prefix the extendedattribute by the parent extended definition.

I executed the following script against a model which XEM ExtDef1 has an extended attribute extatt1 (String) defined under Model metaclass.

Dim mdl
Set mdl = ActiveModel

'Retrieve first extended model definition in the active model

Dim X
Set X = mdl.ExtendedModelDefinitions.Item(0)

output "Old value for extatt1: " &  mdl.GetExtendedAttribute("ExtDef1.extatt1")
mdl.SetExtendedAttribute "ExtDef1.extatt1", "the red fox"
output "New value for extatt1: " & mdl.GetExtendedAttribute("ExtDef1.extatt1")

HTH

Former Member
0 Kudos

Thanks Laurent.

I know there are potential problems if there are several Extended Model definition which is not the case here.

I tried your approach but no changes in the script behavior.

Kr,

Thierry

arnaud_laurent
Employee
Employee
0 Kudos

May you provide a sample script similar to the above that demonstrates the defect? I'll then see if I can repro it.

Former Member
0 Kudos

Thierry,

in the past when i had problems with the method GetExtendedAttribute ()

i used GetExtendedAttributeText () , which worked well in my cases.

Kind Regards

Klaus

Former Member
0 Kudos

Hi Arnaud,

Could you provide me a mail address, I'll provide you sample XEM and EAM documents.  I cannot insert such document on SCN (just images, videos or web links).

Kr,

Thierry

Former Member
0 Kudos

Thank Klaus,

I tried this but this is not working.

Kr,

Thierry

Former Member
0 Kudos

Here's a base you can work on:

Kr,

Thierry

arnaud_laurent
Employee
Employee
0 Kudos

Hum! Still working by my side in PD 16.5.2 PL1.

I have simplified your script to isolate the extended attributes part -- and I cannot open a new Crystal Enterprise session here.

In EAM, I created a new extension, which code is "BO Document". I created 4 ext attributes for Model metaclass (Authentification Mode, SAP Name, User Name and User Password). I created one extended attribute for Document, it's ProgMachine. Type of all 5 ext attributes is (String).

In EAM, I fulfilled the values for 4 ext attributes in Model property sheet.

I finally ran the below VBS. The Software server is created properly and it sets/gets the value for ProgMachine as expected.

Dim model
Set model = ActiveModel

Dim X
Set X = model.ExtendedModelDefinitions.Item(0)

'tbName = model.GetExtendedAttribute("BO Document.User Name")
'tbPassword = model.GetExtendedAttribute("BO Document.User Password")
tbCMS = model.GetExtendedAttribute("BO Document.SAP Name")
strAuth = model.GetExtendedAttribute("BO Document.Authentification Mode")

Set SoftSrc = model.SoftwareServers.CreateNew()

SoftSrc.name = tbcms
SoftSrc.SetNametoCode()
SoftSrc.type="Web Server"

'Set SessionManager = CreateObject("CrystalEnterprise.SessionMgr")

'Set esession = SessionManager.Logon(tbName, tbPassword, tbCMS, strAuth)
ReverseDocuments2()
'esession.Looff
'Set SessionManager = nothing

Sub ReverseDocuments2()
  Set Doc = model.Documents.CreateNew()
  var = "PROGID MACHINE= " & rnd
  Doc.SetExtendedAttribute "BO Document.ProgMachine", var
  var = Doc.GetExtendedAttribute("BO Document.ProgMachine")
  output "result in ProgMachine: " & var
End Sub

Former Member
0 Kudos

Thanks Laurent.

I'm using PD 16.5 SP02 (16.5.2.4120).  I tried to use the same notation but it doesn't work.  I'll create a case.

Thanks for your search.

Kr,

Thierry

arnaud_laurent
Employee
Employee
0 Kudos

If you ran the very exact steps and got different results then I'd say it is an environmen tissue.

Either I miss something in your scenario or you shall apply 16.5.2 PL1.

Sorry I cannot give a proper solution.

Former Member
0 Kudos

Hi Laurent,

I upgraded to 16.5 SP02 PL1 (16.5.2.4144) under Windows 8, 32 bits but I still have the same behavior.

I created a case.

Thanks a lot for your efforts.

Kr,

Thierry

Former Member
0 Kudos

Hi Arnaud,

Here's complete information about the environment:

For powerbuilder environment:

- Virtual computer under vmware ESXi 5.1 (build 1065491)

- OS: Windows 8 with all latest updates

- PowerDesigner 16.5.2.2 (4169) : 16.5 SP02 PL02

For SAP BI 4.0:

- Windows 2003 64Bits

- SAP BI 4.0 SP5 using standard local repository

Kr,

Thierry

arnaud_laurent
Employee
Employee
0 Kudos

Hi Thierry,

Do you have the case#?

BR

Former Member
0 Kudos

Hi Laurent,

The case id is : 11801689

Br,

Thierry

arnaud_laurent
Employee
Employee
0 Kudos

Case 11801689 was dispatched as a generic case with no customer associated.

If you need an urgent reply from the Technical Support team, I recommend you create a case attached to a support contract.

What does the below script give you?

Set MyModel = CreateModel(PdEAM.Cls_Model, "Diagram=TechnologyInfrastructureDiagram")
MyModel.SetNameAndCode "MyEAM" , "MyEAM"

Set MyModel = ActiveModel
Set MyExt = MyModel.ExtendedModelDefinitions.CreateNew()
MyExt.Name = "BODocument"
MyExt.Code = "BODocument"

Set MyExtSAP = MyExt.AddMetaExtension(PdEAM.Cls_Model, PdCommon.Cls_ExtendedAttributeTargetItem)
MyExtSAP.Name = "SAPName"
MyExtSAP.DataType = 12
Set MyExtAuth = MyExt.AddMetaExtension(PdEAM.Cls_Model, PdCommon.Cls_ExtendedAttributeTargetItem)
MyExtAuth.Name = "AuthMode"
MyExtAuth.DataType = 12
Set MyExtAuth = MyExt.AddMetaExtension(PdEAM.Cls_Document, PdCommon.Cls_ExtendedAttributeTargetItem)
MyExtAuth.Name = "ProgMachine"
MyExtAuth.DataType = 12

MyExt.NotifyChange()

MyModel.SetExtendedAttribute "BODocument.SAPName", "Dummy"
MyModel.SetExtendedAttribute "BODocument.AuthName", "Anonymous"

tbCMS = MyModel.GetExtendedAttribute("BODocument.SAPName")
strAuth = MyModel.GetExtendedAttribute("BODocument.AuthMode")

Set SoftSrc = MyModel.SoftwareServers.CreateNew()

SoftSrc.name = tbcms
SoftSrc.SetNametoCode()
SoftSrc.type="Web Server"


'Set SessionManager = CreateObject("CrystalEnterprise.SessionMgr")
'Set esession = SessionManager.Logon(tbName, tbPassword, tbCMS, strAuth)

ReverseDocuments()
'esession.Looff
'Set SessionManager = nothing

Sub ReverseDocuments()
  Set Doc = MyModel.Documents.CreateNew()
  var = "PROGID MACHINE= " & rnd
  Doc.SetExtendedAttribute "BODocument.ProgMachine", var
  var = Doc.GetExtendedAttribute("BODocument.ProgMachine")
  output "result in ProgMachine: " & var
End Sub

Former Member
0 Kudos

Thanks Arnaud.

I don't have support contract because I'm freelancer and no budget for now ; I'm using PowerDesinger since version 6 and I have time to go deeper now inside PowerDesigner .

Your code works but I don't know why mine is not working... I suppressed spaces in names, I use the same notation as you proposed but It decided not working.  Strange.  I'll continue investigations.

Kr,

Thierry