![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
P.S. You might also need to clear the user default view:
s = clearDefaultViewForUser(m) Jon ------------------------- Jonathan Marshall EADS Astrium |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Can I Stop DXL Attribute Code?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.