Hello,
How can I get the list of diagram in which an element (e.g. function) is implemented? As it is the case with the contextual menu "open with Function/Activity diagram editor".
Thx
Well Romain,
that gave me some headache but finally I found a solution that really works, and its in OCL,
heureka:
-- first get all GMF diagram objects the element is onlet diagrams:Sequence(notation::Diagram) = self.mediniGetOpposites('element')->selectByType(notation::Shape).diagram->selectByType(notation::Diagram)-- now search for named diagram hooks that link these diagrams in the projectin projectmodel::PJDiagram.allInstances()->select(d | diagrams->includes(d.oclAsType(projectmodel::PJDiagram).diagram))
This should work for arbitrary objects. Feel free to extend and repost.
Happy Scripting
Jan
Please check these articles:
Sorry, but I do not understand how to use it...
I am more familiar about OCL script into profiling column. So how can I get for every function the list of diagram that implement it, using these script?
Really sorry.
Ah, okay, that's a bit different. So you are developing derived properties? And you would like to stay in OCL?
I don't know if it is possible to do it with OCL. But I would like to have a derived properties from "Functions" to get the list of Diagram's medini identifiers that implement it (if it is possible).
Thanks for your reply and sorry for the headache.
Sorry but I need more context on how/where I should use this OCL script. For example, the line 2 should it be in a derived property ?
Because it does not work for Safety Goal element for instance.
Romain
The complete script should go into a derived property, not just line 2.
And it should work for any kind of element.
IT WORKS!!!!!
Thank you very much