[SOLVED] Failed to add a node in Activity diagram in a standalone application [message #891988] |
Tue, 26 June 2012 18:48 |
Alfredo Motta Messages: 41 Registered: June 2012 |
Member |
|
|
Hello everybody,
I have created this simple model with one activity inside and I was trying to add the first node to the activity (the initial node)
Unfortunately there is now way I can get it done. The activity get correctly added to the model, but not the initial node
here is the code
//Create the model
Model model = UMLFactory.eINSTANCE.createModel();
model.setName("Calico model");
//Create the activity
Activity activity_=UMLFactory.eINSTANCE.createActivity();
model.createOwnedType("Activity", activity_.eClass());
//Create the initial node
InitialNode initialNode_=UMLFactory.eINSTANCE.createInitialNode();
//add it to the activity
//initialNode_.setActivity(activity_);
//another try
activity_.getNodes().add(initialNode_);
//another try
//initialNode_ = activity_.createNode("test",initialNode_.eClass());
//save the model
ResourceSet resourceSet = new ResourceSetImpl();
UML300ResourcesUtil.init(resourceSet);
Resource resource = resourceSet.createResource(URI.createFileURI("/home/motta/Desktop/Calico/CalicoSoft/AnalysisPlugin/model/model.uml"));
resource.getContents().add(model);
resource.save(null);
here are the libraries I am using
org.eclipse.emf.common_2.7.0.v20120127-1122.jar
org.eclipse.emf.ecore_2.7.0.v20120127-1122.jar
org.eclipse.emf.ecore.xmi_2.7.0.v20120127-1122.jar
org.eclipse.emf.mapping.ecore2xml_2.7.0.v20120130-0943.jar
org.eclipse.uml2.common_1.6.0.v201105021727.jar
org.eclipse.uml2.uml_3.2.100.v201108110105.jar
the xmi is attached. I am on Indingo
Thank you for your help
-
Attachment: model.uml
(Size: 0.32KB, Downloaded 417 times)
[Updated on: Wed, 27 June 2012 03:07] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04071 seconds