Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Need OCL help
Need OCL help [message #46443] Wed, 23 August 2006 08:22 Go to next message
Eclipse UserFriend
Originally posted by: camil.bartkowiak.imbus.de

Hello,

well how should i start to ask my question:-))
OK well i'm doing my thesis right now and got some Modeltransformation problem.

I'm using ATL(ATLAS Transformation Language) for my Modeltransformation.
My model is drawn by MagicDraw11.5 and its some .uml2-file.
MD11.5 got some nice EMF UML2 XMI export function which generater some valid .uml2-file
which can be directly read by ATL.

OK my model is some ActivityDiagram. It got some InitialNode (Start) and FinalNode.
Between there are CallOperationActions, ControlFlows, decisionNodes, MergeNodes.
Now what i want to do with ATL is a transformation into some SequenceDiagram.
But not simply the "whole" AcitvityDiagram into ONE big SequenceDiagram with all elements.
no no i want ONE Sequencediagram for EVERY path from Start to EndNode.

Well u can imagine that some ActivityDiagram got more than ONE "path" from Start to Endnode.
For example there is one decisionnode with 5 outgoing edges. So if i took the first edge and go till FinalNode
i also have to "come back" and took the next edge and again went to FinalNode.
That's how i want to generate my "paths".

OK ATL is OCL Based. So i can generate helpers,and use all that OCL stuff;-))
So what i want to do in first step is getting the path.
I want generate a Sequene{} for EVERY possible path.
And inside my Sequence there are my UMLElements from my input-model.
So my Sequnence will start with
Sequnece{IN!UML2InitialNode....} and it will end with Sequence{IN!UML2FinalNode}.
BUT i dont want simply use the .allInstancesFrom('IN') function cause that would give my
ALL elements as ONE big sequence{}.
That's what i dont want. I want to collect that elements i "pick up" on my path. And save that collection
as a Sequence. Later i want to transform the UMLElements into other UMLElements.
e.g
from s : UML2!InitialNode
to t : UML2!Lifeline
name <- s.name
.....

Well maybe someone can help me doing such a helper or i bet more than one helper.
The tricky part were the DecisionNodes cause here i have to pick ONE outgoing edge and follow it.
But i have to check all outgoing edges.?!?

Thx for any helps.
Regards
Camil
Re: Need OCL help [message #47500 is a reply to message #46443] Tue, 29 August 2006 09:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Camil,

If you were working with EMFT OCL, I would suggest writing helper operations
in Java to provide the complex looping and collecting of elements that you
need to do, and implement a custom Environment to make these operations
available to OCL.

Since you are using ATL's OCL implementation, I can't suggest how you might
do the same. Using OCL only would likely be cumbersome in the extreme:
you would have a large number of forAll(...) iterators on "outgoing edges"
features and temporary sets of "visited" elements to check for cycles
(defined using "let" expressions). As you know, the flows in activity
diagrams can cycle, and I'm not even sure that OCL provides the any means
to detect and avoid infinitely looping on cycles.

Cheers,

Christian


Camil Bartkowiak wrote:

> Hello,
>
> well how should i start to ask my question:-))
> OK well i'm doing my thesis right now and got some Modeltransformation
> problem.
>
> I'm using ATL(ATLAS Transformation Language) for my Modeltransformation.
> My model is drawn by MagicDraw11.5 and its some .uml2-file.
> MD11.5 got some nice EMF UML2 XMI export function which generater some
> valid .uml2-file which can be directly read by ATL.
>
> OK my model is some ActivityDiagram. It got some InitialNode (Start) and
> FinalNode. Between there are CallOperationActions, ControlFlows,
> decisionNodes, MergeNodes. Now what i want to do with ATL is a
> transformation into some SequenceDiagram. But not simply the "whole"
> AcitvityDiagram into ONE big SequenceDiagram with all elements. no no i
> want ONE Sequencediagram for EVERY path from Start to EndNode.
>
> Well u can imagine that some ActivityDiagram got more than ONE "path" from
> Start to Endnode. For example there is one decisionnode with 5 outgoing
> edges. So if i took the first edge and go till FinalNode i also have to
> "come back" and took the next edge and again went to FinalNode. That's how
> i want to generate my "paths".
>
> OK ATL is OCL Based. So i can generate helpers,and use all that OCL
> stuff;-)) So what i want to do in first step is getting the path.
> I want generate a Sequene{} for EVERY possible path.
> And inside my Sequence there are my UMLElements from my input-model.
> So my Sequnence will start with
> Sequnece{IN!UML2InitialNode....} and it will end with
> Sequence{IN!UML2FinalNode}. BUT i dont want simply use the
> .allInstancesFrom('IN') function cause that would give my ALL elements as
> ONE big sequence{}. That's what i dont want. I want to collect that
> elements i "pick up" on my path. And save that collection as a Sequence.
> Later i want to transform the UMLElements into other UMLElements. e.g
> from s : UML2!InitialNode
> to t : UML2!Lifeline
> name <- s.name
> ....
>
> Well maybe someone can help me doing such a helper or i bet more than one
> helper. The tricky part were the DecisionNodes cause here i have to pick
> ONE outgoing edge and follow it. But i have to check all outgoing
> edges.?!?
>
> Thx for any helps.
> Regards
> Camil
Re: Need OCL help [message #47679 is a reply to message #47500] Tue, 29 August 2006 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: camil.bartkowiak.imbus.de

Hi christian,

thank u very much for your answer.
I thought noone will answer me:-(

Well for now i don't know how and with what kind of "tool" i can solve my problem:-(
I read some papers where ppl implement some Activitydiagram all-path logic.
It's based on the deep-search-first algorithm.
Some Activitydiagram is nothing else as some directed graph with start and endnode.
So u have to traverse them to find all-paths. And the algorithm for that is DFS.
Well ok but how to implement DFS with ATL?:-)))
Or how to do it with OCL.?? I guess it's impossible or don't even think about to do it:-)))
U're right it will end in some large number of ocl-expressions.

Hmmmmm but how can i solve my problem then.??
All i got is my .uml2-file(UML2.0-1.0.0) which is generated from MagicDraw11.5.
In that file there is my Model and i want to get all paths and transform every one
into sequencediagram.
Well every path is a set of Nodes and edges(and guards as String).
So first step will be to get the OrderedSet{} for EVERY path.

Of course loops seems to produce some trouble but the DFS-algorithm do every loop just once.
And thats enough. I dont want to run more than once over some loop edge.
For me its not necessary to run 2,3,4 times a loop.


Hmmmm so how would u started??. Doing that stuff with java and EMF or with UML2.0-Plugin??.
I've found javadoc-api for UML2.0-plugin and there are functions u can create UML-Elements.
U also can read .uml2-files so u can get the elements out:-)

I'm little frustrated;-)

Regards
Camil

Christian W. Damus wrote:
> Hi, Camil,
>
> If you were working with EMFT OCL, I would suggest writing helper operations
> in Java to provide the complex looping and collecting of elements that you
> need to do, and implement a custom Environment to make these operations
> available to OCL.
>
> Since you are using ATL's OCL implementation, I can't suggest how you might
> do the same. Using OCL only would likely be cumbersome in the extreme:
> you would have a large number of forAll(...) iterators on "outgoing edges"
> features and temporary sets of "visited" elements to check for cycles
> (defined using "let" expressions). As you know, the flows in activity
> diagrams can cycle, and I'm not even sure that OCL provides the any means
> to detect and avoid infinitely looping on cycles.
>
> Cheers,
>
> Christian
>
>
> Camil Bartkowiak wrote:
>
>> Hello,
>>
>> well how should i start to ask my question:-))
>> OK well i'm doing my thesis right now and got some Modeltransformation
>> problem.
>>
>> I'm using ATL(ATLAS Transformation Language) for my Modeltransformation.
>> My model is drawn by MagicDraw11.5 and its some .uml2-file.
>> MD11.5 got some nice EMF UML2 XMI export function which generater some
>> valid .uml2-file which can be directly read by ATL.
>>
>> OK my model is some ActivityDiagram. It got some InitialNode (Start) and
>> FinalNode. Between there are CallOperationActions, ControlFlows,
>> decisionNodes, MergeNodes. Now what i want to do with ATL is a
>> transformation into some SequenceDiagram. But not simply the "whole"
>> AcitvityDiagram into ONE big SequenceDiagram with all elements. no no i
>> want ONE Sequencediagram for EVERY path from Start to EndNode.
>>
>> Well u can imagine that some ActivityDiagram got more than ONE "path" from
>> Start to Endnode. For example there is one decisionnode with 5 outgoing
>> edges. So if i took the first edge and go till FinalNode i also have to
>> "come back" and took the next edge and again went to FinalNode. That's how
>> i want to generate my "paths".
>>
>> OK ATL is OCL Based. So i can generate helpers,and use all that OCL
>> stuff;-)) So what i want to do in first step is getting the path.
>> I want generate a Sequene{} for EVERY possible path.
>> And inside my Sequence there are my UMLElements from my input-model.
>> So my Sequnence will start with
>> Sequnece{IN!UML2InitialNode....} and it will end with
>> Sequence{IN!UML2FinalNode}. BUT i dont want simply use the
>> .allInstancesFrom('IN') function cause that would give my ALL elements as
>> ONE big sequence{}. That's what i dont want. I want to collect that
>> elements i "pick up" on my path. And save that collection as a Sequence.
>> Later i want to transform the UMLElements into other UMLElements. e.g
>> from s : UML2!InitialNode
>> to t : UML2!Lifeline
>> name <- s.name
>> ....
>>
>> Well maybe someone can help me doing such a helper or i bet more than one
>> helper. The tricky part were the DecisionNodes cause here i have to pick
>> ONE outgoing edge and follow it. But i have to check all outgoing
>> edges.?!?
>>
>> Thx for any helps.
>> Regards
>> Camil
>
Re: Need OCL help [message #47869 is a reply to message #47679] Wed, 30 August 2006 09:05 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Camil,

If I were faced with your problem, I would not be inclined to tackle it with
OCL. The most straight-forward approach is to use the UML2 API
(org.eclipse.uml2) to analyze the Activity and generate Interactions from
its flows. Even if using OCL to analyze activities were practical, it
wouldn't help with creating the interactions, because OCL cannot modify the
models it operates on. You would still need to use the UML2 API to create
these.

For using the UML2 API to analyze the activity flows, and for other UML
questions, you should use the org.eclipse.tools.uml2 newsgroup. There,
people can help to answer such questions as how to trace activity control
flows, how to represent object flows in an interaction (if at all), how to
convert exception-handling constructs from activities to interactions, etc.

Regarding the generation of sequence diagrams, that depends on what tool you
are using (MagicDraw, RSA, etc.) and is not in the scope even of the
org.eclipse.uml2 project.

Cheers,

Christian


Camil Bartkowiak wrote:

> Hi christian,
>
> thank u very much for your answer.
> I thought noone will answer me:-(
>
> Well for now i don't know how and with what kind of "tool" i can solve my
> problem:-( I read some papers where ppl implement some Activitydiagram
> all-path logic. It's based on the deep-search-first algorithm.
> Some Activitydiagram is nothing else as some directed graph with start and
> endnode. So u have to traverse them to find all-paths. And the algorithm
> for that is DFS. Well ok but how to implement DFS with ATL?:-)))
> Or how to do it with OCL.?? I guess it's impossible or don't even think
> about to do it:-))) U're right it will end in some large number of
> ocl-expressions.
>
> Hmmmmm but how can i solve my problem then.??
> All i got is my .uml2-file(UML2.0-1.0.0) which is generated from
> MagicDraw11.5. In that file there is my Model and i want to get all paths
> and transform every one into sequencediagram.
> Well every path is a set of Nodes and edges(and guards as String).
> So first step will be to get the OrderedSet{} for EVERY path.
>
> Of course loops seems to produce some trouble but the DFS-algorithm do
> every loop just once. And thats enough. I dont want to run more than once
> over some loop edge. For me its not necessary to run 2,3,4 times a loop.
>
>
> Hmmmm so how would u started??. Doing that stuff with java and EMF or with
> UML2.0-Plugin??. I've found javadoc-api for UML2.0-plugin and there are
> functions u can create UML-Elements. U also can read .uml2-files so u can
> get the elements out:-)
>
> I'm little frustrated;-)
>
> Regards
> Camil
>

<snip>
Re: Need OCL help [message #586714 is a reply to message #46443] Tue, 29 August 2006 09:58 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Camil,

If you were working with EMFT OCL, I would suggest writing helper operations
in Java to provide the complex looping and collecting of elements that you
need to do, and implement a custom Environment to make these operations
available to OCL.

Since you are using ATL's OCL implementation, I can't suggest how you might
do the same. Using OCL only would likely be cumbersome in the extreme:
you would have a large number of forAll(...) iterators on "outgoing edges"
features and temporary sets of "visited" elements to check for cycles
(defined using "let" expressions). As you know, the flows in activity
diagrams can cycle, and I'm not even sure that OCL provides the any means
to detect and avoid infinitely looping on cycles.

Cheers,

Christian


Camil Bartkowiak wrote:

> Hello,
>
> well how should i start to ask my question:-))
> OK well i'm doing my thesis right now and got some Modeltransformation
> problem.
>
> I'm using ATL(ATLAS Transformation Language) for my Modeltransformation.
> My model is drawn by MagicDraw11.5 and its some .uml2-file.
> MD11.5 got some nice EMF UML2 XMI export function which generater some
> valid .uml2-file which can be directly read by ATL.
>
> OK my model is some ActivityDiagram. It got some InitialNode (Start) and
> FinalNode. Between there are CallOperationActions, ControlFlows,
> decisionNodes, MergeNodes. Now what i want to do with ATL is a
> transformation into some SequenceDiagram. But not simply the "whole"
> AcitvityDiagram into ONE big SequenceDiagram with all elements. no no i
> want ONE Sequencediagram for EVERY path from Start to EndNode.
>
> Well u can imagine that some ActivityDiagram got more than ONE "path" from
> Start to Endnode. For example there is one decisionnode with 5 outgoing
> edges. So if i took the first edge and go till FinalNode i also have to
> "come back" and took the next edge and again went to FinalNode. That's how
> i want to generate my "paths".
>
> OK ATL is OCL Based. So i can generate helpers,and use all that OCL
> stuff;-)) So what i want to do in first step is getting the path.
> I want generate a Sequene{} for EVERY possible path.
> And inside my Sequence there are my UMLElements from my input-model.
> So my Sequnence will start with
> Sequnece{IN!UML2InitialNode....} and it will end with
> Sequence{IN!UML2FinalNode}. BUT i dont want simply use the
> .allInstancesFrom('IN') function cause that would give my ALL elements as
> ONE big sequence{}. That's what i dont want. I want to collect that
> elements i "pick up" on my path. And save that collection as a Sequence.
> Later i want to transform the UMLElements into other UMLElements. e.g
> from s : UML2!InitialNode
> to t : UML2!Lifeline
> name <- s.name
> ....
>
> Well maybe someone can help me doing such a helper or i bet more than one
> helper. The tricky part were the DecisionNodes cause here i have to pick
> ONE outgoing edge and follow it. But i have to check all outgoing
> edges.?!?
>
> Thx for any helps.
> Regards
> Camil
Re: Need OCL help [message #586789 is a reply to message #47500] Tue, 29 August 2006 10:57 Go to previous message
Eclipse UserFriend
Originally posted by: camil.bartkowiak.imbus.de

Hi christian,

thank u very much for your answer.
I thought noone will answer me:-(

Well for now i don't know how and with what kind of "tool" i can solve my problem:-(
I read some papers where ppl implement some Activitydiagram all-path logic.
It's based on the deep-search-first algorithm.
Some Activitydiagram is nothing else as some directed graph with start and endnode.
So u have to traverse them to find all-paths. And the algorithm for that is DFS.
Well ok but how to implement DFS with ATL?:-)))
Or how to do it with OCL.?? I guess it's impossible or don't even think about to do it:-)))
U're right it will end in some large number of ocl-expressions.

Hmmmmm but how can i solve my problem then.??
All i got is my .uml2-file(UML2.0-1.0.0) which is generated from MagicDraw11.5.
In that file there is my Model and i want to get all paths and transform every one
into sequencediagram.
Well every path is a set of Nodes and edges(and guards as String).
So first step will be to get the OrderedSet{} for EVERY path.

Of course loops seems to produce some trouble but the DFS-algorithm do every loop just once.
And thats enough. I dont want to run more than once over some loop edge.
For me its not necessary to run 2,3,4 times a loop.


Hmmmm so how would u started??. Doing that stuff with java and EMF or with UML2.0-Plugin??.
I've found javadoc-api for UML2.0-plugin and there are functions u can create UML-Elements.
U also can read .uml2-files so u can get the elements out:-)

I'm little frustrated;-)

Regards
Camil

Christian W. Damus wrote:
> Hi, Camil,
>
> If you were working with EMFT OCL, I would suggest writing helper operations
> in Java to provide the complex looping and collecting of elements that you
> need to do, and implement a custom Environment to make these operations
> available to OCL.
>
> Since you are using ATL's OCL implementation, I can't suggest how you might
> do the same. Using OCL only would likely be cumbersome in the extreme:
> you would have a large number of forAll(...) iterators on "outgoing edges"
> features and temporary sets of "visited" elements to check for cycles
> (defined using "let" expressions). As you know, the flows in activity
> diagrams can cycle, and I'm not even sure that OCL provides the any means
> to detect and avoid infinitely looping on cycles.
>
> Cheers,
>
> Christian
>
>
> Camil Bartkowiak wrote:
>
>> Hello,
>>
>> well how should i start to ask my question:-))
>> OK well i'm doing my thesis right now and got some Modeltransformation
>> problem.
>>
>> I'm using ATL(ATLAS Transformation Language) for my Modeltransformation.
>> My model is drawn by MagicDraw11.5 and its some .uml2-file.
>> MD11.5 got some nice EMF UML2 XMI export function which generater some
>> valid .uml2-file which can be directly read by ATL.
>>
>> OK my model is some ActivityDiagram. It got some InitialNode (Start) and
>> FinalNode. Between there are CallOperationActions, ControlFlows,
>> decisionNodes, MergeNodes. Now what i want to do with ATL is a
>> transformation into some SequenceDiagram. But not simply the "whole"
>> AcitvityDiagram into ONE big SequenceDiagram with all elements. no no i
>> want ONE Sequencediagram for EVERY path from Start to EndNode.
>>
>> Well u can imagine that some ActivityDiagram got more than ONE "path" from
>> Start to Endnode. For example there is one decisionnode with 5 outgoing
>> edges. So if i took the first edge and go till FinalNode i also have to
>> "come back" and took the next edge and again went to FinalNode. That's how
>> i want to generate my "paths".
>>
>> OK ATL is OCL Based. So i can generate helpers,and use all that OCL
>> stuff;-)) So what i want to do in first step is getting the path.
>> I want generate a Sequene{} for EVERY possible path.
>> And inside my Sequence there are my UMLElements from my input-model.
>> So my Sequnence will start with
>> Sequnece{IN!UML2InitialNode....} and it will end with
>> Sequence{IN!UML2FinalNode}. BUT i dont want simply use the
>> .allInstancesFrom('IN') function cause that would give my ALL elements as
>> ONE big sequence{}. That's what i dont want. I want to collect that
>> elements i "pick up" on my path. And save that collection as a Sequence.
>> Later i want to transform the UMLElements into other UMLElements. e.g
>> from s : UML2!InitialNode
>> to t : UML2!Lifeline
>> name <- s.name
>> ....
>>
>> Well maybe someone can help me doing such a helper or i bet more than one
>> helper. The tricky part were the DecisionNodes cause here i have to pick
>> ONE outgoing edge and follow it. But i have to check all outgoing
>> edges.?!?
>>
>> Thx for any helps.
>> Regards
>> Camil
>
Re: Need OCL help [message #586883 is a reply to message #47679] Wed, 30 August 2006 09:05 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Camil,

If I were faced with your problem, I would not be inclined to tackle it with
OCL. The most straight-forward approach is to use the UML2 API
(org.eclipse.uml2) to analyze the Activity and generate Interactions from
its flows. Even if using OCL to analyze activities were practical, it
wouldn't help with creating the interactions, because OCL cannot modify the
models it operates on. You would still need to use the UML2 API to create
these.

For using the UML2 API to analyze the activity flows, and for other UML
questions, you should use the org.eclipse.tools.uml2 newsgroup. There,
people can help to answer such questions as how to trace activity control
flows, how to represent object flows in an interaction (if at all), how to
convert exception-handling constructs from activities to interactions, etc.

Regarding the generation of sequence diagrams, that depends on what tool you
are using (MagicDraw, RSA, etc.) and is not in the scope even of the
org.eclipse.uml2 project.

Cheers,

Christian


Camil Bartkowiak wrote:

> Hi christian,
>
> thank u very much for your answer.
> I thought noone will answer me:-(
>
> Well for now i don't know how and with what kind of "tool" i can solve my
> problem:-( I read some papers where ppl implement some Activitydiagram
> all-path logic. It's based on the deep-search-first algorithm.
> Some Activitydiagram is nothing else as some directed graph with start and
> endnode. So u have to traverse them to find all-paths. And the algorithm
> for that is DFS. Well ok but how to implement DFS with ATL?:-)))
> Or how to do it with OCL.?? I guess it's impossible or don't even think
> about to do it:-))) U're right it will end in some large number of
> ocl-expressions.
>
> Hmmmmm but how can i solve my problem then.??
> All i got is my .uml2-file(UML2.0-1.0.0) which is generated from
> MagicDraw11.5. In that file there is my Model and i want to get all paths
> and transform every one into sequencediagram.
> Well every path is a set of Nodes and edges(and guards as String).
> So first step will be to get the OrderedSet{} for EVERY path.
>
> Of course loops seems to produce some trouble but the DFS-algorithm do
> every loop just once. And thats enough. I dont want to run more than once
> over some loop edge. For me its not necessary to run 2,3,4 times a loop.
>
>
> Hmmmm so how would u started??. Doing that stuff with java and EMF or with
> UML2.0-Plugin??. I've found javadoc-api for UML2.0-plugin and there are
> functions u can create UML-Elements. U also can read .uml2-files so u can
> get the elements out:-)
>
> I'm little frustrated;-)
>
> Regards
> Camil
>

<snip>
Previous Topic:'Live' validation in EMF vs EMFT
Next Topic:OCL with non-Ecore models
Goto Forum:
  


Current Time: Sat Jul 12 13:45:18 EDT 2025

Powered by FUDForum. Page generated in 0.05624 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top