Add a Comment to an Element

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Add a Comment to an Element

Postby Thomas Höbinger » Thu Aug 02, 2007 8:04 am

Hello!

How can I mark a comment as annotated to an element in 12.5?

Comment c = factory.createCommentInstance();
c.setBody(comment);
c.setOwningElement(element);

This code generates only an inner element, but documentation is empty? In
12.1 the comment was an inner element and used as the documentation of the
element (so in the inner element list it appeared twice).

thanks
Thomas


Thomas Höbinger
 
Posts Rating:

Re: Add a Comment to an Element

Postby Martynas Lelevicius » Thu Aug 02, 2007 11:48 pm

Hello Thomas,

Create comment like this:

Comment c = factory.createCommentInstance();
element.getOwnedComment().add(c);
c.getAnnotatedElement().add(element);

Regards,
--
Martynas Lelevicius
Programmer
No Magic Lithuanian Development Center
Savanoriu pr. 363, LT-49425, Kaunas
P.O. box 2166, LT-44011, Kaunas
Phone: +370 37 324032 Fax: +370 37 320670
E-mail : marte
WWW: http://www.magicdraw.com

Martynas Lelevicius
 
Posts Rating:


Return to Programmatic Extendibility

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron