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: Syntax for History attributes
Topic Summary: Need answer from someone who knows
Created On: 25-Oct-2007 18:59
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.
 25-Oct-2007 18:59
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

Hi folks.
I'm using the history capability in DXL for the first time.

This statement (inside a for loop):

History h

if  ((string h.attrName) == "Object Text)

draws the following error in the feedback window:

-R-W-DXL:  <line 999> wrong history type createObject for attribute name

or the following:

R-W-DXL:  <line 999> wrong history type createLink for attribute name

What's really puzzling is it actually does go into the if statement (I have
a print stmt inside to show I went there), and the program doesn't crash
with a runtime error...

I want my users to be able to use this script without seeing this error.

Anyone have an idea what's wrong?

Thanks!


-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time
Report this to a Moderator Report this to a Moderator
 25-Oct-2007 19:23
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Tara put a test in front of your test to ensure your dealing with an attribute history record.

Test is similar to following:


HistoryType ht = h.type
if(ht == createAttr || ht == modifyAttr || ht == deleteAttr) print h.attrName
Report this to a Moderator Report this to a Moderator
 25-Oct-2007 20:33
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

History properties, h.attrName in this case, are defined only for specific History Types. In this case, a 'createObject' history record does not have any defined value for 'attribute name'. So if the h.type is createObject, then don't try to access the h.attrName.

Realistically then, when dealing with history, you need to first get the "HistoryType ht = hst.type", and then do checks to make sure that the type is appropriate for your property. Attached find the functions I use to extract the attribute name, if any, from the History record.

You need trial and error to figure out which properties apply to which types. IIRC, I used a test program that surrounded property extraction with noError() and lastError() calls, in order to figure out which properties applied. I had to create a module with all the various History types which turned out to be quite tricky.

Also, BTW IIRC, you cannot put a 'History' variable into some other structure like a Skip list, figuring to extract it later. Assigning History e.g. h1 = h2 is NOT copying the value of h2 to h1, its assigning an alias of h2 to include h1. Not sure how to get around that.

- Louie

Edited: 29-Oct-2007 at 18:22 by Louie Landale
Report this to a Moderator Report this to a Moderator
 26-Oct-2007 15:57
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

Thank you guys for your responses; they've been of great help.
I have one more little problem.

I'm outputting results to a Microsoft file.  When retrieving
h.oldValue and h.newValue, and then exporting via string
I get all the formatting information with it as in:


{\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}}\viewkind4\UC1\pard\f0\fs20 \par} {\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}}
fficeffice" />>
where is...well, the object text.   How do I get rid of the formatting?

Thanks again for all your great advice.>>
>T. Wilk>>



>



-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time

Edited: 26-Oct-2007 at 15:58 by Tara Wilk

Report this to a Moderator Report this to a Moderator
 26-Oct-2007 16:03
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

My previous message got mangled because of my use of angle brackets.

What I meant to say was the output looks like:

{\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}}\viewkind4\UC1\pard\f0\fs20 OBJECT TEXT \par} {\rtf1\ansi\ansicpg1252\deff0\defland033{\fonttbl{\f0\fnil\fcharset0 Tahoma:}}

where OBJECT TEXT is the actual object text string for either h.oldValue or h.newValue.

So how do I get rid of this pesky formatting?

Thanks again for all your great advice.fficeffice" />>>
>>
T. Wilk>>


-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time
Report this to a Moderator Report this to a Moderator
 26-Oct-2007 16:42
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

Okay, so I figured out this is in rich text format.
How do I strip just the text out of this string?

Thanks,
TW

-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time
Report this to a Moderator Report this to a Moderator
 26-Oct-2007 19:29
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

In case anyone's interested I found a way to do this.
Just let me know and I'll post.
(It might take me a while since I'm working on a black
program and will have to key it in from scratch.)
Thanks again,
T. Wilk

-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time
Report this to a Moderator Report this to a Moderator
 26-Oct-2007 20:03
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

quote:

Originally posted by: Tara Wilk
Okay, so I figured out this is in rich text format. How do I strip just the text out of this string? Thanks, TW

Use plainOldValue and plainNewValue....

History hr

string oldVal = hr.plainOldValue
string newVal = hr.plainNewValue

I think this is what you're looking for at least.



-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 26-Oct-2007 20:51
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

I think you need to work on not hitting the submit button twice Tara.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 30-Oct-2007 12:07
User is offline View Users Profile Print this message


Tara Wilk

Posts: 43
Joined: 7-Mar-2006

I haven't been...don't know what the problem is.

-------------------------
Tara L. Wilk Curmudgeon-at-large, NGC engineer in spare time
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.