Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically
How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically [message #628238] Mon, 22 February 2010 08:30 Go to next message
Kishore Kushwaha is currently offline Kishore KushwahaFriend
Messages: 36
Registered: July 2009
Location: Lucknow, India
Member

Hi,

I am trying to create & apply a stereotype to a UseCase & Activity model element's programatically.

In Class diagram it is done according to the tutorial for "Introduction to UML2 Profiles".
mailto:http://www.eclipse.org/modeling/mdt/uml2/docs/article s/Introduction_to_UML2_Profiles/article.html
(such a nice article for beginners)

I tried to apply same Sterotypes on element 'CallBehaviorActionImpl' of Activity model & 'UseCaseIml' of UseCase Model as did in Class diagram's elements. But found IllegalArgumentException.

Please let me know that How Sterotype can be created for UseCase & Activity diagrams and then applied to their elements?

Thanks in Advance.
--
Regards,
Kishore


Regards,
Kishore
Re: How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically [message #628243 is a reply to message #628238] Tue, 23 February 2010 10:35 Go to previous message
Kishore Kushwaha is currently offline Kishore KushwahaFriend
Messages: 36
Registered: July 2009
Location: Lucknow, India
Member

No need....

Got answer.....

Just use this code while creating Stereotypes:



//---------- Referencing metaclasses -----------------------------------
//For Class Diagram
org.eclipse.uml2.uml.Class classMetaclass = referenceMetaclass(xanalysisProfile
, UMLPackage.Literals.CLASS.getName());
//For Activity Diagram
org.eclipse.uml2.uml.Class activityMetaclass = referenceMetaclass(xanalysisProfile
, UMLPackage.Literals.CALL_BEHAVIOR_ACTION.getName());
//For UseCase Diagram
org.eclipse.uml2.uml.Class useCaseMetaclass = referenceMetaclass(xanalysisProfile
, UMLPackage.Literals.USE_CASE.getName());




Rest of the code will remains the same as mentioned Article in previous post.

Enjoy.....
--
Regards,
Kishore


Regards,
Kishore
Previous Topic:How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically
Next Topic:test
Goto Forum:
  


Current Time: Wed Apr 24 17:42:12 GMT 2024

Powered by FUDForum. Page generated in 0.03341 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top