Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Can I Stop DXL Attribute Code?
Topic Summary:
Created On: 28-Jan-2004 15:32
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 28-Jan-2004 15:32
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 97
Joined: 14-Aug-2003

DOORS 7.0 SP1 (BUILD 70210)

I have a situation where AttributeDXL code in a formal module is causing DOORS to crash. (Loop continously consuming memory then DOORS just exits)

The problem is I haven't been able to figure out how to open a formal module WITHOUT executing attribute DXL Code. The command line parameters do a nice job by allowing you to turn off triggers but how do they turn off attribute DXL or even layout DXL code for that matter?

So until I can open this formal module without invoking DXL code the module (And all of it's data) is hopelessly locked.
Report this to a Moderator Report this to a Moderator
 28-Jan-2004 17:27
User is offline View Users Profile Print this message


Jonathan Marshall

Posts: 27
Joined: 10-Apr-2003

Attribute DXL is only executed when the attribute is accessed for the first time, so you should normally be able to open a module without running it. However, if you have a column in the default view which contains the problem DXL then, if you open the module in visible mode, the DXL will run.

The following code will open the module without viewing it and then reset the default view to the standard view which should then allow you to open it normally.

Module m = edit("Insert Module name here", false)
string s = clearDefaultViewForModule(m)
if (!null s) {
print s "\n"
}


Note. This works in Version 5.2. I can't guarantee it for 7.0 as I haven't got it

Jon

-------------------------
Jonathan Marshall
EADS Astrium
Report this to a Moderator Report this to a Moderator
 28-Jan-2004 17:44
User is offline View Users Profile Print this message


Jonathan Marshall

Posts: 27
Joined: 10-Apr-2003

P.S. You might also need to clear the user default view:

s = clearDefaultViewForUser(m)


Jon

-------------------------
Jonathan Marshall
EADS Astrium
Report this to a Moderator Report this to a Moderator
 28-Jan-2004 22:59
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 97
Joined: 14-Aug-2003

Jon,

Even opening a module in the standard view. Any DXL Attributes (even those in other views) get executed when you open the module up.

Thanks for the "clearDefaultViewForModule" thought. I guess I'll write user function. I'm just surprized that telelogic doesn't anticipate stuff like this because not everyone wants to write DXL. I have no problem but I'm sure there are many people that just will not write DXL to fix such issues.
Report this to a Moderator Report this to a Moderator
 29-Jan-2004 08:48
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

I would suggest the following:

Never create a DXL attribute without first testing the code in layout DXL.
This way you will avoid this sort of problem.

Also, try to protect the code from itself by probing attributes before trying to read them.
i.e. use the probeAttr_() function rather than the dot operator to access attribute values.




-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 29-Jan-2004 09:55
User is offline View Users Profile Print this message


Jonathan Marshall

Posts: 27
Joined: 10-Apr-2003

That is strange. It does works in 5.2. If I have a DXL attribute which is not in the default view the code is definately not run when I open the module, even when I open it visibly.

I checked the V7.0 manual and it says:

"This means the DXL code is not executed when the containing module is opened, but when some
event occurs that causes the attribute to be accessed. For example, the event could be because the
attribute is being displayed in a column, or because the user opens the Formal Object Editor window
on an object with a DXL attribute value."

So it sounds like it should be the same.

Jon

-------------------------
Jonathan Marshall
EADS Astrium
Report this to a Moderator Report this to a Moderator
 29-Jan-2004 16:27
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 97
Joined: 14-Aug-2003

Tony,
Good suggestion. Although, this situation occurred due to a user doing something unexpected (as usual).

But my question to you Tony is: Is there any documentation on probeAttr_()? What does "probing" the attributes do? Why do it before reading them?

Jon,

After further testing, I have found that the DXL Interpreter appears to do a syntax check of the Attribute DXL source code although it doesn't execute the code until the attribute is accessed, as you have stated. So, there is an interesting twist

Thanks guys for the interest and input I appreciate it.
Report this to a Moderator Report this to a Moderator
 29-Jan-2004 18:36
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Attribute DXL fires when you open the module, when you do so on Demand (tools menu?), and when you display the object.attribute of an attribute DXL that is null. So if you have attribute DXL that displays info on Linked objects then the result of unlinked objects will be null. If you set the "obj.attrDXL" to null then THAT will get recalculated every time. That is, null AttrDXL gets calculated as often as Layout DXL.

Try this:
Results = calculate results for this "obj".
if (null Results)
obj.attrDXL = " " // a space, not null
else obj.attrDXL = Results

If you have other DXL that queries the value of an attribute DXL, you probably need:
if (null obj.NameAttr or obj.NameAttr = " ") ...

- Louie
Report this to a Moderator Report this to a Moderator
 30-Jan-2004 08:19
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

The probeAttr_ function is defined in DOORSHOME/lib/dxl/utils/attrutil.inc.

In its simplest form, string probeAttr_(Object o, string attributeName) returns the attribute value as a string. If the attribute does not exist or is unreadable it returns an empty string.

This is a lot safer than accessing the attribute directly by using s = o.attributeName.

I don't understand why this sort of really useful stuff is not documented.


-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 30-Jan-2004 15:08
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

The probeAttr_ functions have a fatal but that they do NOT check for the appropriate attribute properties. So

string Value = probeAttr(obj, "Prefix")

DOES generate a DXL error, since "Prefix" exists but is not an object attribute.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.