How to integrate OCL constraints to a model created with Eclipse Sirius? - ocl

Its difficult to give more details as I haven't even found a clue in OBEO Designer Community to model OCL constraints.
Anyone has a idea how to do this?
Thanks

You should be able to add Validation rules with a constraint expressed in AQL -- Acceleo Query Language (a flavor of OCL) directly in the .odesign file.
See thecorresponding part of the tutorial.

Related

Oracle APEX Application Builder's Search Application Functionality

Does anyone know how "Search Application" functionality of Oracle APEX's Application Builder implemented. Are there any APIs that developer's can take advantage? I would like to search for a text in apex application source code.
Any suggestions would be of great help.
You can use Oracle Text to help find and markup results for hetergenous data. Here is my old session on the topic, and I've seen a few others around.
https://www.slideshare.net/ScottWesley/oracle-text-in-apex
Oracle's learning library:
https://apexapps.oracle.com/pls/apex/f?p=44785:24:6694877585964::NO:RP,24:P24_CONTENT_ID,P24_PREV_PAGE:8961,2
The results probably use the detail view of an IR, or a template defined for a classic report. In 5.2 the search feature uses different technology - Spotlight search.
APEX metadata can be found in a number of dictionary views, depending on what source code you're looking for. See apex_dictionary view.
Update Oct 2018
Daniel H has created a new plugin, leveraging the spotlight search functionality available in the 18.x app builder.
https://github.com/Dani3lSun/apex-plugin-spotlight

Can i add ocl to ecore with java code?

I want to add ocl to my .ecore metamodel with java code. But i cant find any example or tutorial.
So i want to ask is tihs possible or where can i find sample codes?
Did you check OCLinEcore? It allows embed OCL in your ecore model and edit it like a text which may be edited with the aid of syntax and semantic validation and completion suggestions.
This is exerpt from the link:
OCL can be embedded in Ecore using annotations. Maintenance of these
annotations is performed automatically by the OCLinEcore editor ...
The embedded OCL becomes active when the appropriate delegate
functionality is specified.
There are three type of delegate functionality:
Setting Delegate
Invocation Delegate
Validation Delegate
Also there are invariants constraints.
I see two alternatives:
Use EVL (Epsilon Validation Language), it is included in EMF (Eclipse Modeling Framework). In that way, you just right click .ecore model and create a new EVL Validation (under Epsilon options). EVL syntax is well documented on Epsilon book https://www.eclipse.org/epsilon/doc/book/.
Use OCL directly. For this purpose yo need to install OCL component on EMF. So, if you are using Eclipse, Help > Install Modeling Components > Find: OCL. Check the obtained result. Now this tutorial could help you http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FCompleteOCLTutorial.html.
I wish this could help.

Is it possible to generate real Java code with Dresden OCL Toolkit?

I tried using Dresden OCL to describe constraints for an UML class diagram. It looks like it can generate AspectJ code fine but I could not find a way to generate the Java code representing the modeled classes (and their attributes and methods). The examples provided with Dresden OCL Toolkit also show how to generate AspectJ code once the Java code is already present (OCL22Java tutorial).
Is it possible to generate the Java (not AspectJ) code with constraints embedded inside? And if it is, then how is it done?
It is not possible to do that with Dresden OCL Toolkit, therefore some other tool must be used for that. I used Uml2Java for Acceleo.
The standalone engine of DresdenOCL (StandaloneFacade) includes a function called generateJavaCode. I'm not sure though if this function is actually "complete" and generates correct Java Code for all possible OCL constraints. You also cannot find any info about that function on Google, it's just used in the standalone example.
Edit: As an example what Java code it generates:
For this OCL expression (on some simple UML model that I created)
context person
inv: self.age >= 0
you get this piece of Java code
(aClass.age >= new Integer(0))
And for this OCL expression
context person::havingBirthday()
post: self.age = self.age#pre+1
you get this:
((Object) aClass.age).equals((atPreValue1 + new Integer(1)))
So the generated Java code is not that usable atm, you need to modify it (or your Java functions) a bit to actually use it.
Eclipse OCL provides support for enriching the Java generated from Ecore models with complete inline Java code for OCL embedded within Ecore. Eclipse UML2 provides support for converting UML with embedded OCL to Ecore with embedded OCL. This now provides all that you ask for. It has been available for a couple of years. See the Code Generator tutorial in the Eclipse OCL documentation for an example and further information.

Bidirectional M2M Transformations using Eclipse EMF

I would like to do bidirectional Model2Model transformations. Both models are EMF / eCore based. Actually I would prefer that one model is an editable view on the other.
What are my options?
Which tools and tranformation languages are avaiable and what are their restrictions?
M2M are the hardest. Industries strength tools are rare, lots of academia stuff. If you're dead set on a M2M language, look into ATL which should also support ecore. Otherwise you can look at Xtend, which was made for model to text but you can abuse it and it should be more comftable than plain java. If your into research look at Scala based transformations here
http://metrikforge.informatik.hu-berlin.de/attachments/download/193/george_wider_scheidgen_ICMT_2012.pdf
There are more transformation tools than you can imagine for EMF, its kind of crazy...
For metamodel to metamodel transformation where the models are not very similar:
ATL is probably the most popular and most "baked"
Epsilon project has the Epsilon Transformation Language.
If the metamodels are very similar and you only need to tweak some things then there are tools targeted that type of migration/updating:
ATL now has a refining mode
Epsilon has Flock
Edapt looks very interesting as well because it does the metamodel/model changes together. It lets you work on a tree view and comes with a set prebuilt set of rules.
Henshin which lets you operate on a diagram view of the model
EMF Refactor is a more code-level approach, that can also use Henshin rules somehow.
You can always directly manipulate the metamodel and model using the EMF Java APIs as well.
I'll add, if you are doing any real EMF work you will need to get and read EMF: Eclipse Modeling Framework. It's available in Safari also. I highly recommend Safari, for $39 a month you get almost every development ebook you could ever use.
If you insist on doing bidirectional M2M transformations, (so-called Bxs), then know that there is an active researcher's community updating that wiki : http://bx-community.wikidot.com.
If you visit it, you will find that they list a bunch of tool suitable for Bx transformations http://bx-community.wikidot.com/relatedtools.
I used ECHO in the past which provides an implementation of QVT-R based on the KodKod constraints solver.
It's definitely worth giving it a try.
Since you specifically asked for bi-directional model transformations, I must say that you have no options. To make it claer, adding to the answer you got form Ed Willink, none of the existing M2M transformation languages (AFAIK) supports bi-directional model transformations.
Work on a QVTr and QVTc execution engine is starting to look promising if you are still interested in this: QVTd Project.

What is the best way to map requirements to features in Redmine?

I am new to Redmine and I'd like to see if there is a good way to relate requirements (as stated by a product manager) to issues in Redmine. To me it seems that a low impact way to do it would be to define a requirement tracker and then add a custom field with a list of links to feature tickets.
I have tried doing this but cannot figure out how to add a link within a custom field text box.
So I guess I have a general question and a specific question,
General) Is there a recognised recipe in the Redmine community to achieve a linkage from a requirement to a list of features or issues?
Specific) Can I create a link to another issue within an issue field?
I think the answer to both questions is to use the built-in mechanism to link issues - it's called related issues.
Once an issue is created, you can add link to an other issue and indicate the type of relation (related to, blocks, precedes, etc.)
To separate requirements and features by means of a different tracker seems good to me, expecially if you'd like to apply different permissions or workflows.
See also the redmine manual about related issues, and an example of an issue with related issues http://www.redmine.org/issues/337
EDIT: More recently, subtasks have been added to redmine. They may be interesting to use in a scenario where a feature (issue) is implemented by means of different steps (=subtasks, like designing, programming, documentation,...) and/or by different persons (for example designer, programmer, ...).