on 09-07-2013 9:15 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.