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: DXL Best Practice
Topic Summary: DXL for (not) Dummies
Created On: 22-Oct-2008 13:48
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.
 22-Oct-2008 13:48
User is offline View Users Profile Print this message


Andrew Tagg

Posts: 151
Joined: 26-Oct-2004

I'm sure we have all seen the dreaded DXL error when running our favourite scripts, but there are a few basics that can reduce the incidence of the script dying unexpectedly, thought I would share a few of my "things I always do" tips. No rocket science here but might make for an interesting thread. I find that most of my scripts can be built up from a few trusty basics:

* Following a link, don't assume that the target object still exists. Always assume there will be null or deleted objects:

for thisLink in thisObject <- "*" do
{
thatObject = source thisLink
if (null thatObject) {continue}
if (isDeleted(thatObj)) {continue}


//OK. now we should have a valid object
{
// do stuff
}
}


* Sure, I'm fairly certain that my favourite attribute is distributed to all of my modules, but lets check first before we try to access that attribute, especially if we have followed a link:

Module mod
bool myAttributeExists = false

AttrDef exists = find(mod, "myAttribute")
if (!null exists) { myAttributeExists = true}
if (myAttributeExists)
{
//do stuff with my attribute, i know it exists in this module
}



OK, im sure there are many more, but here are 2 to start with.....

-------------------------
Andrew Tagg
Thales Air Systems, Melbourne
Australia.
andrew.tagg@thalesatm.com
Report this to a Moderator Report this to a Moderator
 29-Oct-2008 23:58
User is offline View Users Profile Print this message


Paul R Miller

Posts: 29
Joined: 16-Feb-2007

Hi Andrew,

A good way to learn what exception handling is required when working with links via DXL is to use the "Analysis Wizard" to create a DXL Layout column.

Once created you can view the DXL code which includes good examples of the major initialisation and exception handling routines that are needed when dealing with links.

Also a great way for DXL newcomers to learn DXL and fiddle ariound with the code to see how it works.

-------------------------
Paul Miller
Specification Practices Specialist
EuroCyber
Melbourne, Australia
Mobile: + 61 (0) 418 135 103
http://www.eurocyber.biz
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.