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: addDataObject() example to show how to add new attribute to CR?
Topic Summary: addDataObject() example to show how to add new attribute to CR?
Created On: 20-Nov-2006 18: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.
 20-Nov-2006 18:12
User is offline View Users Profile Print this message


Coman Wakefield

Posts: 18
Joined: 1-Jun-2005

I want to add a custom attribute to a new CR that I am submitting via the API. NOTE: The new attribute has been added by our synergy administrator, but does not appear on the CR submission form or on any existing CRs.

My confusion is over the addDataObject API call which appears to be the correct call I need to make to add a new custom attribute. this call takes a populated apiObjectData object (containing the properties for the new attribute) and adds it to the CR.

This is all well and good, but appears no way of creating a new "rmpty" apiDataObject as the constructor for new ::apiDataObject takes (xmlData).

The API documentaion lacks an example of the addDataObject call in action.

What I've resorted to is creating a new apiDataObject by using the first attribute in the objectVector for the CR, and then I change certain attribute properties.

However, I'm surely missing something - it appears to work but I cannot believe it was designed to be done this way?

my $objectData = new ChangeSynergy::apiObjectData($objectVector->getDataObject(0)->getXmlData());

$objectData->setName('<attr_name>');

$objectData->setType('<attr_type>');

$objectData->setValue('<attr_value>');

$objectData->setReadOnly(1);

$objectData->setRequired(1);

$objectVector->addDataObject($objectData);

Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 1 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 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.