Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
947 views
in Technique[技术] by (71.8m points)

ibm doors - DXL:Cannot assign to an attribute some properties found in history

DXL, ibm DOORS Looping through module, then through every object history, I am trying to assign to "_Owner" attribute the author from obj history who modified last time "_ReqStatus" attribute, if "_Owner" is empty.

This is what I tried:

Module m = current
History h
HistoryType ht 
Object o
string attributName
string authorName
string newOwner


noError()
for o in entire m do {
for h in o do
{   
    string owner = ""
    attributName=""
    attributName = h.attrName
    authorName=""
    owner = o."_Owner"

    if isDeleted(o) then continue 
    
    
    if((attributName=="_ReqStatus"))
    {   
        authorName=h.author
        //print authorName
        //print "
"
        if(null owner)
        {   
            print identifier(o)
            print "
"
            newOwner = authorName
            print newOwner"
"
            owner = newOwner    
            print owner
            break       
        }
        
    }
    
}
}
ErrMess = lastError()

The output for print owner is as expected. My problem is that in-DOORS attribute is not filling at all with any value.

_Owner attribute type is Ennumeration and attribute properties look like this, but I don't know if it matters: "_Owner" attr properties

question from:https://stackoverflow.com/questions/65621762/dxlcannot-assign-to-an-attribute-some-properties-found-in-history

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When you assign string owner = o."_Owner", the variable owner is not a handle to the object attribute itself, but the content of o's "_Owner" attribute is copied to owner. So, in your later recalculation owner = newOwner, you only change that variable and not the attribute. Try o."_Owner" = newOwner instead.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.5k users

...