Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically(Stereotypes on UseCase & Activity diagrams)
How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically [message #515908] Mon, 22 February 2010 08:30 Go to next message
Kishore Kushwaha is currently offline Kishore Kushwaha
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/articles/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

[Updated on: Mon, 22 February 2010 08:36]

Report message to a moderator

Re: How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically [message #516241 is a reply to message #515908] Tue, 23 February 2010 10:35 Go to previous message
Kishore Kushwaha is currently offline Kishore Kushwaha
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
Previous Topic:Naviagate throught UML statemachine diagram
Next Topic:How to Create & Apply Stereotypes on UseCase & Activity diagrams programatically
Goto Forum:
  


Current Time: Thu Oct 23 13:55:19 GMT 2014

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

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