Comments (6)
1 There are three good sets of supplements
the MagicDraw uml metamodel manual which you can use to help in meta chain
navigation
The ocl cheat sheet which can be found on Google I think from utep (a link
used to be in the manual)
And the manual you mentioned
2 That is the internal MagicDraw java object id. You will have to traverse
the metamodel to find other identifying information such as r().ID which
will return the Uml id. A good reference for this is the MagicDraw uml
metamodel manual which you can find in the help menu
3 this is uml v() number one gets you the value specification v() two gets
you the value of the specification.
4 ocl is defined by the uml metamodel so you just need to follow those
pathways. Again see the uml manual. Instance specs are possible but they
are a challenging party odd the spec to navigate for example the name of a
slot is not slot.name but is slot.definingFeature.name since slots get
their name from the property that they are instances of.
5 the best examples are in the manual when discussing viewpoint methods for
collection via expression such as collect by expression and column by
expression
On Friday, May 6, 2016, gt831c [email protected] wrote:
Question 1:
Is there any documentation on the MDK > Run OCL Query feature?I'm going off of what is in the Manual in "3.7. Create and Evaluate OCL
Constraints" but I'm really having a hard time getting started. It's like I
ALMOST have enough info to start and use it based on what's in there but
it's just not quite filled out enough with enough examples. And when I try
to get started with reproducing examples in the tool, I'm still not able to
get any results that look normal or what I might expect.Question 2:
On Blocks I can do 'r()' and get a list of relations and it returns:
[com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@
726a866
https://github.com/com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl/MDK/commit/726a866e,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@
702f3f4
https://github.com/com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl/MDK/commit/702f3f49
]What is that? A unique ID?
These are my two associations and they are named:
r('controls') --- [
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@
726a866
https://github.com/com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl/MDK/commit/726a866e
]
r('worksin') --- [
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@
702f3f4
https://github.com/com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl/MDK/commit/702f3f49
]Question 3:
self.get('budget').v().v()
returns: 3 Which is my default value of my value property called 'budget'.
But I'm so confused why I have to say v().v() twiceAnd when I do:
self.get('budget')
This returns:
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.PropertyImpl@35cec18
https://github.com/com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.PropertyImpl/MDK/commit/35cec187What does this really mean? That it found an attribute that matches the
name 'budget'? So how would I report on default value? Why does .v().v()
work?Question 4:
Another question, is OCL only meant for Block evaluations? I cannot run
this on Instance Specifications? Because those instance specifications can
be populated with real values (their slots) and I can do OCL evaluations on
the data populated?Question 5:
I guess I'm just getting started with OCL and trying to figure out the MDKRun OCL Query feature, and more importantly, really try to figure out how
this can be leveraged, do you have a few examples of when it would be good
/ useful to use the MDK > Run OCL Query feature?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#27
-Chas
from exec-cameo-mdk.
Apologies for my lack of punctuation and spelling errors. Auto-correct can be a difficult beast when trying to be precise.
from exec-cameo-mdk.
Here is a link to the ocl quick reference I use all the time (i need to remember to add it to the repo)
http://computerscience.unicam.it/culmone/?download=ocl-ref-short.pdf
from exec-cameo-mdk.
OCL Evaluator Questions:
I’m still trying to figure out how to use MDK > OCL Evaluator and going through some attempts
Example 1: Using OCL Evaluator I want to select a Block Definition Diagram from the browser, report its name (Question 1), diagram type (Question 2)
Example 2: I have a package that contains a Block Definition Diagram, Classes, Instance Specifications, a comment, and some relations. Using OCL Evaluator I want to select a package and report on the contained element names (Question 3), and contained elements types (Question 4)
Example 3: I select block on the diagram and want to report its stereotype (question 5).
Example 1 Question 1: Name of Diagram?
Block Definition Diagram (BDD) – Using OCL Evaluator I want to report on the Name of my diagram.
I have a Block Definition Diagram that has some blocks on it and relationships connecting them on the diagram. From the Browser I right-click on the “OCL Test” Block Definition Diagram (BDD) > MDK > Run OCL Query.
When I enter the expression ‘self’ it returns:
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.DiagramImpl@b2d8f89
This is not useful for me, I want to know the name in English, not java. I noticed that in suggested completions it had ‘name’.
Doing ‘self.name’, it returns:
OCL TEst
Useful.
Example 1 Question 2: Report Type of Diagram?
self.type() returns:
interface com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram
How do I get OCL Evaluator to tell me that this is a block definition diagram. Or at least tell me in English what its type is?
Example 2 Question 3: Report names of contained elements within the package?
I highlight the package from the browser, right-click > MDK > OCL Query,
Type: ‘m()’, this returns:
[com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@1176c9b2, com.nomagic.uml2.ext.magicdraw.activities.mdfundamentalactivities.impl.ActivityImpl@1612ae99, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@1fc65f21, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@674ab343, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@53389fe3, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@73490445, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@47090894, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@1b50edd, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@77c0b381, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@7e5ed123, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@1608013f, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@1a526fab, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@3a92bca, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@1a75751d, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@609b3037, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@22792600, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@6d0539e, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@25eb0b87, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@169dd750, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@41f2b7, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@5c1a01db, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@4ce78d89, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@76528a21, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@2d46152a, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@2070f7c2, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@1e45d7d5, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@52922ff1, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@2597bdec, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@48f40707, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@4331c634, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@6f32ca6d, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@7b93508f, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@7ace4eaf, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@e82fc75, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@2608a77b, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@6246ae7b, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@64e0c43f, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@5d3558fc, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@76ca6b38, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.AssociationImpl@1b3694ab, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@2dbd0632, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.InstanceSpecificationImpl@4e957548, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.CommentImpl@4df8b354, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.DiagramImpl@b2d8f89]
How do I get this to give me the names in English? m().name returns ‘null’
Example 2 Question 4: Report the contained elements types that are found within the package?
I highlight the package from the browser, right-click > MDK > OCL Query,
of those items listed above, how do I display the types of objects they are?
Example 3 Question 5: How to Report the stereotypes of the block element that I have selected on the diagram.
I highlight the block on the diagram right-click > MDK > OCL Query,
Type in ‘s()’, this returns:
[com.nomagic.uml2.ext.magicdraw.mdprofiles.impl.StereotypeImpl@1584233c]
How do I get this to be the English name of the stereotype so that I can read it?
Question 6: Is it just easier for me to learn first on using your viewpoints / views doc generation reporting capability first to make tables since I guess the values magically come out in English form vs this direct OCL Evaluator which seems to return java? I guess I’m still having a hard time getting started
from exec-cameo-mdk.
Example 4: Question 7: I have an object on a diagram. It's a block with some directed relationships, one directed association goes out to another block. It also has a directed association coming into it from another block. When I do:
r(), it returns:
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@4e0e89a0 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1d1d9eed (name: OclInvalid_Class) (instanceClassName: null) (abstract: false, interface: false))
How do I find the name of these relations? How can I report on the source / target?
When I try something similar in the manual:
r('controls').oclAsType(Dependency).target, this returns the same thing
So does:
r().oclAsType(Dependency).target
from exec-cameo-mdk.
I see your questions I will try to respond soon
from exec-cameo-mdk.
Related Issues (20)
- ownedRuleId and view gen issues HOT 1
- documentation changes will not import to md
- SAML Integration
- 2022x compatibility HOT 1
- validate element gets server elements recursively
- 2022x changes HOT 3
- MDK doesn't report offending elements on commit HOT 2
- Docgen user manual generation fails for OCL examples
- statistics after commit are wrong HOT 1
- csync is missing commits
- view generation for diagrams in mounted projects
- Multibyte characters are removed HOT 3
- Getting stuck at "Generate view contents recursively" HOT 1
- ownedRuleId issue
- MDK fails to add org/project in Cameo 19. HOT 6
- MDK fails to generate view contents in Cameo 21x HOT 2
- Need help on How to alternately display paragraphs and images through Viewpoint Method HOT 5
- Is there any way to sort prefixed and multi-leveled IDs? HOT 2
- Questions about Undefined Cover Page of Project and <html> prefix
- 2022x PDF Generation Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exec-cameo-mdk.