Does the OMG provide a version of the MOF 2 specification as an XMI document? - specifications

I can't seem to find one on the OMG's website.
I need this document for bootstrapping the M3 model so I can load the UML metamodel (M2)
http://www.omg.org/spec/MOF/2.0/
I can build on my self by drudging through the PDF specification, however I was hoping to find a prebuilt model.

Ah here it is - looks like it's only available to members:
http://www.omg.org/cgi-bin/doc?ptc/2006-06-06
Drats.

Related

Generate code from Use Case Diagram creates lots of empty classes

In a Papyrus Model, I clicked the Use Case Diagram (which is quite simple - contains about 5 use-cases), and selected "Designer -> Generate Java Code".
In response, I got hundreds of new packages, each of which contains hundreds of empty classes, with strange names such as "Aaixixnrpr", "Aclywqwwlr", etc...
What is happening?!
Papyrus SW designer does not have a particular code generation support for "use case" elements, i.e. it will treat an Actor or a Use Case just as a UML class. This means that it will create an empty Java class, unless you add operations/opaque behaviors.
But the Java code generator should not create classes for elements that are not in the model. Can you please double check via the model explorer that elements such as "Aaixixnrpr" do not exist in the model?
Which version are you using? (I recommend to use version 1.0.5 from this update site on an Eclipse oxygen). Btw, I also recommend to use the Papyrus forum for questions like this.

fUML, Papyrus and Basic Operations

We aim to execute fUML specifications written in Papyrus using the fUML reference implementation. This has not been challenging since an UML model containing a single Class diagram and one or more Activity Diagrams can be directly executed by calling the fUML constructor:
new Fuml(File);
However, it is difficult to specify complex behaviors without basic Integer operations. For example, 'equals', 'greater'...
I am aware that there is some library of such functions that can be selected using OpaqueBehaviors. Therefore, my question is: where and how can those such "basic operations" be found?
Sorry, this question was just pointed out to me recently. But, in case you haven't figured it out yet, I do have an answer for you.
The library you are looking for is the Foundational Model Library, which contains packages such as IntegerFunctions, BooleanFunctions, etc. The normative fUML specification includes a standard XMI file for this library (at http://www.omg.org/spec/FUML/20121019/fUML_Library.xmi, for fUML 1.1). However, to use the library in Papyrus, you need an Eclipse .uml version.
If you want, you can convert the normative XMI yourself: Download the file and open it in the Eclipse UML Editor (not Papyrus). Select File > Save As and save the file with a .uml extension (fUML_Library.uml). You should then be able to import this .uml file into Papyrus and reference the functions in it from your activity models. As long as you maintain the normative element IDs from the original XMI file, the reference implementation will know that these are standard library functions, for which it has built-in implementations.
However, there is actually a .uml version of this library already available for Papyrus. It is included with the additional Moka Model Execution component for Papyrus. If you install this component, then the fUML model library becomes available as a "registered library" that you can import into your model and use as above.
Note that Moka also includes an fUML execution engine that you can use to execute activity models directly within Papyrus (see https://wiki.eclipse.org/Papyrus/UserGuide/ModelExecution). However, any models created in Papyrus that can be executed with Moka can also be executed externally from Papyrus using the reference implementation, just as you have done before.

problems were detected while vaidating & converting Ecore models. The names are not well formed for model objects in diagram

I tried to install the EMF plugin inside eclipse but some of the default Ecore diagram and EMF Generator Model projects were not available.
So downloaded a different eclipse installer for modelling i.e. Eclipse Modeling Tools (275 MB ) and found all the relevant model related & diagram based project now.
I have followed the same tutorial http://www.vogella.com/articles/EclipseEMF/article.html .
I was able to create the webpage model diagram & then the webpage.ecore file but then the webpage.genmodel the model generator file was giving errors like the ” names used in the diagrams for the objects are not well formed ” in webpage model diagram .
I googled for these errors which according to me mean that the names are not proper according to the given language for modeling constraints & no resolution to these errors were found.
then tried to ignore the errors and tried Generating the domain classes for java code, java code is generated but then the other following modules Create your model & Edit your model under Run your plugins category does not work further due to the previous errors on this link http://www.vogella.com/articles/EclipseEMF/article.html.
Please help me debug these errors
check if Name property is not null , you need to fill it
http://emftools.tuxfamily.org/wiki/doku.php?id=emfvb:quickstart
You need to set the name of Epackage and also prefix and URI
[1
[2

Serialize Eclipse Graphical Models (e.g. BPMN Diagram) to XML

I'm working on a project where I have to build a graphical process modeler for a proprietary BPM (business process management) system made in java. I'm mentioning that the software is proprietary because it does not follow ANY international standards like BPEL, BPMN, XPDL, and this is a vital information for any answers I may get.
My intended approach is to use the eclipse GMF to create a standalone RCP application, similar to Bonita Studio, where business analysts will graphically model the business processes and deploy the process model into the web application.
This application has an internal wizard-like process modeler, very rudimentary. But this modeler has a functionality to import and export models in a custom, well defined XML format, which is also proprietary and has no international standards.
What I need is to persist the graphical model created with the eclipse gmf rcp application I'm developing into this custom XML format. This way I can simply invoque the import function in the web application and the process will be deployed. I also need to be able to do the reverse: open a custom process in this XML format into my eclipse RCP and show it in a graphical manner.
So, what I need is:
I need to save a graphical diagram in a custom XML format and open a custom XML file in this format and show it as graphical diagrams
Thank you very much for any help!
GMF is using EMF models to store its diagrams. As EMF Models are already able to map to XML, a XSL stylesheet transformation might be enough in most cases to map your model to your custom XML format and vice versa.
Daniel, I had this requirement for exporting diagram as XML and vice versa. I'll give you the procedure that I have followed below.
GUI to XML : - Use your model file in the below code to return the root element as java object.
Note : - Assuming GMF editor generates 2 files, one for model and one for the diagram, you have to choose the model file as input to the below code.
File model_file = new File(Path_to_your_model_file);
ResourceSet rs = new ResourceSetImpl();
URI fileUri = URI.createFileURI(model_file.getAbsolutePath());
Resource res = rs.getResource(fileUri, true);
Model model = res.getContents().get(0);
In the above line Model represent your root object of your ecore model. Now as you got the root object you can use it to get the all the values, references, etc
Using these you can manually write a java code to write a XML file.
XML to GUI : - This is pretty straight forward too
Create a new object for the root element for your model by using the below code.
ModelImpl model = (ModelImpl)ModelFactoryImpl.eINSTANCE.createModel(); // Replace Model with your model element name
You have to first parse the XML file using JAVA and read all the values step by step and assing the attributes to the model object step by step (for example : model.setName(doc.getDocumentElement().getAttribute("name")); and ChildObjImpl childObject = (ChildObj)ModelFactoryImpl.eINSTANCE.createChildObj();)
You can create all the different required objects that are supported by your code and then add them to the parent object (for example : model.getChildObject().add(childObject)); )
Once you have finished adding all the info from XML into these objects, you can use the root model object to create the model file as shown below
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi",new XMIResourceFactoryImpl());
Resource resource = resourceSet.createResource(URI.createFileURI(path_where_u_want_to_save_the_model_with_filename));
resource.getContents().add(dd);
resource.save(null);
Above code will generate the model fine, you can right click that file and generate the diagram file.
I don't know if there is a better way to do this, but this one worked for me well. Try it and let me know if you need further help.

GMF live constraints - validation

I have an emf model and i'd like to make a GMF editor to create instances of this metamodel.I'd like also some live constraints to avoid some connections between the components of my EMF model.e.g:My EMF consists of A,B,C,D components which derive from a General class called F and there is reference within F which connects F->F,as such this is able to provide me with connections in between the A,B,C,D components.
But when i am at the GMF editor i'd like a mechanism to avoid connection A->B and allow only connection A->C.
I read that this is able to be achieved with OCL language and link constraints that are able to be added at the gmfmap file.
But i couldn't find any tutorial with the vocabulary of OCL and examples doing that live validation
Any directions from someone?
After a deeper search I found a very useful and fast framework for validation. It is called Eugenia from the Epsilon group.
Eugenia lets you create all the appropriate files for the final GMF editor through a single file (extremely awesome,because otherwise you have to declare gfmtool, gmfgraph, etc by your own) and afterwards you can create a new EVL file which holds the constraints and the invariants of your model.The mapping is been doing easily by providing and extension point at your metamodel URI and all you have to do is to include your new plugin which containts the evl file at your final Eclipse configuration. http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-integration/
(Be careful, do not generate the diagram code as an RPC application because the RPC is not going to work. For any further information have a look here : http://giampow.blogspot.com/2010/06/eclipse-rcp-application-custom-problems.html )