Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
Topic Title: Set value of attribute on empty with CSAPI
Topic Summary:
Created On: 17-Oct-2007 15:12
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
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.
 17-Oct-2007 15:12
User is offline View Users Profile Print this message


Francky Vens

Posts: 2
Joined: 10-Mar-2004

Hi,

I have the attribute of an object filled with a certain value.
I try to set the value of this attribute to empty using the CSAPI.

But I get an error:
The fault code: 4
The fault string: CsAPI: CRModify: Failed to modify CR data

I don't want to delete the attribute.
I just want to put the value back to empty.

This is my code:

my $csapi = new ChangeSynergy::csapi();
$csapi->setUpConnection("http","", );
$login = $csapi->Login("","","pt_admin","");
my $problem = $csapi->GetCRData($login,"","problem_number|attrib_xyz");
$problem->getDataObjectByName("attrib_xyz")->setValue("");
my $tmpstr = $csapi->ModifyCR($login,$problem);

If I use this piece of code and I fill in a value for the attribute...
e.g.: $problem->getDataObjectByName("attrib_xyz")->setValue("test");
... it works.

Suggestions?
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 20:55
User is offline View Users Profile Print this message


michael Barnes

Posts: 85
Joined: 12-Nov-2003

I believe that the way Synergy represents an "empty" attribute is not to have the attribute associated with the CR.

Therefore the approach should be to delete the attribute.

I suggets you try this in a "test" database before applying it to your live data, in case the results are not what you want.
Report this to a Moderator Report this to a Moderator
 22-Oct-2007 09:32
User is offline View Users Profile Print this message


Francky Vens

Posts: 2
Joined: 10-Mar-2004

It is however possible to set the value of an existing attribute to empty via the CLI.
I would expect to have the same functionality in the PerlAPI.

Indeed, deleting the attribute and creating it again is a possible workaround.
But not a very nice one.
And it requires some extra checkings in my code.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
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.