Hi,
PM ID Outlinks
P1.1 /Reqts/SRS
/Reqts/SRS
/Reqts/SDD
P1.2 /Reqts/SRS
P1.3 /Reqts/SRS
PM ID Outlinks
P1.1 /Reqts/SRS ID Attr2 Attr3
/Reqts/SRS ID Attr2 Attr3
/Reqts/SDD ID Attr2 Attr3
P1.2 /Reqts/SRS ID Attr2 Attr3
P1.3 /Reqts/SRS ID Attr2 Attr3
for o in m do {
col = 0
row ++
for l in o -> "*" do {
// NEED TO CALL LINK MODULES ATTRBUTE ID, ATTR2 and ATTR3 here and append it to sTargetPath
string temp2 = sTargetPath
sTargetPath = sTargetPath fullName(target l) (NLS_("\n"))
if (temp2 != sTargetPath) {
setCell(row, outlink, sTargetPath)
}
}
SystemAdmin - Tue Apr 24 17:07:20 EDT 2012 |
Re: Get Attribute from Outlinked Module Look in the dxl examples, especially the 'Example of Trace Analysis' file for some pointers. (Or get the 'Requirements Management Add on' that has a lot of the functionality you are looking for already.) |
Re: Get Attribute from Outlinked Module Bob_Swan - Wed Apr 25 03:07:03 EDT 2012
Look through the DXL manual for "LinkRef"; you will routinely need a "LinkRef" loop before your "Link" loop when dealing with outlinks. -Louie |
Re: Get Attribute from Outlinked Module
Hi,
for o in m do {
col = 0
row ++
for l in o -> "*" do {
string temp2 = sTargetPath
sTargetPath = sTargetPath fullName(target l)
ModuleVersion targetVer = targetVersion(l)
if(exists(module targetVer)){
// if (null data(targetVer))
// {
// Module m2 = load(targetVer, false)
// }
// Works without this condition, but I thought I had to load this module????
targetObj = target l
if (probeAttr_(targetObj,"Attr2") != "")
{
s1 = targetObj."Attr2"
}
else
{
s1 = ""
}
if (probeAttr_(targetObj,"Attr3") != "")
{
s2 = targetObj."Attr3"
}
else
{
s2 = ""
}
if (targetObj != null)
{
sTargetPath = sTargetPath (NLS_(" ")) identifier (targetObj) (NLS_(" ")) s1 (NLS_(" ")) s2 (NLS_("\n"))
}
if (temp2 != sTargetPath)
{
setCell(row, outlink, sTargetPath)
}
}
}
|
Re: Get Attribute from Outlinked Module SystemAdmin - Wed Apr 25 12:29:10 EDT 2012
Hi,
for o in m do {
col = 0
row ++
for l in o -> "*" do {
string temp2 = sTargetPath
sTargetPath = sTargetPath fullName(target l)
ModuleVersion targetVer = targetVersion(l)
if(exists(module targetVer)){
// if (null data(targetVer))
// {
// Module m2 = load(targetVer, false)
// }
// Works without this condition, but I thought I had to load this module????
targetObj = target l
if (probeAttr_(targetObj,"Attr2") != "")
{
s1 = targetObj."Attr2"
}
else
{
s1 = ""
}
if (probeAttr_(targetObj,"Attr3") != "")
{
s2 = targetObj."Attr3"
}
else
{
s2 = ""
}
if (targetObj != null)
{
sTargetPath = sTargetPath (NLS_(" ")) identifier (targetObj) (NLS_(" ")) s1 (NLS_(" ")) s2 (NLS_("\n"))
}
if (temp2 != sTargetPath)
{
setCell(row, outlink, sTargetPath)
}
}
}
Nevermind it doesnt work without the commented out condition. How do you close the loaded modules? |
Re: Get Attribute from Outlinked Module llandale - Wed Apr 25 12:01:41 EDT 2012
Look through the DXL manual for "LinkRef"; you will routinely need a "LinkRef" loop before your "Link" loop when dealing with outlinks. -Louie |
Re: Get Attribute from Outlinked Module SystemAdmin - Wed Apr 25 12:29:10 EDT 2012
Hi,
for o in m do {
col = 0
row ++
for l in o -> "*" do {
string temp2 = sTargetPath
sTargetPath = sTargetPath fullName(target l)
ModuleVersion targetVer = targetVersion(l)
if(exists(module targetVer)){
// if (null data(targetVer))
// {
// Module m2 = load(targetVer, false)
// }
// Works without this condition, but I thought I had to load this module????
targetObj = target l
if (probeAttr_(targetObj,"Attr2") != "")
{
s1 = targetObj."Attr2"
}
else
{
s1 = ""
}
if (probeAttr_(targetObj,"Attr3") != "")
{
s2 = targetObj."Attr3"
}
else
{
s2 = ""
}
if (targetObj != null)
{
sTargetPath = sTargetPath (NLS_(" ")) identifier (targetObj) (NLS_(" ")) s1 (NLS_(" ")) s2 (NLS_("\n"))
}
if (temp2 != sTargetPath)
{
setCell(row, outlink, sTargetPath)
}
}
}
If the other module is already loaded then the code will work. Note that it can be loaded invisibly; look at "Tools menu >Manage Open Modules...".
for o in m do
{ if (!table(o)) continue // Ignore all objects except "table" header objects
row = -1
for oRow in oTable do
{ row++
cell = -1
for oCell in oRow do
{ cell++
set(row, cell, whatever)
}
}
}
// or forget about "row" and "cell", just set values for "oCell" directly
// oCell.NameAttr = pathInfo
if (probeAttr_(targetObj,"Attr2") != "")
{
s1 = targetObj."Attr2"
}
else
{
s1 = ""
}
|
Re: Get Attribute from Outlinked Module llandale - Wed Apr 25 14:15:09 EDT 2012
If the other module is already loaded then the code will work. Note that it can be loaded invisibly; look at "Tools menu >Manage Open Modules...".
for o in m do
{ if (!table(o)) continue // Ignore all objects except "table" header objects
row = -1
for oRow in oTable do
{ row++
cell = -1
for oCell in oRow do
{ cell++
set(row, cell, whatever)
}
}
}
// or forget about "row" and "cell", just set values for "oCell" directly
// oCell.NameAttr = pathInfo
if (probeAttr_(targetObj,"Attr2") != "")
{
s1 = targetObj."Attr2"
}
else
{
s1 = ""
}
Thanks again for the help. sTargetPath is what I want, so that huge string will be set into one cell in excel for that particular object. SuRS.SMC.33 "/Dubai/Requirements/SyRS SyRS.707 Technical Requirement Not Safety /SelTrac MB 1.04/Requirements/SuRS SMC 60 Information Not Safety " "/Sao Paulo L17/Requirements/SuRS SMC " |
Re: Get Attribute from Outlinked Module llandale - Wed Apr 25 14:15:09 EDT 2012
If the other module is already loaded then the code will work. Note that it can be loaded invisibly; look at "Tools menu >Manage Open Modules...".
for o in m do
{ if (!table(o)) continue // Ignore all objects except "table" header objects
row = -1
for oRow in oTable do
{ row++
cell = -1
for oCell in oRow do
{ cell++
set(row, cell, whatever)
}
}
}
// or forget about "row" and "cell", just set values for "oCell" directly
// oCell.NameAttr = pathInfo
if (probeAttr_(targetObj,"Attr2") != "")
{
s1 = targetObj."Attr2"
}
else
{
s1 = ""
}
Hi Louie, Thanks again for the help.
PM1.1 /PATH/MODULENAME1 ID ATTRIBUTE 1 ATTRIBUTE 2 /PATH/MODULENAME2 ID ATTRIBUTE 1 ATTRIBUTE 2 /PATH/MODULENAME3 ID ATTRIBUTE 1 ATTRIBUTE 2 /PATH/MODULENAMEn ID ATTRIBUTE 1 ATTRIBUTE 2 PM1.2 /PATH/MODULENAME1 ID ATTRIBUTE 1 ATTRIBUTE 2 /PATH/MODULENAMEn ID ATTRIBUTE 1 ATTRIBUTE 2 etc.
|