Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Transition Effects Calling Methods of Classes Visible to State Machine Owner
Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471360] Wed, 07 March 2007 15:06 Go to next message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi all,

I have a UML2 model describing two classes A and B with an association
which makes an instance of B be visible to A (A.b). A owns a state
machine. I would like a transition in that state machine to have an
Effect calling a method b.doSomething(). I've tried to accomplish this
both programmatically and graphically by using RSA, with no luck.

Could you point me to the correct UML2 API for creating such an effect?

Thanks in advance for your help.

Mirco
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471623 is a reply to message #471360] Thu, 08 March 2007 00:39 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

An effect is a Behavior. I would suggest creating an Interaction ( which
is a Behavior ) and specify a lifeline b:B that with a message whose
signature is "doSomething()". Set your effect to be that Interaction.

"An effect is just an optional behavior that is performed when the
transition fires"

Regards,

- James.



"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:esmkn1$9r0$1@utils.eclipse.org...
> Hi all,
>
> I have a UML2 model describing two classes A and B with an association
> which makes an instance of B be visible to A (A.b). A owns a state
> machine. I would like a transition in that state machine to have an Effect
> calling a method b.doSomething(). I've tried to accomplish this both
> programmatically and graphically by using RSA, with no luck.
>
> Could you point me to the correct UML2 API for creating such an effect?
>
> Thanks in advance for your help.
>
> Mirco
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471624 is a reply to message #471623] Thu, 08 March 2007 14:18 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
.... From RSA it looks like when you create an effect you get an opaque
behavior.
You can create your interaction with sequence diagram under that opaque
behavior.
In general, you should be able to simply create an Interaction as the
effect.

- James.



"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:esnlr2$hhu$1@utils.eclipse.org...
> Hi Mirco,
>
> An effect is a Behavior. I would suggest creating an Interaction (
which
> is a Behavior ) and specify a lifeline b:B that with a message whose
> signature is "doSomething()". Set your effect to be that Interaction.
>
> "An effect is just an optional behavior that is performed when the
> transition fires"
>
> Regards,
>
> - James.
>
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:esmkn1$9r0$1@utils.eclipse.org...
> > Hi all,
> >
> > I have a UML2 model describing two classes A and B with an association
> > which makes an instance of B be visible to A (A.b). A owns a state
> > machine. I would like a transition in that state machine to have an
Effect
> > calling a method b.doSomething(). I've tried to accomplish this both
> > programmatically and graphically by using RSA, with no luck.
> >
> > Could you point me to the correct UML2 API for creating such an effect?
> >
> > Thanks in advance for your help.
> >
> > Mirco
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471625 is a reply to message #471624] Thu, 08 March 2007 15:51 Go to previous messageGo to next message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

Many thanks for this. I tried to do as you suggested and now I have an
Interaction under the Opaque Behavior representing the effect of my
transition. However, the model doesn't validate and I get the following
error:

Assembly connector '<Connector>' must only be defined from a role end
requiring an interface to a role end providing that interface.

The sequence diagram has two lifelines a:A and b:B and the message
b.doSomething. As the problem occurs every time I create an interaction
between two associated classes, I think I might be developing the model
in a wrong way. On the other hand, the validation on the RSA sample
sequence diagrams gives the same results. Any ideas about that?

Thanks again for your time

Cheers
Mirco

James Bruck wrote:
> ... From RSA it looks like when you create an effect you get an opaque
> behavior.
> You can create your interaction with sequence diagram under that opaque
> behavior.
> In general, you should be able to simply create an Interaction as the
> effect.
>
> - James.
>
>
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:esnlr2$hhu$1@utils.eclipse.org...
>> Hi Mirco,
>>
>> An effect is a Behavior. I would suggest creating an Interaction (
> which
>> is a Behavior ) and specify a lifeline b:B that with a message whose
>> signature is "doSomething()". Set your effect to be that Interaction.
>>
>> "An effect is just an optional behavior that is performed when the
>> transition fires"
>>
>> Regards,
>>
>> - James.
>>
>>
>>
>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> news:esmkn1$9r0$1@utils.eclipse.org...
>>> Hi all,
>>>
>>> I have a UML2 model describing two classes A and B with an association
>>> which makes an instance of B be visible to A (A.b). A owns a state
>>> machine. I would like a transition in that state machine to have an
> Effect
>>> calling a method b.doSomething(). I've tried to accomplish this both
>>> programmatically and graphically by using RSA, with no luck.
>>>
>>> Could you point me to the correct UML2 API for creating such an effect?
>>>
>>> Thanks in advance for your help.
>>>
>>> Mirco
>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471626 is a reply to message #471625] Thu, 08 March 2007 17:50 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

RSA creates an assembly connector between the two lifelines indicating that
there is some communication at runtime.
RSA does this because they can automatically generate communication diagrams
from the sequence diagram. Those communication diagrams require the
specification of the connector to show that the two lifelines interact ( ie
Message Pathways are Connectors ).
You can understand this better by deleting automatically generated connector
under the interaction, then select the interaction and create a
communication diagram.
Now, put the connector back and create a communication diagram by selecting
the interaction and creating the diagram.
In one case, the lifelines are connected, in the other, they are disjoint.
The validation rule is complaining because of constraints around connectors
requiring assembly connectors to be connected to "compatible" Connectable
Elements. Your model in effect is incomplete ( it should just be a warning
by the way .. not an error ).

If your lifelines were typed by components requiring and providing
interfaces you would not get this warning. You can complete your model
by creating Interface realizations and Usages from the classifiers typing
the lifeline's to a common interface. You might alternatively use a
Composite structure diagram to complete your model.

However, you could simply delete the connector and consider your sequence
diagram to be a "sketch" as opposed to a completely specified model.

Regards,

- James.


"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:espboi$4b5$1@utils.eclipse.org...
> Hi James,
>
> Many thanks for this. I tried to do as you suggested and now I have an
> Interaction under the Opaque Behavior representing the effect of my
> transition. However, the model doesn't validate and I get the following
> error:
>
> Assembly connector '<Connector>' must only be defined from a role end
> requiring an interface to a role end providing that interface.
>
> The sequence diagram has two lifelines a:A and b:B and the message
> b.doSomething. As the problem occurs every time I create an interaction
> between two associated classes, I think I might be developing the model
> in a wrong way. On the other hand, the validation on the RSA sample
> sequence diagrams gives the same results. Any ideas about that?
>
> Thanks again for your time
>
> Cheers
> Mirco
>
> James Bruck wrote:
> > ... From RSA it looks like when you create an effect you get an opaque
> > behavior.
> > You can create your interaction with sequence diagram under that opaque
> > behavior.
> > In general, you should be able to simply create an Interaction as the
> > effect.
> >
> > - James.
> >
> >
> >
> > "James Bruck" <jbruck@ca.ibm.com> wrote in message
> > news:esnlr2$hhu$1@utils.eclipse.org...
> >> Hi Mirco,
> >>
> >> An effect is a Behavior. I would suggest creating an Interaction (
> > which
> >> is a Behavior ) and specify a lifeline b:B that with a message whose
> >> signature is "doSomething()". Set your effect to be that Interaction.
> >>
> >> "An effect is just an optional behavior that is performed when the
> >> transition fires"
> >>
> >> Regards,
> >>
> >> - James.
> >>
> >>
> >>
> >> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> news:esmkn1$9r0$1@utils.eclipse.org...
> >>> Hi all,
> >>>
> >>> I have a UML2 model describing two classes A and B with an association
> >>> which makes an instance of B be visible to A (A.b). A owns a state
> >>> machine. I would like a transition in that state machine to have an
> > Effect
> >>> calling a method b.doSomething(). I've tried to accomplish this both
> >>> programmatically and graphically by using RSA, with no luck.
> >>>
> >>> Could you point me to the correct UML2 API for creating such an
effect?
> >>>
> >>> Thanks in advance for your help.
> >>>
> >>> Mirco
> >>
> >
> >
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471630 is a reply to message #471626] Fri, 09 March 2007 10:52 Go to previous messageGo to next message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

Thank you for your thorough and interesting reply. I completed my model
by creating an interface exposing doSomething(). B realizes the
interface and A uses it. Now the model validates.

I have one more question about the UML metamodel and its relationship
with RSA and the UML2 API. I actually realized that I could make the
model simpler by getting rid of the classes owning the state machines,
as a state machine is itself a class according to the UML2 API.
Therefore I now have two state machines for which I want to describe the
communication between each other. I drew a little class diagram
including the two state machines A and B as well as the common interface
as you suggested. I wanted to draw an interface realization line between
B and the interface but apparently I am not allowed to do so. My
question is: Am I doing something wrong or doesn't RSA support offer
this possibility?

Thank you again

Regards,
Mirco

James Bruck wrote:
> Hi Mirco,
>
> RSA creates an assembly connector between the two lifelines indicating that
> there is some communication at runtime.
> RSA does this because they can automatically generate communication diagrams
> from the sequence diagram. Those communication diagrams require the
> specification of the connector to show that the two lifelines interact ( ie
> Message Pathways are Connectors ).
> You can understand this better by deleting automatically generated connector
> under the interaction, then select the interaction and create a
> communication diagram.
> Now, put the connector back and create a communication diagram by selecting
> the interaction and creating the diagram.
> In one case, the lifelines are connected, in the other, they are disjoint.
> The validation rule is complaining because of constraints around connectors
> requiring assembly connectors to be connected to "compatible" Connectable
> Elements. Your model in effect is incomplete ( it should just be a warning
> by the way .. not an error ).
>
> If your lifelines were typed by components requiring and providing
> interfaces you would not get this warning. You can complete your model
> by creating Interface realizations and Usages from the classifiers typing
> the lifeline's to a common interface. You might alternatively use a
> Composite structure diagram to complete your model.
>
> However, you could simply delete the connector and consider your sequence
> diagram to be a "sketch" as opposed to a completely specified model.
>
> Regards,
>
> - James.
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:espboi$4b5$1@utils.eclipse.org...
>> Hi James,
>>
>> Many thanks for this. I tried to do as you suggested and now I have an
>> Interaction under the Opaque Behavior representing the effect of my
>> transition. However, the model doesn't validate and I get the following
>> error:
>>
>> Assembly connector '<Connector>' must only be defined from a role end
>> requiring an interface to a role end providing that interface.
>>
>> The sequence diagram has two lifelines a:A and b:B and the message
>> b.doSomething. As the problem occurs every time I create an interaction
>> between two associated classes, I think I might be developing the model
>> in a wrong way. On the other hand, the validation on the RSA sample
>> sequence diagrams gives the same results. Any ideas about that?
>>
>> Thanks again for your time
>>
>> Cheers
>> Mirco
>>
>> James Bruck wrote:
>>> ... From RSA it looks like when you create an effect you get an opaque
>>> behavior.
>>> You can create your interaction with sequence diagram under that opaque
>>> behavior.
>>> In general, you should be able to simply create an Interaction as the
>>> effect.
>>>
>>> - James.
>>>
>>>
>>>
>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>>> news:esnlr2$hhu$1@utils.eclipse.org...
>>>> Hi Mirco,
>>>>
>>>> An effect is a Behavior. I would suggest creating an Interaction (
>>> which
>>>> is a Behavior ) and specify a lifeline b:B that with a message whose
>>>> signature is "doSomething()". Set your effect to be that Interaction.
>>>>
>>>> "An effect is just an optional behavior that is performed when the
>>>> transition fires"
>>>>
>>>> Regards,
>>>>
>>>> - James.
>>>>
>>>>
>>>>
>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>>>>> Hi all,
>>>>>
>>>>> I have a UML2 model describing two classes A and B with an association
>>>>> which makes an instance of B be visible to A (A.b). A owns a state
>>>>> machine. I would like a transition in that state machine to have an
>>> Effect
>>>>> calling a method b.doSomething(). I've tried to accomplish this both
>>>>> programmatically and graphically by using RSA, with no luck.
>>>>>
>>>>> Could you point me to the correct UML2 API for creating such an
> effect?
>>>>> Thanks in advance for your help.
>>>>>
>>>>> Mirco
>>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471631 is a reply to message #471630] Fri, 09 March 2007 14:46 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

I'll try not to turn this into a RSA forum but from what you describe, you
should be able to draw that interface realization.
I have made myself a little model that I think follows what you are doing
and it seems to work.

From what I understand your state machine does not have a context and you
are having problems because you cannot visualize that statemachine as a
class on a class diagram and then draw an interface realization. Try
selecting your State Machine, then go to the Properties > Advanced. Now
select the collections editor. Select Interface Realization and then browse
to the interface you are interested in. ( There might be an easier way that
I'm unaware of ). In general, you have access to all the opensource
options via the advanced tab in RSA. More common properties are added to
other tabs.

If you could describe the ultimate problem you are trying to solve there is
a slim chance I might be able to make semi-reasonable comments :)

Regards,

- James.


"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:esrekf$n2$1@utils.eclipse.org...
> Hi James,
>
> Thank you for your thorough and interesting reply. I completed my model
> by creating an interface exposing doSomething(). B realizes the
> interface and A uses it. Now the model validates.
>
> I have one more question about the UML metamodel and its relationship
> with RSA and the UML2 API. I actually realized that I could make the
> model simpler by getting rid of the classes owning the state machines,
> as a state machine is itself a class according to the UML2 API.
> Therefore I now have two state machines for which I want to describe the
> communication between each other. I drew a little class diagram
> including the two state machines A and B as well as the common interface
> as you suggested. I wanted to draw an interface realization line between
> B and the interface but apparently I am not allowed to do so. My
> question is: Am I doing something wrong or doesn't RSA support offer
> this possibility?
>
> Thank you again
>
> Regards,
> Mirco
>
> James Bruck wrote:
> > Hi Mirco,
> >
> > RSA creates an assembly connector between the two lifelines indicating
that
> > there is some communication at runtime.
> > RSA does this because they can automatically generate communication
diagrams
> > from the sequence diagram. Those communication diagrams require the
> > specification of the connector to show that the two lifelines interact
( ie
> > Message Pathways are Connectors ).
> > You can understand this better by deleting automatically generated
connector
> > under the interaction, then select the interaction and create a
> > communication diagram.
> > Now, put the connector back and create a communication diagram by
selecting
> > the interaction and creating the diagram.
> > In one case, the lifelines are connected, in the other, they are
disjoint.
> > The validation rule is complaining because of constraints around
connectors
> > requiring assembly connectors to be connected to "compatible"
Connectable
> > Elements. Your model in effect is incomplete ( it should just be a
warning
> > by the way .. not an error ).
> >
> > If your lifelines were typed by components requiring and providing
> > interfaces you would not get this warning. You can complete your
model
> > by creating Interface realizations and Usages from the classifiers
typing
> > the lifeline's to a common interface. You might alternatively use a
> > Composite structure diagram to complete your model.
> >
> > However, you could simply delete the connector and consider your
sequence
> > diagram to be a "sketch" as opposed to a completely specified model.
> >
> > Regards,
> >
> > - James.
> >
> >
> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> > news:espboi$4b5$1@utils.eclipse.org...
> >> Hi James,
> >>
> >> Many thanks for this. I tried to do as you suggested and now I have an
> >> Interaction under the Opaque Behavior representing the effect of my
> >> transition. However, the model doesn't validate and I get the following
> >> error:
> >>
> >> Assembly connector '<Connector>' must only be defined from a role end
> >> requiring an interface to a role end providing that interface.
> >>
> >> The sequence diagram has two lifelines a:A and b:B and the message
> >> b.doSomething. As the problem occurs every time I create an interaction
> >> between two associated classes, I think I might be developing the model
> >> in a wrong way. On the other hand, the validation on the RSA sample
> >> sequence diagrams gives the same results. Any ideas about that?
> >>
> >> Thanks again for your time
> >>
> >> Cheers
> >> Mirco
> >>
> >> James Bruck wrote:
> >>> ... From RSA it looks like when you create an effect you get an opaque
> >>> behavior.
> >>> You can create your interaction with sequence diagram under that
opaque
> >>> behavior.
> >>> In general, you should be able to simply create an Interaction as the
> >>> effect.
> >>>
> >>> - James.
> >>>
> >>>
> >>>
> >>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> >>> news:esnlr2$hhu$1@utils.eclipse.org...
> >>>> Hi Mirco,
> >>>>
> >>>> An effect is a Behavior. I would suggest creating an Interaction (
> >>> which
> >>>> is a Behavior ) and specify a lifeline b:B that with a message whose
> >>>> signature is "doSomething()". Set your effect to be that
Interaction.
> >>>>
> >>>> "An effect is just an optional behavior that is performed when the
> >>>> transition fires"
> >>>>
> >>>> Regards,
> >>>>
> >>>> - James.
> >>>>
> >>>>
> >>>>
> >>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >>>> news:esmkn1$9r0$1@utils.eclipse.org...
> >>>>> Hi all,
> >>>>>
> >>>>> I have a UML2 model describing two classes A and B with an
association
> >>>>> which makes an instance of B be visible to A (A.b). A owns a state
> >>>>> machine. I would like a transition in that state machine to have an
> >>> Effect
> >>>>> calling a method b.doSomething(). I've tried to accomplish this both
> >>>>> programmatically and graphically by using RSA, with no luck.
> >>>>>
> >>>>> Could you point me to the correct UML2 API for creating such an
> > effect?
> >>>>> Thanks in advance for your help.
> >>>>>
> >>>>> Mirco
> >>>
> >
> >
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471632 is a reply to message #471631] Fri, 09 March 2007 17:07 Go to previous messageGo to next message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

I'm sorry for having (ab)used this newsgroup for RSA-related isses.
Thank you for your patience in answering these questions.

Well, I try to describe what I'm doing in a few lines. Basically I want
to apply UML to a formal language which ultimately lets me do
performance modeling of the system under study. I'd like to be able to
draw a model and get analysis results back after the model has been
evaluated using this formal language. So, RSA is the graphical tool and
I use the UML2 API to do the mapping, carry out performance analysis and
annotate the results in the UML model.

UML is a lot bigger and far more complicated than the meta-model of the
formal language, so I am now working on figuring out what is the best
subset of the UML which lets me do that. I think there are different
ways and I want to analyze their pros and cons in order to focus on the
simplest and most intuitive one. The main constraint is that the model
drawn using RSA should validate OK.

The main problem I've had so far is how to model interaction between two
state machines, i.e. an effect of a transition of a state machine
calling a method of another class visible to that state machine. This
discussion has been very helpful to give me insights into that. I'm not
entirely happy with the solution of state machines exposing interfaces
in order to have a valid sequence diagram which models their interaction.

I would very much appreciate a "semi-reasonable comment" ;-) on whether
you would suggest drawing a Composite structure diagram instead.

Regards,
Mirco

James Bruck wrote:
> Hi Mirco,
>
> I'll try not to turn this into a RSA forum but from what you describe, you
> should be able to draw that interface realization.
> I have made myself a little model that I think follows what you are doing
> and it seems to work.
>
> From what I understand your state machine does not have a context and you
> are having problems because you cannot visualize that statemachine as a
> class on a class diagram and then draw an interface realization. Try
> selecting your State Machine, then go to the Properties > Advanced. Now
> select the collections editor. Select Interface Realization and then browse
> to the interface you are interested in. ( There might be an easier way that
> I'm unaware of ). In general, you have access to all the opensource
> options via the advanced tab in RSA. More common properties are added to
> other tabs.
>
> If you could describe the ultimate problem you are trying to solve there is
> a slim chance I might be able to make semi-reasonable comments :)
>
> Regards,
>
> - James.
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:esrekf$n2$1@utils.eclipse.org...
>> Hi James,
>>
>> Thank you for your thorough and interesting reply. I completed my model
>> by creating an interface exposing doSomething(). B realizes the
>> interface and A uses it. Now the model validates.
>>
>> I have one more question about the UML metamodel and its relationship
>> with RSA and the UML2 API. I actually realized that I could make the
>> model simpler by getting rid of the classes owning the state machines,
>> as a state machine is itself a class according to the UML2 API.
>> Therefore I now have two state machines for which I want to describe the
>> communication between each other. I drew a little class diagram
>> including the two state machines A and B as well as the common interface
>> as you suggested. I wanted to draw an interface realization line between
>> B and the interface but apparently I am not allowed to do so. My
>> question is: Am I doing something wrong or doesn't RSA support offer
>> this possibility?
>>
>> Thank you again
>>
>> Regards,
>> Mirco
>>
>> James Bruck wrote:
>>> Hi Mirco,
>>>
>>> RSA creates an assembly connector between the two lifelines indicating
> that
>>> there is some communication at runtime.
>>> RSA does this because they can automatically generate communication
> diagrams
>>> from the sequence diagram. Those communication diagrams require the
>>> specification of the connector to show that the two lifelines interact
> ( ie
>>> Message Pathways are Connectors ).
>>> You can understand this better by deleting automatically generated
> connector
>>> under the interaction, then select the interaction and create a
>>> communication diagram.
>>> Now, put the connector back and create a communication diagram by
> selecting
>>> the interaction and creating the diagram.
>>> In one case, the lifelines are connected, in the other, they are
> disjoint.
>>> The validation rule is complaining because of constraints around
> connectors
>>> requiring assembly connectors to be connected to "compatible"
> Connectable
>>> Elements. Your model in effect is incomplete ( it should just be a
> warning
>>> by the way .. not an error ).
>>>
>>> If your lifelines were typed by components requiring and providing
>>> interfaces you would not get this warning. You can complete your
> model
>>> by creating Interface realizations and Usages from the classifiers
> typing
>>> the lifeline's to a common interface. You might alternatively use a
>>> Composite structure diagram to complete your model.
>>>
>>> However, you could simply delete the connector and consider your
> sequence
>>> diagram to be a "sketch" as opposed to a completely specified model.
>>>
>>> Regards,
>>>
>>> - James.
>>>
>>>
>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>> news:espboi$4b5$1@utils.eclipse.org...
>>>> Hi James,
>>>>
>>>> Many thanks for this. I tried to do as you suggested and now I have an
>>>> Interaction under the Opaque Behavior representing the effect of my
>>>> transition. However, the model doesn't validate and I get the following
>>>> error:
>>>>
>>>> Assembly connector '<Connector>' must only be defined from a role end
>>>> requiring an interface to a role end providing that interface.
>>>>
>>>> The sequence diagram has two lifelines a:A and b:B and the message
>>>> b.doSomething. As the problem occurs every time I create an interaction
>>>> between two associated classes, I think I might be developing the model
>>>> in a wrong way. On the other hand, the validation on the RSA sample
>>>> sequence diagrams gives the same results. Any ideas about that?
>>>>
>>>> Thanks again for your time
>>>>
>>>> Cheers
>>>> Mirco
>>>>
>>>> James Bruck wrote:
>>>>> ... From RSA it looks like when you create an effect you get an opaque
>>>>> behavior.
>>>>> You can create your interaction with sequence diagram under that
> opaque
>>>>> behavior.
>>>>> In general, you should be able to simply create an Interaction as the
>>>>> effect.
>>>>>
>>>>> - James.
>>>>>
>>>>>
>>>>>
>>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>>>>> news:esnlr2$hhu$1@utils.eclipse.org...
>>>>>> Hi Mirco,
>>>>>>
>>>>>> An effect is a Behavior. I would suggest creating an Interaction (
>>>>> which
>>>>>> is a Behavior ) and specify a lifeline b:B that with a message whose
>>>>>> signature is "doSomething()". Set your effect to be that
> Interaction.
>>>>>> "An effect is just an optional behavior that is performed when the
>>>>>> transition fires"
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> - James.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I have a UML2 model describing two classes A and B with an
> association
>>>>>>> which makes an instance of B be visible to A (A.b). A owns a state
>>>>>>> machine. I would like a transition in that state machine to have an
>>>>> Effect
>>>>>>> calling a method b.doSomething(). I've tried to accomplish this both
>>>>>>> programmatically and graphically by using RSA, with no luck.
>>>>>>>
>>>>>>> Could you point me to the correct UML2 API for creating such an
>>> effect?
>>>>>>> Thanks in advance for your help.
>>>>>>>
>>>>>>> Mirco
>>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471633 is a reply to message #471632] Fri, 09 March 2007 23:07 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

I don't want to give you the impression that you 'have' to expose interfaces
from your state machine. There are many different ways to complete your
model. You might want to use ports etc.

You might want to see some of the draft articles here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
extending UML or restricting yourself to those language units you might be
interested in.

Composite structure diagram is your best bet to fine tune the interaction
between parts/ports. Lifelines represent ConnectableElements ... parts and
ports are connectable elements.

( By the way I hope you have RSA 7.x ... there are some nice enhancements in
this version that try to hide some "nastiness" when creating required and
provided interfaces :) ).

Cheers,

-James.


"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:ess4ja$nkb$1@utils.eclipse.org...
> Hi James,
>
> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
> Thank you for your patience in answering these questions.
>
> Well, I try to describe what I'm doing in a few lines. Basically I want
> to apply UML to a formal language which ultimately lets me do
> performance modeling of the system under study. I'd like to be able to
> draw a model and get analysis results back after the model has been
> evaluated using this formal language. So, RSA is the graphical tool and
> I use the UML2 API to do the mapping, carry out performance analysis and
> annotate the results in the UML model.
>
> UML is a lot bigger and far more complicated than the meta-model of the
> formal language, so I am now working on figuring out what is the best
> subset of the UML which lets me do that. I think there are different
> ways and I want to analyze their pros and cons in order to focus on the
> simplest and most intuitive one. The main constraint is that the model
> drawn using RSA should validate OK.
>
> The main problem I've had so far is how to model interaction between two
> state machines, i.e. an effect of a transition of a state machine
> calling a method of another class visible to that state machine. This
> discussion has been very helpful to give me insights into that. I'm not
> entirely happy with the solution of state machines exposing interfaces
> in order to have a valid sequence diagram which models their interaction.
>
> I would very much appreciate a "semi-reasonable comment" ;-) on whether
> you would suggest drawing a Composite structure diagram instead.
>
> Regards,
> Mirco
>
> James Bruck wrote:
> > Hi Mirco,
> >
> > I'll try not to turn this into a RSA forum but from what you describe,
you
> > should be able to draw that interface realization.
> > I have made myself a little model that I think follows what you are
doing
> > and it seems to work.
> >
> > From what I understand your state machine does not have a context and
you
> > are having problems because you cannot visualize that statemachine as a
> > class on a class diagram and then draw an interface realization. Try
> > selecting your State Machine, then go to the Properties > Advanced.
Now
> > select the collections editor. Select Interface Realization and then
browse
> > to the interface you are interested in. ( There might be an easier way
that
> > I'm unaware of ). In general, you have access to all the opensource
> > options via the advanced tab in RSA. More common properties are added
to
> > other tabs.
> >
> > If you could describe the ultimate problem you are trying to solve there
is
> > a slim chance I might be able to make semi-reasonable comments :)
> >
> > Regards,
> >
> > - James.
> >
> >
> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> > news:esrekf$n2$1@utils.eclipse.org...
> >> Hi James,
> >>
> >> Thank you for your thorough and interesting reply. I completed my model
> >> by creating an interface exposing doSomething(). B realizes the
> >> interface and A uses it. Now the model validates.
> >>
> >> I have one more question about the UML metamodel and its relationship
> >> with RSA and the UML2 API. I actually realized that I could make the
> >> model simpler by getting rid of the classes owning the state machines,
> >> as a state machine is itself a class according to the UML2 API.
> >> Therefore I now have two state machines for which I want to describe
the
> >> communication between each other. I drew a little class diagram
> >> including the two state machines A and B as well as the common
interface
> >> as you suggested. I wanted to draw an interface realization line
between
> >> B and the interface but apparently I am not allowed to do so. My
> >> question is: Am I doing something wrong or doesn't RSA support offer
> >> this possibility?
> >>
> >> Thank you again
> >>
> >> Regards,
> >> Mirco
> >>
> >> James Bruck wrote:
> >>> Hi Mirco,
> >>>
> >>> RSA creates an assembly connector between the two lifelines indicating
> > that
> >>> there is some communication at runtime.
> >>> RSA does this because they can automatically generate communication
> > diagrams
> >>> from the sequence diagram. Those communication diagrams require the
> >>> specification of the connector to show that the two lifelines interact
> > ( ie
> >>> Message Pathways are Connectors ).
> >>> You can understand this better by deleting automatically generated
> > connector
> >>> under the interaction, then select the interaction and create a
> >>> communication diagram.
> >>> Now, put the connector back and create a communication diagram by
> > selecting
> >>> the interaction and creating the diagram.
> >>> In one case, the lifelines are connected, in the other, they are
> > disjoint.
> >>> The validation rule is complaining because of constraints around
> > connectors
> >>> requiring assembly connectors to be connected to "compatible"
> > Connectable
> >>> Elements. Your model in effect is incomplete ( it should just be a
> > warning
> >>> by the way .. not an error ).
> >>>
> >>> If your lifelines were typed by components requiring and providing
> >>> interfaces you would not get this warning. You can complete your
> > model
> >>> by creating Interface realizations and Usages from the classifiers
> > typing
> >>> the lifeline's to a common interface. You might alternatively use a
> >>> Composite structure diagram to complete your model.
> >>>
> >>> However, you could simply delete the connector and consider your
> > sequence
> >>> diagram to be a "sketch" as opposed to a completely specified model.
> >>>
> >>> Regards,
> >>>
> >>> - James.
> >>>
> >>>
> >>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >>> news:espboi$4b5$1@utils.eclipse.org...
> >>>> Hi James,
> >>>>
> >>>> Many thanks for this. I tried to do as you suggested and now I have
an
> >>>> Interaction under the Opaque Behavior representing the effect of my
> >>>> transition. However, the model doesn't validate and I get the
following
> >>>> error:
> >>>>
> >>>> Assembly connector '<Connector>' must only be defined from a role end
> >>>> requiring an interface to a role end providing that interface.
> >>>>
> >>>> The sequence diagram has two lifelines a:A and b:B and the message
> >>>> b.doSomething. As the problem occurs every time I create an
interaction
> >>>> between two associated classes, I think I might be developing the
model
> >>>> in a wrong way. On the other hand, the validation on the RSA sample
> >>>> sequence diagrams gives the same results. Any ideas about that?
> >>>>
> >>>> Thanks again for your time
> >>>>
> >>>> Cheers
> >>>> Mirco
> >>>>
> >>>> James Bruck wrote:
> >>>>> ... From RSA it looks like when you create an effect you get an
opaque
> >>>>> behavior.
> >>>>> You can create your interaction with sequence diagram under that
> > opaque
> >>>>> behavior.
> >>>>> In general, you should be able to simply create an Interaction as
the
> >>>>> effect.
> >>>>>
> >>>>> - James.
> >>>>>
> >>>>>
> >>>>>
> >>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> >>>>> news:esnlr2$hhu$1@utils.eclipse.org...
> >>>>>> Hi Mirco,
> >>>>>>
> >>>>>> An effect is a Behavior. I would suggest creating an Interaction
(
> >>>>> which
> >>>>>> is a Behavior ) and specify a lifeline b:B that with a message
whose
> >>>>>> signature is "doSomething()". Set your effect to be that
> > Interaction.
> >>>>>> "An effect is just an optional behavior that is performed when the
> >>>>>> transition fires"
> >>>>>>
> >>>>>> Regards,
> >>>>>>
> >>>>>> - James.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
> >>>>>>> Hi all,
> >>>>>>>
> >>>>>>> I have a UML2 model describing two classes A and B with an
> > association
> >>>>>>> which makes an instance of B be visible to A (A.b). A owns a state
> >>>>>>> machine. I would like a transition in that state machine to have
an
> >>>>> Effect
> >>>>>>> calling a method b.doSomething(). I've tried to accomplish this
both
> >>>>>>> programmatically and graphically by using RSA, with no luck.
> >>>>>>>
> >>>>>>> Could you point me to the correct UML2 API for creating such an
> >>> effect?
> >>>>>>> Thanks in advance for your help.
> >>>>>>>
> >>>>>>> Mirco
> >>>
> >
> >
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471634 is a reply to message #471633] Sat, 10 March 2007 02:25 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
.... two other points...

You pointed out that a StateMachine is a Class and therefore doesn't have to
have any context. Although this is technically true, I'm not sure what it
really means to have a Behavior with no context. From the spec p. 447 "
Behavior is a specification of how its context classifier changes state over
time..." p448 shows the cardinality of context to be [0..1] suggesting it is
ok to be 0 but I question how practical that is. I believe that a behavior
is a class is a side effect of behaviors requiring attributes, operations
and other inherited attributes.

Also, the constraint you were getting hung up on is described on p159
constraint [5] "An assembly connector must only be defined from a required
Interface or Ports to a provided Interface or Port". From what I
understand, there is an issue raised on OMG to relax some of the constraints
on connectors ( this one in particular) that would allow your model to
validate ( once adopted into the spec ).

I'll follow up on that first point and get back to you with the intent of
"context".

Regards,

- James.



"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:esspcb$mea$2@utils.eclipse.org...
> Hi Mirco,
>
> I don't want to give you the impression that you 'have' to expose
> interfaces
> from your state machine. There are many different ways to complete your
> model. You might want to use ports etc.
>
> You might want to see some of the draft articles here
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
> extending UML or restricting yourself to those language units you might be
> interested in.
>
> Composite structure diagram is your best bet to fine tune the interaction
> between parts/ports. Lifelines represent ConnectableElements ... parts
> and
> ports are connectable elements.
>
> ( By the way I hope you have RSA 7.x ... there are some nice enhancements
> in
> this version that try to hide some "nastiness" when creating required and
> provided interfaces :) ).
>
> Cheers,
>
> -James.
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:ess4ja$nkb$1@utils.eclipse.org...
>> Hi James,
>>
>> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
>> Thank you for your patience in answering these questions.
>>
>> Well, I try to describe what I'm doing in a few lines. Basically I want
>> to apply UML to a formal language which ultimately lets me do
>> performance modeling of the system under study. I'd like to be able to
>> draw a model and get analysis results back after the model has been
>> evaluated using this formal language. So, RSA is the graphical tool and
>> I use the UML2 API to do the mapping, carry out performance analysis and
>> annotate the results in the UML model.
>>
>> UML is a lot bigger and far more complicated than the meta-model of the
>> formal language, so I am now working on figuring out what is the best
>> subset of the UML which lets me do that. I think there are different
>> ways and I want to analyze their pros and cons in order to focus on the
>> simplest and most intuitive one. The main constraint is that the model
>> drawn using RSA should validate OK.
>>
>> The main problem I've had so far is how to model interaction between two
>> state machines, i.e. an effect of a transition of a state machine
>> calling a method of another class visible to that state machine. This
>> discussion has been very helpful to give me insights into that. I'm not
>> entirely happy with the solution of state machines exposing interfaces
>> in order to have a valid sequence diagram which models their interaction.
>>
>> I would very much appreciate a "semi-reasonable comment" ;-) on whether
>> you would suggest drawing a Composite structure diagram instead.
>>
>> Regards,
>> Mirco
>>
>> James Bruck wrote:
>> > Hi Mirco,
>> >
>> > I'll try not to turn this into a RSA forum but from what you describe,
> you
>> > should be able to draw that interface realization.
>> > I have made myself a little model that I think follows what you are
> doing
>> > and it seems to work.
>> >
>> > From what I understand your state machine does not have a context and
> you
>> > are having problems because you cannot visualize that statemachine as a
>> > class on a class diagram and then draw an interface realization. Try
>> > selecting your State Machine, then go to the Properties > Advanced.
> Now
>> > select the collections editor. Select Interface Realization and then
> browse
>> > to the interface you are interested in. ( There might be an easier way
> that
>> > I'm unaware of ). In general, you have access to all the opensource
>> > options via the advanced tab in RSA. More common properties are added
> to
>> > other tabs.
>> >
>> > If you could describe the ultimate problem you are trying to solve
>> > there
> is
>> > a slim chance I might be able to make semi-reasonable comments :)
>> >
>> > Regards,
>> >
>> > - James.
>> >
>> >
>> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> > news:esrekf$n2$1@utils.eclipse.org...
>> >> Hi James,
>> >>
>> >> Thank you for your thorough and interesting reply. I completed my
>> >> model
>> >> by creating an interface exposing doSomething(). B realizes the
>> >> interface and A uses it. Now the model validates.
>> >>
>> >> I have one more question about the UML metamodel and its relationship
>> >> with RSA and the UML2 API. I actually realized that I could make the
>> >> model simpler by getting rid of the classes owning the state machines,
>> >> as a state machine is itself a class according to the UML2 API.
>> >> Therefore I now have two state machines for which I want to describe
> the
>> >> communication between each other. I drew a little class diagram
>> >> including the two state machines A and B as well as the common
> interface
>> >> as you suggested. I wanted to draw an interface realization line
> between
>> >> B and the interface but apparently I am not allowed to do so. My
>> >> question is: Am I doing something wrong or doesn't RSA support offer
>> >> this possibility?
>> >>
>> >> Thank you again
>> >>
>> >> Regards,
>> >> Mirco
>> >>
>> >> James Bruck wrote:
>> >>> Hi Mirco,
>> >>>
>> >>> RSA creates an assembly connector between the two lifelines
>> >>> indicating
>> > that
>> >>> there is some communication at runtime.
>> >>> RSA does this because they can automatically generate communication
>> > diagrams
>> >>> from the sequence diagram. Those communication diagrams require the
>> >>> specification of the connector to show that the two lifelines
>> >>> interact
>> > ( ie
>> >>> Message Pathways are Connectors ).
>> >>> You can understand this better by deleting automatically generated
>> > connector
>> >>> under the interaction, then select the interaction and create a
>> >>> communication diagram.
>> >>> Now, put the connector back and create a communication diagram by
>> > selecting
>> >>> the interaction and creating the diagram.
>> >>> In one case, the lifelines are connected, in the other, they are
>> > disjoint.
>> >>> The validation rule is complaining because of constraints around
>> > connectors
>> >>> requiring assembly connectors to be connected to "compatible"
>> > Connectable
>> >>> Elements. Your model in effect is incomplete ( it should just be a
>> > warning
>> >>> by the way .. not an error ).
>> >>>
>> >>> If your lifelines were typed by components requiring and providing
>> >>> interfaces you would not get this warning. You can complete your
>> > model
>> >>> by creating Interface realizations and Usages from the classifiers
>> > typing
>> >>> the lifeline's to a common interface. You might alternatively use a
>> >>> Composite structure diagram to complete your model.
>> >>>
>> >>> However, you could simply delete the connector and consider your
>> > sequence
>> >>> diagram to be a "sketch" as opposed to a completely specified model.
>> >>>
>> >>> Regards,
>> >>>
>> >>> - James.
>> >>>
>> >>>
>> >>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> >>> news:espboi$4b5$1@utils.eclipse.org...
>> >>>> Hi James,
>> >>>>
>> >>>> Many thanks for this. I tried to do as you suggested and now I have
> an
>> >>>> Interaction under the Opaque Behavior representing the effect of my
>> >>>> transition. However, the model doesn't validate and I get the
> following
>> >>>> error:
>> >>>>
>> >>>> Assembly connector '<Connector>' must only be defined from a role
>> >>>> end
>> >>>> requiring an interface to a role end providing that interface.
>> >>>>
>> >>>> The sequence diagram has two lifelines a:A and b:B and the message
>> >>>> b.doSomething. As the problem occurs every time I create an
> interaction
>> >>>> between two associated classes, I think I might be developing the
> model
>> >>>> in a wrong way. On the other hand, the validation on the RSA sample
>> >>>> sequence diagrams gives the same results. Any ideas about that?
>> >>>>
>> >>>> Thanks again for your time
>> >>>>
>> >>>> Cheers
>> >>>> Mirco
>> >>>>
>> >>>> James Bruck wrote:
>> >>>>> ... From RSA it looks like when you create an effect you get an
> opaque
>> >>>>> behavior.
>> >>>>> You can create your interaction with sequence diagram under that
>> > opaque
>> >>>>> behavior.
>> >>>>> In general, you should be able to simply create an Interaction as
> the
>> >>>>> effect.
>> >>>>>
>> >>>>> - James.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>> >>>>> news:esnlr2$hhu$1@utils.eclipse.org...
>> >>>>>> Hi Mirco,
>> >>>>>>
>> >>>>>> An effect is a Behavior. I would suggest creating an
>> >>>>>> Interaction
> (
>> >>>>> which
>> >>>>>> is a Behavior ) and specify a lifeline b:B that with a message
> whose
>> >>>>>> signature is "doSomething()". Set your effect to be that
>> > Interaction.
>> >>>>>> "An effect is just an optional behavior that is performed when the
>> >>>>>> transition fires"
>> >>>>>>
>> >>>>>> Regards,
>> >>>>>>
>> >>>>>> - James.
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> >>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>> >>>>>>> Hi all,
>> >>>>>>>
>> >>>>>>> I have a UML2 model describing two classes A and B with an
>> > association
>> >>>>>>> which makes an instance of B be visible to A (A.b). A owns a
>> >>>>>>> state
>> >>>>>>> machine. I would like a transition in that state machine to have
> an
>> >>>>> Effect
>> >>>>>>> calling a method b.doSomething(). I've tried to accomplish this
> both
>> >>>>>>> programmatically and graphically by using RSA, with no luck.
>> >>>>>>>
>> >>>>>>> Could you point me to the correct UML2 API for creating such an
>> >>> effect?
>> >>>>>>> Thanks in advance for your help.
>> >>>>>>>
>> >>>>>>> Mirco
>> >>>
>> >
>> >
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471637 is a reply to message #471634] Mon, 12 March 2007 19:08 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

.... so I just confirmed that you should really be creating your statemachine
in the context of some class and creating interface realizations to that
context class....


Regards,

- James



"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:est4pl$3o0$1@utils.eclipse.org...
> ... two other points...
>
> You pointed out that a StateMachine is a Class and therefore doesn't have
to
> have any context. Although this is technically true, I'm not sure what it
> really means to have a Behavior with no context. From the spec p. 447 "
> Behavior is a specification of how its context classifier changes state
over
> time..." p448 shows the cardinality of context to be [0..1] suggesting it
is
> ok to be 0 but I question how practical that is. I believe that a
behavior
> is a class is a side effect of behaviors requiring attributes, operations
> and other inherited attributes.
>
> Also, the constraint you were getting hung up on is described on p159
> constraint [5] "An assembly connector must only be defined from a required
> Interface or Ports to a provided Interface or Port". From what I
> understand, there is an issue raised on OMG to relax some of the
constraints
> on connectors ( this one in particular) that would allow your model to
> validate ( once adopted into the spec ).
>
> I'll follow up on that first point and get back to you with the intent of
> "context".
>
> Regards,
>
> - James.
>
>
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:esspcb$mea$2@utils.eclipse.org...
> > Hi Mirco,
> >
> > I don't want to give you the impression that you 'have' to expose
> > interfaces
> > from your state machine. There are many different ways to complete
your
> > model. You might want to use ports etc.
> >
> > You might want to see some of the draft articles here
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
> > extending UML or restricting yourself to those language units you might
be
> > interested in.
> >
> > Composite structure diagram is your best bet to fine tune the
interaction
> > between parts/ports. Lifelines represent ConnectableElements ... parts
> > and
> > ports are connectable elements.
> >
> > ( By the way I hope you have RSA 7.x ... there are some nice
enhancements
> > in
> > this version that try to hide some "nastiness" when creating required
and
> > provided interfaces :) ).
> >
> > Cheers,
> >
> > -James.
> >
> >
> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> > news:ess4ja$nkb$1@utils.eclipse.org...
> >> Hi James,
> >>
> >> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
> >> Thank you for your patience in answering these questions.
> >>
> >> Well, I try to describe what I'm doing in a few lines. Basically I want
> >> to apply UML to a formal language which ultimately lets me do
> >> performance modeling of the system under study. I'd like to be able to
> >> draw a model and get analysis results back after the model has been
> >> evaluated using this formal language. So, RSA is the graphical tool and
> >> I use the UML2 API to do the mapping, carry out performance analysis
and
> >> annotate the results in the UML model.
> >>
> >> UML is a lot bigger and far more complicated than the meta-model of the
> >> formal language, so I am now working on figuring out what is the best
> >> subset of the UML which lets me do that. I think there are different
> >> ways and I want to analyze their pros and cons in order to focus on the
> >> simplest and most intuitive one. The main constraint is that the model
> >> drawn using RSA should validate OK.
> >>
> >> The main problem I've had so far is how to model interaction between
two
> >> state machines, i.e. an effect of a transition of a state machine
> >> calling a method of another class visible to that state machine. This
> >> discussion has been very helpful to give me insights into that. I'm not
> >> entirely happy with the solution of state machines exposing interfaces
> >> in order to have a valid sequence diagram which models their
interaction.
> >>
> >> I would very much appreciate a "semi-reasonable comment" ;-) on
whether
> >> you would suggest drawing a Composite structure diagram instead.
> >>
> >> Regards,
> >> Mirco
> >>
> >> James Bruck wrote:
> >> > Hi Mirco,
> >> >
> >> > I'll try not to turn this into a RSA forum but from what you
describe,
> > you
> >> > should be able to draw that interface realization.
> >> > I have made myself a little model that I think follows what you are
> > doing
> >> > and it seems to work.
> >> >
> >> > From what I understand your state machine does not have a context and
> > you
> >> > are having problems because you cannot visualize that statemachine as
a
> >> > class on a class diagram and then draw an interface realization.
Try
> >> > selecting your State Machine, then go to the Properties > Advanced.
> > Now
> >> > select the collections editor. Select Interface Realization and then
> > browse
> >> > to the interface you are interested in. ( There might be an easier
way
> > that
> >> > I'm unaware of ). In general, you have access to all the
opensource
> >> > options via the advanced tab in RSA. More common properties are
added
> > to
> >> > other tabs.
> >> >
> >> > If you could describe the ultimate problem you are trying to solve
> >> > there
> > is
> >> > a slim chance I might be able to make semi-reasonable comments :)
> >> >
> >> > Regards,
> >> >
> >> > - James.
> >> >
> >> >
> >> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> > news:esrekf$n2$1@utils.eclipse.org...
> >> >> Hi James,
> >> >>
> >> >> Thank you for your thorough and interesting reply. I completed my
> >> >> model
> >> >> by creating an interface exposing doSomething(). B realizes the
> >> >> interface and A uses it. Now the model validates.
> >> >>
> >> >> I have one more question about the UML metamodel and its
relationship
> >> >> with RSA and the UML2 API. I actually realized that I could make the
> >> >> model simpler by getting rid of the classes owning the state
machines,
> >> >> as a state machine is itself a class according to the UML2 API.
> >> >> Therefore I now have two state machines for which I want to describe
> > the
> >> >> communication between each other. I drew a little class diagram
> >> >> including the two state machines A and B as well as the common
> > interface
> >> >> as you suggested. I wanted to draw an interface realization line
> > between
> >> >> B and the interface but apparently I am not allowed to do so. My
> >> >> question is: Am I doing something wrong or doesn't RSA support offer
> >> >> this possibility?
> >> >>
> >> >> Thank you again
> >> >>
> >> >> Regards,
> >> >> Mirco
> >> >>
> >> >> James Bruck wrote:
> >> >>> Hi Mirco,
> >> >>>
> >> >>> RSA creates an assembly connector between the two lifelines
> >> >>> indicating
> >> > that
> >> >>> there is some communication at runtime.
> >> >>> RSA does this because they can automatically generate communication
> >> > diagrams
> >> >>> from the sequence diagram. Those communication diagrams require
the
> >> >>> specification of the connector to show that the two lifelines
> >> >>> interact
> >> > ( ie
> >> >>> Message Pathways are Connectors ).
> >> >>> You can understand this better by deleting automatically generated
> >> > connector
> >> >>> under the interaction, then select the interaction and create a
> >> >>> communication diagram.
> >> >>> Now, put the connector back and create a communication diagram by
> >> > selecting
> >> >>> the interaction and creating the diagram.
> >> >>> In one case, the lifelines are connected, in the other, they are
> >> > disjoint.
> >> >>> The validation rule is complaining because of constraints around
> >> > connectors
> >> >>> requiring assembly connectors to be connected to "compatible"
> >> > Connectable
> >> >>> Elements. Your model in effect is incomplete ( it should just be a
> >> > warning
> >> >>> by the way .. not an error ).
> >> >>>
> >> >>> If your lifelines were typed by components requiring and providing
> >> >>> interfaces you would not get this warning. You can complete
your
> >> > model
> >> >>> by creating Interface realizations and Usages from the classifiers
> >> > typing
> >> >>> the lifeline's to a common interface. You might alternatively use
a
> >> >>> Composite structure diagram to complete your model.
> >> >>>
> >> >>> However, you could simply delete the connector and consider your
> >> > sequence
> >> >>> diagram to be a "sketch" as opposed to a completely specified
model.
> >> >>>
> >> >>> Regards,
> >> >>>
> >> >>> - James.
> >> >>>
> >> >>>
> >> >>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> >>> news:espboi$4b5$1@utils.eclipse.org...
> >> >>>> Hi James,
> >> >>>>
> >> >>>> Many thanks for this. I tried to do as you suggested and now I
have
> > an
> >> >>>> Interaction under the Opaque Behavior representing the effect of
my
> >> >>>> transition. However, the model doesn't validate and I get the
> > following
> >> >>>> error:
> >> >>>>
> >> >>>> Assembly connector '<Connector>' must only be defined from a role
> >> >>>> end
> >> >>>> requiring an interface to a role end providing that interface.
> >> >>>>
> >> >>>> The sequence diagram has two lifelines a:A and b:B and the message
> >> >>>> b.doSomething. As the problem occurs every time I create an
> > interaction
> >> >>>> between two associated classes, I think I might be developing the
> > model
> >> >>>> in a wrong way. On the other hand, the validation on the RSA
sample
> >> >>>> sequence diagrams gives the same results. Any ideas about that?
> >> >>>>
> >> >>>> Thanks again for your time
> >> >>>>
> >> >>>> Cheers
> >> >>>> Mirco
> >> >>>>
> >> >>>> James Bruck wrote:
> >> >>>>> ... From RSA it looks like when you create an effect you get an
> > opaque
> >> >>>>> behavior.
> >> >>>>> You can create your interaction with sequence diagram under that
> >> > opaque
> >> >>>>> behavior.
> >> >>>>> In general, you should be able to simply create an Interaction as
> > the
> >> >>>>> effect.
> >> >>>>>
> >> >>>>> - James.
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> >> >>>>> news:esnlr2$hhu$1@utils.eclipse.org...
> >> >>>>>> Hi Mirco,
> >> >>>>>>
> >> >>>>>> An effect is a Behavior. I would suggest creating an
> >> >>>>>> Interaction
> > (
> >> >>>>> which
> >> >>>>>> is a Behavior ) and specify a lifeline b:B that with a message
> > whose
> >> >>>>>> signature is "doSomething()". Set your effect to be that
> >> > Interaction.
> >> >>>>>> "An effect is just an optional behavior that is performed when
the
> >> >>>>>> transition fires"
> >> >>>>>>
> >> >>>>>> Regards,
> >> >>>>>>
> >> >>>>>> - James.
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> >>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
> >> >>>>>>> Hi all,
> >> >>>>>>>
> >> >>>>>>> I have a UML2 model describing two classes A and B with an
> >> > association
> >> >>>>>>> which makes an instance of B be visible to A (A.b). A owns a
> >> >>>>>>> state
> >> >>>>>>> machine. I would like a transition in that state machine to
have
> > an
> >> >>>>> Effect
> >> >>>>>>> calling a method b.doSomething(). I've tried to accomplish this
> > both
> >> >>>>>>> programmatically and graphically by using RSA, with no luck.
> >> >>>>>>>
> >> >>>>>>> Could you point me to the correct UML2 API for creating such an
> >> >>> effect?
> >> >>>>>>> Thanks in advance for your help.
> >> >>>>>>>
> >> >>>>>>> Mirco
> >> >>>
> >> >
> >> >
> >
> >
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #471638 is a reply to message #471637] Tue, 13 March 2007 14:43 Go to previous message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

Thank you very much for your precious help.

To recap, my valid model now has classes owning state machines which
describe their dynamic behavior. In order to model interaction between
the classes, they use and realize some interfaces. This lets me draw
valid sequence diagrams as effects of state machines' transitions.

I am now investigating a component-centric approach using ports and
composite structure diagrams, which I think is more expressive in the
context of the domain I am interested in. I might get back to you with
questions regarding that!

Thank you again.

Cheers
Mirco



James Bruck wrote:
> Hi Mirco,
>
> ... so I just confirmed that you should really be creating your statemachine
> in the context of some class and creating interface realizations to that
> context class....
>
>
> Regards,
>
> - James
>
>
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:est4pl$3o0$1@utils.eclipse.org...
>> ... two other points...
>>
>> You pointed out that a StateMachine is a Class and therefore doesn't have
> to
>> have any context. Although this is technically true, I'm not sure what it
>> really means to have a Behavior with no context. From the spec p. 447 "
>> Behavior is a specification of how its context classifier changes state
> over
>> time..." p448 shows the cardinality of context to be [0..1] suggesting it
> is
>> ok to be 0 but I question how practical that is. I believe that a
> behavior
>> is a class is a side effect of behaviors requiring attributes, operations
>> and other inherited attributes.
>>
>> Also, the constraint you were getting hung up on is described on p159
>> constraint [5] "An assembly connector must only be defined from a required
>> Interface or Ports to a provided Interface or Port". From what I
>> understand, there is an issue raised on OMG to relax some of the
> constraints
>> on connectors ( this one in particular) that would allow your model to
>> validate ( once adopted into the spec ).
>>
>> I'll follow up on that first point and get back to you with the intent of
>> "context".
>>
>> Regards,
>>
>> - James.
>>
>>
>>
>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>> news:esspcb$mea$2@utils.eclipse.org...
>>> Hi Mirco,
>>>
>>> I don't want to give you the impression that you 'have' to expose
>>> interfaces
>>> from your state machine. There are many different ways to complete
> your
>>> model. You might want to use ports etc.
>>>
>>> You might want to see some of the draft articles here
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
>>> extending UML or restricting yourself to those language units you might
> be
>>> interested in.
>>>
>>> Composite structure diagram is your best bet to fine tune the
> interaction
>>> between parts/ports. Lifelines represent ConnectableElements ... parts
>>> and
>>> ports are connectable elements.
>>>
>>> ( By the way I hope you have RSA 7.x ... there are some nice
> enhancements
>>> in
>>> this version that try to hide some "nastiness" when creating required
> and
>>> provided interfaces :) ).
>>>
>>> Cheers,
>>>
>>> -James.
>>>
>>>
>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>> news:ess4ja$nkb$1@utils.eclipse.org...
>>>> Hi James,
>>>>
>>>> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
>>>> Thank you for your patience in answering these questions.
>>>>
>>>> Well, I try to describe what I'm doing in a few lines. Basically I want
>>>> to apply UML to a formal language which ultimately lets me do
>>>> performance modeling of the system under study. I'd like to be able to
>>>> draw a model and get analysis results back after the model has been
>>>> evaluated using this formal language. So, RSA is the graphical tool and
>>>> I use the UML2 API to do the mapping, carry out performance analysis
> and
>>>> annotate the results in the UML model.
>>>>
>>>> UML is a lot bigger and far more complicated than the meta-model of the
>>>> formal language, so I am now working on figuring out what is the best
>>>> subset of the UML which lets me do that. I think there are different
>>>> ways and I want to analyze their pros and cons in order to focus on the
>>>> simplest and most intuitive one. The main constraint is that the model
>>>> drawn using RSA should validate OK.
>>>>
>>>> The main problem I've had so far is how to model interaction between
> two
>>>> state machines, i.e. an effect of a transition of a state machine
>>>> calling a method of another class visible to that state machine. This
>>>> discussion has been very helpful to give me insights into that. I'm not
>>>> entirely happy with the solution of state machines exposing interfaces
>>>> in order to have a valid sequence diagram which models their
> interaction.
>>>> I would very much appreciate a "semi-reasonable comment" ;-) on
> whether
>>>> you would suggest drawing a Composite structure diagram instead.
>>>>
>>>> Regards,
>>>> Mirco
>>>>
>>>> James Bruck wrote:
>>>>> Hi Mirco,
>>>>>
>>>>> I'll try not to turn this into a RSA forum but from what you
> describe,
>>> you
>>>>> should be able to draw that interface realization.
>>>>> I have made myself a little model that I think follows what you are
>>> doing
>>>>> and it seems to work.
>>>>>
>>>>> From what I understand your state machine does not have a context and
>>> you
>>>>> are having problems because you cannot visualize that statemachine as
> a
>>>>> class on a class diagram and then draw an interface realization.
> Try
>>>>> selecting your State Machine, then go to the Properties > Advanced.
>>> Now
>>>>> select the collections editor. Select Interface Realization and then
>>> browse
>>>>> to the interface you are interested in. ( There might be an easier
> way
>>> that
>>>>> I'm unaware of ). In general, you have access to all the
> opensource
>>>>> options via the advanced tab in RSA. More common properties are
> added
>>> to
>>>>> other tabs.
>>>>>
>>>>> If you could describe the ultimate problem you are trying to solve
>>>>> there
>>> is
>>>>> a slim chance I might be able to make semi-reasonable comments :)
>>>>>
>>>>> Regards,
>>>>>
>>>>> - James.
>>>>>
>>>>>
>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>> news:esrekf$n2$1@utils.eclipse.org...
>>>>>> Hi James,
>>>>>>
>>>>>> Thank you for your thorough and interesting reply. I completed my
>>>>>> model
>>>>>> by creating an interface exposing doSomething(). B realizes the
>>>>>> interface and A uses it. Now the model validates.
>>>>>>
>>>>>> I have one more question about the UML metamodel and its
> relationship
>>>>>> with RSA and the UML2 API. I actually realized that I could make the
>>>>>> model simpler by getting rid of the classes owning the state
> machines,
>>>>>> as a state machine is itself a class according to the UML2 API.
>>>>>> Therefore I now have two state machines for which I want to describe
>>> the
>>>>>> communication between each other. I drew a little class diagram
>>>>>> including the two state machines A and B as well as the common
>>> interface
>>>>>> as you suggested. I wanted to draw an interface realization line
>>> between
>>>>>> B and the interface but apparently I am not allowed to do so. My
>>>>>> question is: Am I doing something wrong or doesn't RSA support offer
>>>>>> this possibility?
>>>>>>
>>>>>> Thank you again
>>>>>>
>>>>>> Regards,
>>>>>> Mirco
>>>>>>
>>>>>> James Bruck wrote:
>>>>>>> Hi Mirco,
>>>>>>>
>>>>>>> RSA creates an assembly connector between the two lifelines
>>>>>>> indicating
>>>>> that
>>>>>>> there is some communication at runtime.
>>>>>>> RSA does this because they can automatically generate communication
>>>>> diagrams
>>>>>>> from the sequence diagram. Those communication diagrams require
> the
>>>>>>> specification of the connector to show that the two lifelines
>>>>>>> interact
>>>>> ( ie
>>>>>>> Message Pathways are Connectors ).
>>>>>>> You can understand this better by deleting automatically generated
>>>>> connector
>>>>>>> under the interaction, then select the interaction and create a
>>>>>>> communication diagram.
>>>>>>> Now, put the connector back and create a communication diagram by
>>>>> selecting
>>>>>>> the interaction and creating the diagram.
>>>>>>> In one case, the lifelines are connected, in the other, they are
>>>>> disjoint.
>>>>>>> The validation rule is complaining because of constraints around
>>>>> connectors
>>>>>>> requiring assembly connectors to be connected to "compatible"
>>>>> Connectable
>>>>>>> Elements. Your model in effect is incomplete ( it should just be a
>>>>> warning
>>>>>>> by the way .. not an error ).
>>>>>>>
>>>>>>> If your lifelines were typed by components requiring and providing
>>>>>>> interfaces you would not get this warning. You can complete
> your
>>>>> model
>>>>>>> by creating Interface realizations and Usages from the classifiers
>>>>> typing
>>>>>>> the lifeline's to a common interface. You might alternatively use
> a
>>>>>>> Composite structure diagram to complete your model.
>>>>>>>
>>>>>>> However, you could simply delete the connector and consider your
>>>>> sequence
>>>>>>> diagram to be a "sketch" as opposed to a completely specified
> model.
>>>>>>> Regards,
>>>>>>>
>>>>>>> - James.
>>>>>>>
>>>>>>>
>>>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>>>> news:espboi$4b5$1@utils.eclipse.org...
>>>>>>>> Hi James,
>>>>>>>>
>>>>>>>> Many thanks for this. I tried to do as you suggested and now I
> have
>>> an
>>>>>>>> Interaction under the Opaque Behavior representing the effect of
> my
>>>>>>>> transition. However, the model doesn't validate and I get the
>>> following
>>>>>>>> error:
>>>>>>>>
>>>>>>>> Assembly connector '<Connector>' must only be defined from a role
>>>>>>>> end
>>>>>>>> requiring an interface to a role end providing that interface.
>>>>>>>>
>>>>>>>> The sequence diagram has two lifelines a:A and b:B and the message
>>>>>>>> b.doSomething. As the problem occurs every time I create an
>>> interaction
>>>>>>>> between two associated classes, I think I might be developing the
>>> model
>>>>>>>> in a wrong way. On the other hand, the validation on the RSA
> sample
>>>>>>>> sequence diagrams gives the same results. Any ideas about that?
>>>>>>>>
>>>>>>>> Thanks again for your time
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> Mirco
>>>>>>>>
>>>>>>>> James Bruck wrote:
>>>>>>>>> ... From RSA it looks like when you create an effect you get an
>>> opaque
>>>>>>>>> behavior.
>>>>>>>>> You can create your interaction with sequence diagram under that
>>>>> opaque
>>>>>>>>> behavior.
>>>>>>>>> In general, you should be able to simply create an Interaction as
>>> the
>>>>>>>>> effect.
>>>>>>>>>
>>>>>>>>> - James.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>>>>>>>>> news:esnlr2$hhu$1@utils.eclipse.org...
>>>>>>>>>> Hi Mirco,
>>>>>>>>>>
>>>>>>>>>> An effect is a Behavior. I would suggest creating an
>>>>>>>>>> Interaction
>>> (
>>>>>>>>> which
>>>>>>>>>> is a Behavior ) and specify a lifeline b:B that with a message
>>> whose
>>>>>>>>>> signature is "doSomething()". Set your effect to be that
>>>>> Interaction.
>>>>>>>>>> "An effect is just an optional behavior that is performed when
> the
>>>>>>>>>> transition fires"
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> - James.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>>>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>>>>>>>>>>> Hi all,
>>>>>>>>>>>
>>>>>>>>>>> I have a UML2 model describing two classes A and B with an
>>>>> association
>>>>>>>>>>> which makes an instance of B be visible to A (A.b). A owns a
>>>>>>>>>>> state
>>>>>>>>>>> machine. I would like a transition in that state machine to
> have
>>> an
>>>>>>>>> Effect
>>>>>>>>>>> calling a method b.doSomething(). I've tried to accomplish this
>>> both
>>>>>>>>>>> programmatically and graphically by using RSA, with no luck.
>>>>>>>>>>>
>>>>>>>>>>> Could you point me to the correct UML2 API for creating such an
>>>>>>> effect?
>>>>>>>>>>> Thanks in advance for your help.
>>>>>>>>>>>
>>>>>>>>>>> Mirco
>>>>>
>>>
>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598361 is a reply to message #471360] Thu, 08 March 2007 00:39 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

An effect is a Behavior. I would suggest creating an Interaction ( which
is a Behavior ) and specify a lifeline b:B that with a message whose
signature is "doSomething()". Set your effect to be that Interaction.

"An effect is just an optional behavior that is performed when the
transition fires"

Regards,

- James.



"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:esmkn1$9r0$1@utils.eclipse.org...
> Hi all,
>
> I have a UML2 model describing two classes A and B with an association
> which makes an instance of B be visible to A (A.b). A owns a state
> machine. I would like a transition in that state machine to have an Effect
> calling a method b.doSomething(). I've tried to accomplish this both
> programmatically and graphically by using RSA, with no luck.
>
> Could you point me to the correct UML2 API for creating such an effect?
>
> Thanks in advance for your help.
>
> Mirco
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598368 is a reply to message #471623] Thu, 08 March 2007 14:18 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
.... From RSA it looks like when you create an effect you get an opaque
behavior.
You can create your interaction with sequence diagram under that opaque
behavior.
In general, you should be able to simply create an Interaction as the
effect.

- James.



"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:esnlr2$hhu$1@utils.eclipse.org...
> Hi Mirco,
>
> An effect is a Behavior. I would suggest creating an Interaction (
which
> is a Behavior ) and specify a lifeline b:B that with a message whose
> signature is "doSomething()". Set your effect to be that Interaction.
>
> "An effect is just an optional behavior that is performed when the
> transition fires"
>
> Regards,
>
> - James.
>
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:esmkn1$9r0$1@utils.eclipse.org...
> > Hi all,
> >
> > I have a UML2 model describing two classes A and B with an association
> > which makes an instance of B be visible to A (A.b). A owns a state
> > machine. I would like a transition in that state machine to have an
Effect
> > calling a method b.doSomething(). I've tried to accomplish this both
> > programmatically and graphically by using RSA, with no luck.
> >
> > Could you point me to the correct UML2 API for creating such an effect?
> >
> > Thanks in advance for your help.
> >
> > Mirco
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598375 is a reply to message #471624] Thu, 08 March 2007 15:51 Go to previous message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

Many thanks for this. I tried to do as you suggested and now I have an
Interaction under the Opaque Behavior representing the effect of my
transition. However, the model doesn't validate and I get the following
error:

Assembly connector '<Connector>' must only be defined from a role end
requiring an interface to a role end providing that interface.

The sequence diagram has two lifelines a:A and b:B and the message
b.doSomething. As the problem occurs every time I create an interaction
between two associated classes, I think I might be developing the model
in a wrong way. On the other hand, the validation on the RSA sample
sequence diagrams gives the same results. Any ideas about that?

Thanks again for your time

Cheers
Mirco

James Bruck wrote:
> ... From RSA it looks like when you create an effect you get an opaque
> behavior.
> You can create your interaction with sequence diagram under that opaque
> behavior.
> In general, you should be able to simply create an Interaction as the
> effect.
>
> - James.
>
>
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:esnlr2$hhu$1@utils.eclipse.org...
>> Hi Mirco,
>>
>> An effect is a Behavior. I would suggest creating an Interaction (
> which
>> is a Behavior ) and specify a lifeline b:B that with a message whose
>> signature is "doSomething()". Set your effect to be that Interaction.
>>
>> "An effect is just an optional behavior that is performed when the
>> transition fires"
>>
>> Regards,
>>
>> - James.
>>
>>
>>
>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> news:esmkn1$9r0$1@utils.eclipse.org...
>>> Hi all,
>>>
>>> I have a UML2 model describing two classes A and B with an association
>>> which makes an instance of B be visible to A (A.b). A owns a state
>>> machine. I would like a transition in that state machine to have an
> Effect
>>> calling a method b.doSomething(). I've tried to accomplish this both
>>> programmatically and graphically by using RSA, with no luck.
>>>
>>> Could you point me to the correct UML2 API for creating such an effect?
>>>
>>> Thanks in advance for your help.
>>>
>>> Mirco
>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598377 is a reply to message #471625] Thu, 08 March 2007 17:50 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

RSA creates an assembly connector between the two lifelines indicating that
there is some communication at runtime.
RSA does this because they can automatically generate communication diagrams
from the sequence diagram. Those communication diagrams require the
specification of the connector to show that the two lifelines interact ( ie
Message Pathways are Connectors ).
You can understand this better by deleting automatically generated connector
under the interaction, then select the interaction and create a
communication diagram.
Now, put the connector back and create a communication diagram by selecting
the interaction and creating the diagram.
In one case, the lifelines are connected, in the other, they are disjoint.
The validation rule is complaining because of constraints around connectors
requiring assembly connectors to be connected to "compatible" Connectable
Elements. Your model in effect is incomplete ( it should just be a warning
by the way .. not an error ).

If your lifelines were typed by components requiring and providing
interfaces you would not get this warning. You can complete your model
by creating Interface realizations and Usages from the classifiers typing
the lifeline's to a common interface. You might alternatively use a
Composite structure diagram to complete your model.

However, you could simply delete the connector and consider your sequence
diagram to be a "sketch" as opposed to a completely specified model.

Regards,

- James.


"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:espboi$4b5$1@utils.eclipse.org...
> Hi James,
>
> Many thanks for this. I tried to do as you suggested and now I have an
> Interaction under the Opaque Behavior representing the effect of my
> transition. However, the model doesn't validate and I get the following
> error:
>
> Assembly connector '<Connector>' must only be defined from a role end
> requiring an interface to a role end providing that interface.
>
> The sequence diagram has two lifelines a:A and b:B and the message
> b.doSomething. As the problem occurs every time I create an interaction
> between two associated classes, I think I might be developing the model
> in a wrong way. On the other hand, the validation on the RSA sample
> sequence diagrams gives the same results. Any ideas about that?
>
> Thanks again for your time
>
> Cheers
> Mirco
>
> James Bruck wrote:
> > ... From RSA it looks like when you create an effect you get an opaque
> > behavior.
> > You can create your interaction with sequence diagram under that opaque
> > behavior.
> > In general, you should be able to simply create an Interaction as the
> > effect.
> >
> > - James.
> >
> >
> >
> > "James Bruck" <jbruck@ca.ibm.com> wrote in message
> > news:esnlr2$hhu$1@utils.eclipse.org...
> >> Hi Mirco,
> >>
> >> An effect is a Behavior. I would suggest creating an Interaction (
> > which
> >> is a Behavior ) and specify a lifeline b:B that with a message whose
> >> signature is "doSomething()". Set your effect to be that Interaction.
> >>
> >> "An effect is just an optional behavior that is performed when the
> >> transition fires"
> >>
> >> Regards,
> >>
> >> - James.
> >>
> >>
> >>
> >> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> news:esmkn1$9r0$1@utils.eclipse.org...
> >>> Hi all,
> >>>
> >>> I have a UML2 model describing two classes A and B with an association
> >>> which makes an instance of B be visible to A (A.b). A owns a state
> >>> machine. I would like a transition in that state machine to have an
> > Effect
> >>> calling a method b.doSomething(). I've tried to accomplish this both
> >>> programmatically and graphically by using RSA, with no luck.
> >>>
> >>> Could you point me to the correct UML2 API for creating such an
effect?
> >>>
> >>> Thanks in advance for your help.
> >>>
> >>> Mirco
> >>
> >
> >
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598409 is a reply to message #471626] Fri, 09 March 2007 10:52 Go to previous message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

Thank you for your thorough and interesting reply. I completed my model
by creating an interface exposing doSomething(). B realizes the
interface and A uses it. Now the model validates.

I have one more question about the UML metamodel and its relationship
with RSA and the UML2 API. I actually realized that I could make the
model simpler by getting rid of the classes owning the state machines,
as a state machine is itself a class according to the UML2 API.
Therefore I now have two state machines for which I want to describe the
communication between each other. I drew a little class diagram
including the two state machines A and B as well as the common interface
as you suggested. I wanted to draw an interface realization line between
B and the interface but apparently I am not allowed to do so. My
question is: Am I doing something wrong or doesn't RSA support offer
this possibility?

Thank you again

Regards,
Mirco

James Bruck wrote:
> Hi Mirco,
>
> RSA creates an assembly connector between the two lifelines indicating that
> there is some communication at runtime.
> RSA does this because they can automatically generate communication diagrams
> from the sequence diagram. Those communication diagrams require the
> specification of the connector to show that the two lifelines interact ( ie
> Message Pathways are Connectors ).
> You can understand this better by deleting automatically generated connector
> under the interaction, then select the interaction and create a
> communication diagram.
> Now, put the connector back and create a communication diagram by selecting
> the interaction and creating the diagram.
> In one case, the lifelines are connected, in the other, they are disjoint.
> The validation rule is complaining because of constraints around connectors
> requiring assembly connectors to be connected to "compatible" Connectable
> Elements. Your model in effect is incomplete ( it should just be a warning
> by the way .. not an error ).
>
> If your lifelines were typed by components requiring and providing
> interfaces you would not get this warning. You can complete your model
> by creating Interface realizations and Usages from the classifiers typing
> the lifeline's to a common interface. You might alternatively use a
> Composite structure diagram to complete your model.
>
> However, you could simply delete the connector and consider your sequence
> diagram to be a "sketch" as opposed to a completely specified model.
>
> Regards,
>
> - James.
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:espboi$4b5$1@utils.eclipse.org...
>> Hi James,
>>
>> Many thanks for this. I tried to do as you suggested and now I have an
>> Interaction under the Opaque Behavior representing the effect of my
>> transition. However, the model doesn't validate and I get the following
>> error:
>>
>> Assembly connector '<Connector>' must only be defined from a role end
>> requiring an interface to a role end providing that interface.
>>
>> The sequence diagram has two lifelines a:A and b:B and the message
>> b.doSomething. As the problem occurs every time I create an interaction
>> between two associated classes, I think I might be developing the model
>> in a wrong way. On the other hand, the validation on the RSA sample
>> sequence diagrams gives the same results. Any ideas about that?
>>
>> Thanks again for your time
>>
>> Cheers
>> Mirco
>>
>> James Bruck wrote:
>>> ... From RSA it looks like when you create an effect you get an opaque
>>> behavior.
>>> You can create your interaction with sequence diagram under that opaque
>>> behavior.
>>> In general, you should be able to simply create an Interaction as the
>>> effect.
>>>
>>> - James.
>>>
>>>
>>>
>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>>> news:esnlr2$hhu$1@utils.eclipse.org...
>>>> Hi Mirco,
>>>>
>>>> An effect is a Behavior. I would suggest creating an Interaction (
>>> which
>>>> is a Behavior ) and specify a lifeline b:B that with a message whose
>>>> signature is "doSomething()". Set your effect to be that Interaction.
>>>>
>>>> "An effect is just an optional behavior that is performed when the
>>>> transition fires"
>>>>
>>>> Regards,
>>>>
>>>> - James.
>>>>
>>>>
>>>>
>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>>>>> Hi all,
>>>>>
>>>>> I have a UML2 model describing two classes A and B with an association
>>>>> which makes an instance of B be visible to A (A.b). A owns a state
>>>>> machine. I would like a transition in that state machine to have an
>>> Effect
>>>>> calling a method b.doSomething(). I've tried to accomplish this both
>>>>> programmatically and graphically by using RSA, with no luck.
>>>>>
>>>>> Could you point me to the correct UML2 API for creating such an
> effect?
>>>>> Thanks in advance for your help.
>>>>>
>>>>> Mirco
>>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598416 is a reply to message #471630] Fri, 09 March 2007 14:46 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

I'll try not to turn this into a RSA forum but from what you describe, you
should be able to draw that interface realization.
I have made myself a little model that I think follows what you are doing
and it seems to work.

From what I understand your state machine does not have a context and you
are having problems because you cannot visualize that statemachine as a
class on a class diagram and then draw an interface realization. Try
selecting your State Machine, then go to the Properties > Advanced. Now
select the collections editor. Select Interface Realization and then browse
to the interface you are interested in. ( There might be an easier way that
I'm unaware of ). In general, you have access to all the opensource
options via the advanced tab in RSA. More common properties are added to
other tabs.

If you could describe the ultimate problem you are trying to solve there is
a slim chance I might be able to make semi-reasonable comments :)

Regards,

- James.


"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:esrekf$n2$1@utils.eclipse.org...
> Hi James,
>
> Thank you for your thorough and interesting reply. I completed my model
> by creating an interface exposing doSomething(). B realizes the
> interface and A uses it. Now the model validates.
>
> I have one more question about the UML metamodel and its relationship
> with RSA and the UML2 API. I actually realized that I could make the
> model simpler by getting rid of the classes owning the state machines,
> as a state machine is itself a class according to the UML2 API.
> Therefore I now have two state machines for which I want to describe the
> communication between each other. I drew a little class diagram
> including the two state machines A and B as well as the common interface
> as you suggested. I wanted to draw an interface realization line between
> B and the interface but apparently I am not allowed to do so. My
> question is: Am I doing something wrong or doesn't RSA support offer
> this possibility?
>
> Thank you again
>
> Regards,
> Mirco
>
> James Bruck wrote:
> > Hi Mirco,
> >
> > RSA creates an assembly connector between the two lifelines indicating
that
> > there is some communication at runtime.
> > RSA does this because they can automatically generate communication
diagrams
> > from the sequence diagram. Those communication diagrams require the
> > specification of the connector to show that the two lifelines interact
( ie
> > Message Pathways are Connectors ).
> > You can understand this better by deleting automatically generated
connector
> > under the interaction, then select the interaction and create a
> > communication diagram.
> > Now, put the connector back and create a communication diagram by
selecting
> > the interaction and creating the diagram.
> > In one case, the lifelines are connected, in the other, they are
disjoint.
> > The validation rule is complaining because of constraints around
connectors
> > requiring assembly connectors to be connected to "compatible"
Connectable
> > Elements. Your model in effect is incomplete ( it should just be a
warning
> > by the way .. not an error ).
> >
> > If your lifelines were typed by components requiring and providing
> > interfaces you would not get this warning. You can complete your
model
> > by creating Interface realizations and Usages from the classifiers
typing
> > the lifeline's to a common interface. You might alternatively use a
> > Composite structure diagram to complete your model.
> >
> > However, you could simply delete the connector and consider your
sequence
> > diagram to be a "sketch" as opposed to a completely specified model.
> >
> > Regards,
> >
> > - James.
> >
> >
> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> > news:espboi$4b5$1@utils.eclipse.org...
> >> Hi James,
> >>
> >> Many thanks for this. I tried to do as you suggested and now I have an
> >> Interaction under the Opaque Behavior representing the effect of my
> >> transition. However, the model doesn't validate and I get the following
> >> error:
> >>
> >> Assembly connector '<Connector>' must only be defined from a role end
> >> requiring an interface to a role end providing that interface.
> >>
> >> The sequence diagram has two lifelines a:A and b:B and the message
> >> b.doSomething. As the problem occurs every time I create an interaction
> >> between two associated classes, I think I might be developing the model
> >> in a wrong way. On the other hand, the validation on the RSA sample
> >> sequence diagrams gives the same results. Any ideas about that?
> >>
> >> Thanks again for your time
> >>
> >> Cheers
> >> Mirco
> >>
> >> James Bruck wrote:
> >>> ... From RSA it looks like when you create an effect you get an opaque
> >>> behavior.
> >>> You can create your interaction with sequence diagram under that
opaque
> >>> behavior.
> >>> In general, you should be able to simply create an Interaction as the
> >>> effect.
> >>>
> >>> - James.
> >>>
> >>>
> >>>
> >>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> >>> news:esnlr2$hhu$1@utils.eclipse.org...
> >>>> Hi Mirco,
> >>>>
> >>>> An effect is a Behavior. I would suggest creating an Interaction (
> >>> which
> >>>> is a Behavior ) and specify a lifeline b:B that with a message whose
> >>>> signature is "doSomething()". Set your effect to be that
Interaction.
> >>>>
> >>>> "An effect is just an optional behavior that is performed when the
> >>>> transition fires"
> >>>>
> >>>> Regards,
> >>>>
> >>>> - James.
> >>>>
> >>>>
> >>>>
> >>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >>>> news:esmkn1$9r0$1@utils.eclipse.org...
> >>>>> Hi all,
> >>>>>
> >>>>> I have a UML2 model describing two classes A and B with an
association
> >>>>> which makes an instance of B be visible to A (A.b). A owns a state
> >>>>> machine. I would like a transition in that state machine to have an
> >>> Effect
> >>>>> calling a method b.doSomething(). I've tried to accomplish this both
> >>>>> programmatically and graphically by using RSA, with no luck.
> >>>>>
> >>>>> Could you point me to the correct UML2 API for creating such an
> > effect?
> >>>>> Thanks in advance for your help.
> >>>>>
> >>>>> Mirco
> >>>
> >
> >
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598424 is a reply to message #471631] Fri, 09 March 2007 17:07 Go to previous message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

I'm sorry for having (ab)used this newsgroup for RSA-related isses.
Thank you for your patience in answering these questions.

Well, I try to describe what I'm doing in a few lines. Basically I want
to apply UML to a formal language which ultimately lets me do
performance modeling of the system under study. I'd like to be able to
draw a model and get analysis results back after the model has been
evaluated using this formal language. So, RSA is the graphical tool and
I use the UML2 API to do the mapping, carry out performance analysis and
annotate the results in the UML model.

UML is a lot bigger and far more complicated than the meta-model of the
formal language, so I am now working on figuring out what is the best
subset of the UML which lets me do that. I think there are different
ways and I want to analyze their pros and cons in order to focus on the
simplest and most intuitive one. The main constraint is that the model
drawn using RSA should validate OK.

The main problem I've had so far is how to model interaction between two
state machines, i.e. an effect of a transition of a state machine
calling a method of another class visible to that state machine. This
discussion has been very helpful to give me insights into that. I'm not
entirely happy with the solution of state machines exposing interfaces
in order to have a valid sequence diagram which models their interaction.

I would very much appreciate a "semi-reasonable comment" ;-) on whether
you would suggest drawing a Composite structure diagram instead.

Regards,
Mirco

James Bruck wrote:
> Hi Mirco,
>
> I'll try not to turn this into a RSA forum but from what you describe, you
> should be able to draw that interface realization.
> I have made myself a little model that I think follows what you are doing
> and it seems to work.
>
> From what I understand your state machine does not have a context and you
> are having problems because you cannot visualize that statemachine as a
> class on a class diagram and then draw an interface realization. Try
> selecting your State Machine, then go to the Properties > Advanced. Now
> select the collections editor. Select Interface Realization and then browse
> to the interface you are interested in. ( There might be an easier way that
> I'm unaware of ). In general, you have access to all the opensource
> options via the advanced tab in RSA. More common properties are added to
> other tabs.
>
> If you could describe the ultimate problem you are trying to solve there is
> a slim chance I might be able to make semi-reasonable comments :)
>
> Regards,
>
> - James.
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:esrekf$n2$1@utils.eclipse.org...
>> Hi James,
>>
>> Thank you for your thorough and interesting reply. I completed my model
>> by creating an interface exposing doSomething(). B realizes the
>> interface and A uses it. Now the model validates.
>>
>> I have one more question about the UML metamodel and its relationship
>> with RSA and the UML2 API. I actually realized that I could make the
>> model simpler by getting rid of the classes owning the state machines,
>> as a state machine is itself a class according to the UML2 API.
>> Therefore I now have two state machines for which I want to describe the
>> communication between each other. I drew a little class diagram
>> including the two state machines A and B as well as the common interface
>> as you suggested. I wanted to draw an interface realization line between
>> B and the interface but apparently I am not allowed to do so. My
>> question is: Am I doing something wrong or doesn't RSA support offer
>> this possibility?
>>
>> Thank you again
>>
>> Regards,
>> Mirco
>>
>> James Bruck wrote:
>>> Hi Mirco,
>>>
>>> RSA creates an assembly connector between the two lifelines indicating
> that
>>> there is some communication at runtime.
>>> RSA does this because they can automatically generate communication
> diagrams
>>> from the sequence diagram. Those communication diagrams require the
>>> specification of the connector to show that the two lifelines interact
> ( ie
>>> Message Pathways are Connectors ).
>>> You can understand this better by deleting automatically generated
> connector
>>> under the interaction, then select the interaction and create a
>>> communication diagram.
>>> Now, put the connector back and create a communication diagram by
> selecting
>>> the interaction and creating the diagram.
>>> In one case, the lifelines are connected, in the other, they are
> disjoint.
>>> The validation rule is complaining because of constraints around
> connectors
>>> requiring assembly connectors to be connected to "compatible"
> Connectable
>>> Elements. Your model in effect is incomplete ( it should just be a
> warning
>>> by the way .. not an error ).
>>>
>>> If your lifelines were typed by components requiring and providing
>>> interfaces you would not get this warning. You can complete your
> model
>>> by creating Interface realizations and Usages from the classifiers
> typing
>>> the lifeline's to a common interface. You might alternatively use a
>>> Composite structure diagram to complete your model.
>>>
>>> However, you could simply delete the connector and consider your
> sequence
>>> diagram to be a "sketch" as opposed to a completely specified model.
>>>
>>> Regards,
>>>
>>> - James.
>>>
>>>
>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>> news:espboi$4b5$1@utils.eclipse.org...
>>>> Hi James,
>>>>
>>>> Many thanks for this. I tried to do as you suggested and now I have an
>>>> Interaction under the Opaque Behavior representing the effect of my
>>>> transition. However, the model doesn't validate and I get the following
>>>> error:
>>>>
>>>> Assembly connector '<Connector>' must only be defined from a role end
>>>> requiring an interface to a role end providing that interface.
>>>>
>>>> The sequence diagram has two lifelines a:A and b:B and the message
>>>> b.doSomething. As the problem occurs every time I create an interaction
>>>> between two associated classes, I think I might be developing the model
>>>> in a wrong way. On the other hand, the validation on the RSA sample
>>>> sequence diagrams gives the same results. Any ideas about that?
>>>>
>>>> Thanks again for your time
>>>>
>>>> Cheers
>>>> Mirco
>>>>
>>>> James Bruck wrote:
>>>>> ... From RSA it looks like when you create an effect you get an opaque
>>>>> behavior.
>>>>> You can create your interaction with sequence diagram under that
> opaque
>>>>> behavior.
>>>>> In general, you should be able to simply create an Interaction as the
>>>>> effect.
>>>>>
>>>>> - James.
>>>>>
>>>>>
>>>>>
>>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>>>>> news:esnlr2$hhu$1@utils.eclipse.org...
>>>>>> Hi Mirco,
>>>>>>
>>>>>> An effect is a Behavior. I would suggest creating an Interaction (
>>>>> which
>>>>>> is a Behavior ) and specify a lifeline b:B that with a message whose
>>>>>> signature is "doSomething()". Set your effect to be that
> Interaction.
>>>>>> "An effect is just an optional behavior that is performed when the
>>>>>> transition fires"
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> - James.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I have a UML2 model describing two classes A and B with an
> association
>>>>>>> which makes an instance of B be visible to A (A.b). A owns a state
>>>>>>> machine. I would like a transition in that state machine to have an
>>>>> Effect
>>>>>>> calling a method b.doSomething(). I've tried to accomplish this both
>>>>>>> programmatically and graphically by using RSA, with no luck.
>>>>>>>
>>>>>>> Could you point me to the correct UML2 API for creating such an
>>> effect?
>>>>>>> Thanks in advance for your help.
>>>>>>>
>>>>>>> Mirco
>>>
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598429 is a reply to message #471632] Fri, 09 March 2007 23:07 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

I don't want to give you the impression that you 'have' to expose interfaces
from your state machine. There are many different ways to complete your
model. You might want to use ports etc.

You might want to see some of the draft articles here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
extending UML or restricting yourself to those language units you might be
interested in.

Composite structure diagram is your best bet to fine tune the interaction
between parts/ports. Lifelines represent ConnectableElements ... parts and
ports are connectable elements.

( By the way I hope you have RSA 7.x ... there are some nice enhancements in
this version that try to hide some "nastiness" when creating required and
provided interfaces :) ).

Cheers,

-James.


"Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
news:ess4ja$nkb$1@utils.eclipse.org...
> Hi James,
>
> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
> Thank you for your patience in answering these questions.
>
> Well, I try to describe what I'm doing in a few lines. Basically I want
> to apply UML to a formal language which ultimately lets me do
> performance modeling of the system under study. I'd like to be able to
> draw a model and get analysis results back after the model has been
> evaluated using this formal language. So, RSA is the graphical tool and
> I use the UML2 API to do the mapping, carry out performance analysis and
> annotate the results in the UML model.
>
> UML is a lot bigger and far more complicated than the meta-model of the
> formal language, so I am now working on figuring out what is the best
> subset of the UML which lets me do that. I think there are different
> ways and I want to analyze their pros and cons in order to focus on the
> simplest and most intuitive one. The main constraint is that the model
> drawn using RSA should validate OK.
>
> The main problem I've had so far is how to model interaction between two
> state machines, i.e. an effect of a transition of a state machine
> calling a method of another class visible to that state machine. This
> discussion has been very helpful to give me insights into that. I'm not
> entirely happy with the solution of state machines exposing interfaces
> in order to have a valid sequence diagram which models their interaction.
>
> I would very much appreciate a "semi-reasonable comment" ;-) on whether
> you would suggest drawing a Composite structure diagram instead.
>
> Regards,
> Mirco
>
> James Bruck wrote:
> > Hi Mirco,
> >
> > I'll try not to turn this into a RSA forum but from what you describe,
you
> > should be able to draw that interface realization.
> > I have made myself a little model that I think follows what you are
doing
> > and it seems to work.
> >
> > From what I understand your state machine does not have a context and
you
> > are having problems because you cannot visualize that statemachine as a
> > class on a class diagram and then draw an interface realization. Try
> > selecting your State Machine, then go to the Properties > Advanced.
Now
> > select the collections editor. Select Interface Realization and then
browse
> > to the interface you are interested in. ( There might be an easier way
that
> > I'm unaware of ). In general, you have access to all the opensource
> > options via the advanced tab in RSA. More common properties are added
to
> > other tabs.
> >
> > If you could describe the ultimate problem you are trying to solve there
is
> > a slim chance I might be able to make semi-reasonable comments :)
> >
> > Regards,
> >
> > - James.
> >
> >
> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> > news:esrekf$n2$1@utils.eclipse.org...
> >> Hi James,
> >>
> >> Thank you for your thorough and interesting reply. I completed my model
> >> by creating an interface exposing doSomething(). B realizes the
> >> interface and A uses it. Now the model validates.
> >>
> >> I have one more question about the UML metamodel and its relationship
> >> with RSA and the UML2 API. I actually realized that I could make the
> >> model simpler by getting rid of the classes owning the state machines,
> >> as a state machine is itself a class according to the UML2 API.
> >> Therefore I now have two state machines for which I want to describe
the
> >> communication between each other. I drew a little class diagram
> >> including the two state machines A and B as well as the common
interface
> >> as you suggested. I wanted to draw an interface realization line
between
> >> B and the interface but apparently I am not allowed to do so. My
> >> question is: Am I doing something wrong or doesn't RSA support offer
> >> this possibility?
> >>
> >> Thank you again
> >>
> >> Regards,
> >> Mirco
> >>
> >> James Bruck wrote:
> >>> Hi Mirco,
> >>>
> >>> RSA creates an assembly connector between the two lifelines indicating
> > that
> >>> there is some communication at runtime.
> >>> RSA does this because they can automatically generate communication
> > diagrams
> >>> from the sequence diagram. Those communication diagrams require the
> >>> specification of the connector to show that the two lifelines interact
> > ( ie
> >>> Message Pathways are Connectors ).
> >>> You can understand this better by deleting automatically generated
> > connector
> >>> under the interaction, then select the interaction and create a
> >>> communication diagram.
> >>> Now, put the connector back and create a communication diagram by
> > selecting
> >>> the interaction and creating the diagram.
> >>> In one case, the lifelines are connected, in the other, they are
> > disjoint.
> >>> The validation rule is complaining because of constraints around
> > connectors
> >>> requiring assembly connectors to be connected to "compatible"
> > Connectable
> >>> Elements. Your model in effect is incomplete ( it should just be a
> > warning
> >>> by the way .. not an error ).
> >>>
> >>> If your lifelines were typed by components requiring and providing
> >>> interfaces you would not get this warning. You can complete your
> > model
> >>> by creating Interface realizations and Usages from the classifiers
> > typing
> >>> the lifeline's to a common interface. You might alternatively use a
> >>> Composite structure diagram to complete your model.
> >>>
> >>> However, you could simply delete the connector and consider your
> > sequence
> >>> diagram to be a "sketch" as opposed to a completely specified model.
> >>>
> >>> Regards,
> >>>
> >>> - James.
> >>>
> >>>
> >>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >>> news:espboi$4b5$1@utils.eclipse.org...
> >>>> Hi James,
> >>>>
> >>>> Many thanks for this. I tried to do as you suggested and now I have
an
> >>>> Interaction under the Opaque Behavior representing the effect of my
> >>>> transition. However, the model doesn't validate and I get the
following
> >>>> error:
> >>>>
> >>>> Assembly connector '<Connector>' must only be defined from a role end
> >>>> requiring an interface to a role end providing that interface.
> >>>>
> >>>> The sequence diagram has two lifelines a:A and b:B and the message
> >>>> b.doSomething. As the problem occurs every time I create an
interaction
> >>>> between two associated classes, I think I might be developing the
model
> >>>> in a wrong way. On the other hand, the validation on the RSA sample
> >>>> sequence diagrams gives the same results. Any ideas about that?
> >>>>
> >>>> Thanks again for your time
> >>>>
> >>>> Cheers
> >>>> Mirco
> >>>>
> >>>> James Bruck wrote:
> >>>>> ... From RSA it looks like when you create an effect you get an
opaque
> >>>>> behavior.
> >>>>> You can create your interaction with sequence diagram under that
> > opaque
> >>>>> behavior.
> >>>>> In general, you should be able to simply create an Interaction as
the
> >>>>> effect.
> >>>>>
> >>>>> - James.
> >>>>>
> >>>>>
> >>>>>
> >>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> >>>>> news:esnlr2$hhu$1@utils.eclipse.org...
> >>>>>> Hi Mirco,
> >>>>>>
> >>>>>> An effect is a Behavior. I would suggest creating an Interaction
(
> >>>>> which
> >>>>>> is a Behavior ) and specify a lifeline b:B that with a message
whose
> >>>>>> signature is "doSomething()". Set your effect to be that
> > Interaction.
> >>>>>> "An effect is just an optional behavior that is performed when the
> >>>>>> transition fires"
> >>>>>>
> >>>>>> Regards,
> >>>>>>
> >>>>>> - James.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
> >>>>>>> Hi all,
> >>>>>>>
> >>>>>>> I have a UML2 model describing two classes A and B with an
> > association
> >>>>>>> which makes an instance of B be visible to A (A.b). A owns a state
> >>>>>>> machine. I would like a transition in that state machine to have
an
> >>>>> Effect
> >>>>>>> calling a method b.doSomething(). I've tried to accomplish this
both
> >>>>>>> programmatically and graphically by using RSA, with no luck.
> >>>>>>>
> >>>>>>> Could you point me to the correct UML2 API for creating such an
> >>> effect?
> >>>>>>> Thanks in advance for your help.
> >>>>>>>
> >>>>>>> Mirco
> >>>
> >
> >
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598436 is a reply to message #471633] Sat, 10 March 2007 02:25 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
.... two other points...

You pointed out that a StateMachine is a Class and therefore doesn't have to
have any context. Although this is technically true, I'm not sure what it
really means to have a Behavior with no context. From the spec p. 447 "
Behavior is a specification of how its context classifier changes state over
time..." p448 shows the cardinality of context to be [0..1] suggesting it is
ok to be 0 but I question how practical that is. I believe that a behavior
is a class is a side effect of behaviors requiring attributes, operations
and other inherited attributes.

Also, the constraint you were getting hung up on is described on p159
constraint [5] "An assembly connector must only be defined from a required
Interface or Ports to a provided Interface or Port". From what I
understand, there is an issue raised on OMG to relax some of the constraints
on connectors ( this one in particular) that would allow your model to
validate ( once adopted into the spec ).

I'll follow up on that first point and get back to you with the intent of
"context".

Regards,

- James.



"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:esspcb$mea$2@utils.eclipse.org...
> Hi Mirco,
>
> I don't want to give you the impression that you 'have' to expose
> interfaces
> from your state machine. There are many different ways to complete your
> model. You might want to use ports etc.
>
> You might want to see some of the draft articles here
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
> extending UML or restricting yourself to those language units you might be
> interested in.
>
> Composite structure diagram is your best bet to fine tune the interaction
> between parts/ports. Lifelines represent ConnectableElements ... parts
> and
> ports are connectable elements.
>
> ( By the way I hope you have RSA 7.x ... there are some nice enhancements
> in
> this version that try to hide some "nastiness" when creating required and
> provided interfaces :) ).
>
> Cheers,
>
> -James.
>
>
> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> news:ess4ja$nkb$1@utils.eclipse.org...
>> Hi James,
>>
>> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
>> Thank you for your patience in answering these questions.
>>
>> Well, I try to describe what I'm doing in a few lines. Basically I want
>> to apply UML to a formal language which ultimately lets me do
>> performance modeling of the system under study. I'd like to be able to
>> draw a model and get analysis results back after the model has been
>> evaluated using this formal language. So, RSA is the graphical tool and
>> I use the UML2 API to do the mapping, carry out performance analysis and
>> annotate the results in the UML model.
>>
>> UML is a lot bigger and far more complicated than the meta-model of the
>> formal language, so I am now working on figuring out what is the best
>> subset of the UML which lets me do that. I think there are different
>> ways and I want to analyze their pros and cons in order to focus on the
>> simplest and most intuitive one. The main constraint is that the model
>> drawn using RSA should validate OK.
>>
>> The main problem I've had so far is how to model interaction between two
>> state machines, i.e. an effect of a transition of a state machine
>> calling a method of another class visible to that state machine. This
>> discussion has been very helpful to give me insights into that. I'm not
>> entirely happy with the solution of state machines exposing interfaces
>> in order to have a valid sequence diagram which models their interaction.
>>
>> I would very much appreciate a "semi-reasonable comment" ;-) on whether
>> you would suggest drawing a Composite structure diagram instead.
>>
>> Regards,
>> Mirco
>>
>> James Bruck wrote:
>> > Hi Mirco,
>> >
>> > I'll try not to turn this into a RSA forum but from what you describe,
> you
>> > should be able to draw that interface realization.
>> > I have made myself a little model that I think follows what you are
> doing
>> > and it seems to work.
>> >
>> > From what I understand your state machine does not have a context and
> you
>> > are having problems because you cannot visualize that statemachine as a
>> > class on a class diagram and then draw an interface realization. Try
>> > selecting your State Machine, then go to the Properties > Advanced.
> Now
>> > select the collections editor. Select Interface Realization and then
> browse
>> > to the interface you are interested in. ( There might be an easier way
> that
>> > I'm unaware of ). In general, you have access to all the opensource
>> > options via the advanced tab in RSA. More common properties are added
> to
>> > other tabs.
>> >
>> > If you could describe the ultimate problem you are trying to solve
>> > there
> is
>> > a slim chance I might be able to make semi-reasonable comments :)
>> >
>> > Regards,
>> >
>> > - James.
>> >
>> >
>> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> > news:esrekf$n2$1@utils.eclipse.org...
>> >> Hi James,
>> >>
>> >> Thank you for your thorough and interesting reply. I completed my
>> >> model
>> >> by creating an interface exposing doSomething(). B realizes the
>> >> interface and A uses it. Now the model validates.
>> >>
>> >> I have one more question about the UML metamodel and its relationship
>> >> with RSA and the UML2 API. I actually realized that I could make the
>> >> model simpler by getting rid of the classes owning the state machines,
>> >> as a state machine is itself a class according to the UML2 API.
>> >> Therefore I now have two state machines for which I want to describe
> the
>> >> communication between each other. I drew a little class diagram
>> >> including the two state machines A and B as well as the common
> interface
>> >> as you suggested. I wanted to draw an interface realization line
> between
>> >> B and the interface but apparently I am not allowed to do so. My
>> >> question is: Am I doing something wrong or doesn't RSA support offer
>> >> this possibility?
>> >>
>> >> Thank you again
>> >>
>> >> Regards,
>> >> Mirco
>> >>
>> >> James Bruck wrote:
>> >>> Hi Mirco,
>> >>>
>> >>> RSA creates an assembly connector between the two lifelines
>> >>> indicating
>> > that
>> >>> there is some communication at runtime.
>> >>> RSA does this because they can automatically generate communication
>> > diagrams
>> >>> from the sequence diagram. Those communication diagrams require the
>> >>> specification of the connector to show that the two lifelines
>> >>> interact
>> > ( ie
>> >>> Message Pathways are Connectors ).
>> >>> You can understand this better by deleting automatically generated
>> > connector
>> >>> under the interaction, then select the interaction and create a
>> >>> communication diagram.
>> >>> Now, put the connector back and create a communication diagram by
>> > selecting
>> >>> the interaction and creating the diagram.
>> >>> In one case, the lifelines are connected, in the other, they are
>> > disjoint.
>> >>> The validation rule is complaining because of constraints around
>> > connectors
>> >>> requiring assembly connectors to be connected to "compatible"
>> > Connectable
>> >>> Elements. Your model in effect is incomplete ( it should just be a
>> > warning
>> >>> by the way .. not an error ).
>> >>>
>> >>> If your lifelines were typed by components requiring and providing
>> >>> interfaces you would not get this warning. You can complete your
>> > model
>> >>> by creating Interface realizations and Usages from the classifiers
>> > typing
>> >>> the lifeline's to a common interface. You might alternatively use a
>> >>> Composite structure diagram to complete your model.
>> >>>
>> >>> However, you could simply delete the connector and consider your
>> > sequence
>> >>> diagram to be a "sketch" as opposed to a completely specified model.
>> >>>
>> >>> Regards,
>> >>>
>> >>> - James.
>> >>>
>> >>>
>> >>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> >>> news:espboi$4b5$1@utils.eclipse.org...
>> >>>> Hi James,
>> >>>>
>> >>>> Many thanks for this. I tried to do as you suggested and now I have
> an
>> >>>> Interaction under the Opaque Behavior representing the effect of my
>> >>>> transition. However, the model doesn't validate and I get the
> following
>> >>>> error:
>> >>>>
>> >>>> Assembly connector '<Connector>' must only be defined from a role
>> >>>> end
>> >>>> requiring an interface to a role end providing that interface.
>> >>>>
>> >>>> The sequence diagram has two lifelines a:A and b:B and the message
>> >>>> b.doSomething. As the problem occurs every time I create an
> interaction
>> >>>> between two associated classes, I think I might be developing the
> model
>> >>>> in a wrong way. On the other hand, the validation on the RSA sample
>> >>>> sequence diagrams gives the same results. Any ideas about that?
>> >>>>
>> >>>> Thanks again for your time
>> >>>>
>> >>>> Cheers
>> >>>> Mirco
>> >>>>
>> >>>> James Bruck wrote:
>> >>>>> ... From RSA it looks like when you create an effect you get an
> opaque
>> >>>>> behavior.
>> >>>>> You can create your interaction with sequence diagram under that
>> > opaque
>> >>>>> behavior.
>> >>>>> In general, you should be able to simply create an Interaction as
> the
>> >>>>> effect.
>> >>>>>
>> >>>>> - James.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>> >>>>> news:esnlr2$hhu$1@utils.eclipse.org...
>> >>>>>> Hi Mirco,
>> >>>>>>
>> >>>>>> An effect is a Behavior. I would suggest creating an
>> >>>>>> Interaction
> (
>> >>>>> which
>> >>>>>> is a Behavior ) and specify a lifeline b:B that with a message
> whose
>> >>>>>> signature is "doSomething()". Set your effect to be that
>> > Interaction.
>> >>>>>> "An effect is just an optional behavior that is performed when the
>> >>>>>> transition fires"
>> >>>>>>
>> >>>>>> Regards,
>> >>>>>>
>> >>>>>> - James.
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>> >>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>> >>>>>>> Hi all,
>> >>>>>>>
>> >>>>>>> I have a UML2 model describing two classes A and B with an
>> > association
>> >>>>>>> which makes an instance of B be visible to A (A.b). A owns a
>> >>>>>>> state
>> >>>>>>> machine. I would like a transition in that state machine to have
> an
>> >>>>> Effect
>> >>>>>>> calling a method b.doSomething(). I've tried to accomplish this
> both
>> >>>>>>> programmatically and graphically by using RSA, with no luck.
>> >>>>>>>
>> >>>>>>> Could you point me to the correct UML2 API for creating such an
>> >>> effect?
>> >>>>>>> Thanks in advance for your help.
>> >>>>>>>
>> >>>>>>> Mirco
>> >>>
>> >
>> >
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598458 is a reply to message #471634] Mon, 12 March 2007 19:08 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Mirco,

.... so I just confirmed that you should really be creating your statemachine
in the context of some class and creating interface realizations to that
context class....


Regards,

- James



"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:est4pl$3o0$1@utils.eclipse.org...
> ... two other points...
>
> You pointed out that a StateMachine is a Class and therefore doesn't have
to
> have any context. Although this is technically true, I'm not sure what it
> really means to have a Behavior with no context. From the spec p. 447 "
> Behavior is a specification of how its context classifier changes state
over
> time..." p448 shows the cardinality of context to be [0..1] suggesting it
is
> ok to be 0 but I question how practical that is. I believe that a
behavior
> is a class is a side effect of behaviors requiring attributes, operations
> and other inherited attributes.
>
> Also, the constraint you were getting hung up on is described on p159
> constraint [5] "An assembly connector must only be defined from a required
> Interface or Ports to a provided Interface or Port". From what I
> understand, there is an issue raised on OMG to relax some of the
constraints
> on connectors ( this one in particular) that would allow your model to
> validate ( once adopted into the spec ).
>
> I'll follow up on that first point and get back to you with the intent of
> "context".
>
> Regards,
>
> - James.
>
>
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:esspcb$mea$2@utils.eclipse.org...
> > Hi Mirco,
> >
> > I don't want to give you the impression that you 'have' to expose
> > interfaces
> > from your state machine. There are many different ways to complete
your
> > model. You might want to use ports etc.
> >
> > You might want to see some of the draft articles here
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
> > extending UML or restricting yourself to those language units you might
be
> > interested in.
> >
> > Composite structure diagram is your best bet to fine tune the
interaction
> > between parts/ports. Lifelines represent ConnectableElements ... parts
> > and
> > ports are connectable elements.
> >
> > ( By the way I hope you have RSA 7.x ... there are some nice
enhancements
> > in
> > this version that try to hide some "nastiness" when creating required
and
> > provided interfaces :) ).
> >
> > Cheers,
> >
> > -James.
> >
> >
> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> > news:ess4ja$nkb$1@utils.eclipse.org...
> >> Hi James,
> >>
> >> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
> >> Thank you for your patience in answering these questions.
> >>
> >> Well, I try to describe what I'm doing in a few lines. Basically I want
> >> to apply UML to a formal language which ultimately lets me do
> >> performance modeling of the system under study. I'd like to be able to
> >> draw a model and get analysis results back after the model has been
> >> evaluated using this formal language. So, RSA is the graphical tool and
> >> I use the UML2 API to do the mapping, carry out performance analysis
and
> >> annotate the results in the UML model.
> >>
> >> UML is a lot bigger and far more complicated than the meta-model of the
> >> formal language, so I am now working on figuring out what is the best
> >> subset of the UML which lets me do that. I think there are different
> >> ways and I want to analyze their pros and cons in order to focus on the
> >> simplest and most intuitive one. The main constraint is that the model
> >> drawn using RSA should validate OK.
> >>
> >> The main problem I've had so far is how to model interaction between
two
> >> state machines, i.e. an effect of a transition of a state machine
> >> calling a method of another class visible to that state machine. This
> >> discussion has been very helpful to give me insights into that. I'm not
> >> entirely happy with the solution of state machines exposing interfaces
> >> in order to have a valid sequence diagram which models their
interaction.
> >>
> >> I would very much appreciate a "semi-reasonable comment" ;-) on
whether
> >> you would suggest drawing a Composite structure diagram instead.
> >>
> >> Regards,
> >> Mirco
> >>
> >> James Bruck wrote:
> >> > Hi Mirco,
> >> >
> >> > I'll try not to turn this into a RSA forum but from what you
describe,
> > you
> >> > should be able to draw that interface realization.
> >> > I have made myself a little model that I think follows what you are
> > doing
> >> > and it seems to work.
> >> >
> >> > From what I understand your state machine does not have a context and
> > you
> >> > are having problems because you cannot visualize that statemachine as
a
> >> > class on a class diagram and then draw an interface realization.
Try
> >> > selecting your State Machine, then go to the Properties > Advanced.
> > Now
> >> > select the collections editor. Select Interface Realization and then
> > browse
> >> > to the interface you are interested in. ( There might be an easier
way
> > that
> >> > I'm unaware of ). In general, you have access to all the
opensource
> >> > options via the advanced tab in RSA. More common properties are
added
> > to
> >> > other tabs.
> >> >
> >> > If you could describe the ultimate problem you are trying to solve
> >> > there
> > is
> >> > a slim chance I might be able to make semi-reasonable comments :)
> >> >
> >> > Regards,
> >> >
> >> > - James.
> >> >
> >> >
> >> > "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> > news:esrekf$n2$1@utils.eclipse.org...
> >> >> Hi James,
> >> >>
> >> >> Thank you for your thorough and interesting reply. I completed my
> >> >> model
> >> >> by creating an interface exposing doSomething(). B realizes the
> >> >> interface and A uses it. Now the model validates.
> >> >>
> >> >> I have one more question about the UML metamodel and its
relationship
> >> >> with RSA and the UML2 API. I actually realized that I could make the
> >> >> model simpler by getting rid of the classes owning the state
machines,
> >> >> as a state machine is itself a class according to the UML2 API.
> >> >> Therefore I now have two state machines for which I want to describe
> > the
> >> >> communication between each other. I drew a little class diagram
> >> >> including the two state machines A and B as well as the common
> > interface
> >> >> as you suggested. I wanted to draw an interface realization line
> > between
> >> >> B and the interface but apparently I am not allowed to do so. My
> >> >> question is: Am I doing something wrong or doesn't RSA support offer
> >> >> this possibility?
> >> >>
> >> >> Thank you again
> >> >>
> >> >> Regards,
> >> >> Mirco
> >> >>
> >> >> James Bruck wrote:
> >> >>> Hi Mirco,
> >> >>>
> >> >>> RSA creates an assembly connector between the two lifelines
> >> >>> indicating
> >> > that
> >> >>> there is some communication at runtime.
> >> >>> RSA does this because they can automatically generate communication
> >> > diagrams
> >> >>> from the sequence diagram. Those communication diagrams require
the
> >> >>> specification of the connector to show that the two lifelines
> >> >>> interact
> >> > ( ie
> >> >>> Message Pathways are Connectors ).
> >> >>> You can understand this better by deleting automatically generated
> >> > connector
> >> >>> under the interaction, then select the interaction and create a
> >> >>> communication diagram.
> >> >>> Now, put the connector back and create a communication diagram by
> >> > selecting
> >> >>> the interaction and creating the diagram.
> >> >>> In one case, the lifelines are connected, in the other, they are
> >> > disjoint.
> >> >>> The validation rule is complaining because of constraints around
> >> > connectors
> >> >>> requiring assembly connectors to be connected to "compatible"
> >> > Connectable
> >> >>> Elements. Your model in effect is incomplete ( it should just be a
> >> > warning
> >> >>> by the way .. not an error ).
> >> >>>
> >> >>> If your lifelines were typed by components requiring and providing
> >> >>> interfaces you would not get this warning. You can complete
your
> >> > model
> >> >>> by creating Interface realizations and Usages from the classifiers
> >> > typing
> >> >>> the lifeline's to a common interface. You might alternatively use
a
> >> >>> Composite structure diagram to complete your model.
> >> >>>
> >> >>> However, you could simply delete the connector and consider your
> >> > sequence
> >> >>> diagram to be a "sketch" as opposed to a completely specified
model.
> >> >>>
> >> >>> Regards,
> >> >>>
> >> >>> - James.
> >> >>>
> >> >>>
> >> >>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> >>> news:espboi$4b5$1@utils.eclipse.org...
> >> >>>> Hi James,
> >> >>>>
> >> >>>> Many thanks for this. I tried to do as you suggested and now I
have
> > an
> >> >>>> Interaction under the Opaque Behavior representing the effect of
my
> >> >>>> transition. However, the model doesn't validate and I get the
> > following
> >> >>>> error:
> >> >>>>
> >> >>>> Assembly connector '<Connector>' must only be defined from a role
> >> >>>> end
> >> >>>> requiring an interface to a role end providing that interface.
> >> >>>>
> >> >>>> The sequence diagram has two lifelines a:A and b:B and the message
> >> >>>> b.doSomething. As the problem occurs every time I create an
> > interaction
> >> >>>> between two associated classes, I think I might be developing the
> > model
> >> >>>> in a wrong way. On the other hand, the validation on the RSA
sample
> >> >>>> sequence diagrams gives the same results. Any ideas about that?
> >> >>>>
> >> >>>> Thanks again for your time
> >> >>>>
> >> >>>> Cheers
> >> >>>> Mirco
> >> >>>>
> >> >>>> James Bruck wrote:
> >> >>>>> ... From RSA it looks like when you create an effect you get an
> > opaque
> >> >>>>> behavior.
> >> >>>>> You can create your interaction with sequence diagram under that
> >> > opaque
> >> >>>>> behavior.
> >> >>>>> In general, you should be able to simply create an Interaction as
> > the
> >> >>>>> effect.
> >> >>>>>
> >> >>>>> - James.
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> >> >>>>> news:esnlr2$hhu$1@utils.eclipse.org...
> >> >>>>>> Hi Mirco,
> >> >>>>>>
> >> >>>>>> An effect is a Behavior. I would suggest creating an
> >> >>>>>> Interaction
> > (
> >> >>>>> which
> >> >>>>>> is a Behavior ) and specify a lifeline b:B that with a message
> > whose
> >> >>>>>> signature is "doSomething()". Set your effect to be that
> >> > Interaction.
> >> >>>>>> "An effect is just an optional behavior that is performed when
the
> >> >>>>>> transition fires"
> >> >>>>>>
> >> >>>>>> Regards,
> >> >>>>>>
> >> >>>>>> - James.
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
> >> >>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
> >> >>>>>>> Hi all,
> >> >>>>>>>
> >> >>>>>>> I have a UML2 model describing two classes A and B with an
> >> > association
> >> >>>>>>> which makes an instance of B be visible to A (A.b). A owns a
> >> >>>>>>> state
> >> >>>>>>> machine. I would like a transition in that state machine to
have
> > an
> >> >>>>> Effect
> >> >>>>>>> calling a method b.doSomething(). I've tried to accomplish this
> > both
> >> >>>>>>> programmatically and graphically by using RSA, with no luck.
> >> >>>>>>>
> >> >>>>>>> Could you point me to the correct UML2 API for creating such an
> >> >>> effect?
> >> >>>>>>> Thanks in advance for your help.
> >> >>>>>>>
> >> >>>>>>> Mirco
> >> >>>
> >> >
> >> >
> >
> >
>
>
Re: Transition Effects Calling Methods of Classes Visible to State Machine Owner [message #598468 is a reply to message #471637] Tue, 13 March 2007 14:43 Go to previous message
Eclipse User
Originally posted by: mtribast.inf.ed.ac.uk

Hi James,

Thank you very much for your precious help.

To recap, my valid model now has classes owning state machines which
describe their dynamic behavior. In order to model interaction between
the classes, they use and realize some interfaces. This lets me draw
valid sequence diagrams as effects of state machines' transitions.

I am now investigating a component-centric approach using ports and
composite structure diagrams, which I think is more expressive in the
context of the domain I am interested in. I might get back to you with
questions regarding that!

Thank you again.

Cheers
Mirco



James Bruck wrote:
> Hi Mirco,
>
> ... so I just confirmed that you should really be creating your statemachine
> in the context of some class and creating interface realizations to that
> context class....
>
>
> Regards,
>
> - James
>
>
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:est4pl$3o0$1@utils.eclipse.org...
>> ... two other points...
>>
>> You pointed out that a StateMachine is a Class and therefore doesn't have
> to
>> have any context. Although this is technically true, I'm not sure what it
>> really means to have a Behavior with no context. From the spec p. 447 "
>> Behavior is a specification of how its context classifier changes state
> over
>> time..." p448 shows the cardinality of context to be [0..1] suggesting it
> is
>> ok to be 0 but I question how practical that is. I believe that a
> behavior
>> is a class is a side effect of behaviors requiring attributes, operations
>> and other inherited attributes.
>>
>> Also, the constraint you were getting hung up on is described on p159
>> constraint [5] "An assembly connector must only be defined from a required
>> Interface or Ports to a provided Interface or Port". From what I
>> understand, there is an issue raised on OMG to relax some of the
> constraints
>> on connectors ( this one in particular) that would allow your model to
>> validate ( once adopted into the spec ).
>>
>> I'll follow up on that first point and get back to you with the intent of
>> "context".
>>
>> Regards,
>>
>> - James.
>>
>>
>>
>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>> news:esspcb$mea$2@utils.eclipse.org...
>>> Hi Mirco,
>>>
>>> I don't want to give you the impression that you 'have' to expose
>>> interfaces
>>> from your state machine. There are many different ways to complete
> your
>>> model. You might want to use ports etc.
>>>
>>> You might want to see some of the draft articles here
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 for some ideas on
>>> extending UML or restricting yourself to those language units you might
> be
>>> interested in.
>>>
>>> Composite structure diagram is your best bet to fine tune the
> interaction
>>> between parts/ports. Lifelines represent ConnectableElements ... parts
>>> and
>>> ports are connectable elements.
>>>
>>> ( By the way I hope you have RSA 7.x ... there are some nice
> enhancements
>>> in
>>> this version that try to hide some "nastiness" when creating required
> and
>>> provided interfaces :) ).
>>>
>>> Cheers,
>>>
>>> -James.
>>>
>>>
>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>> news:ess4ja$nkb$1@utils.eclipse.org...
>>>> Hi James,
>>>>
>>>> I'm sorry for having (ab)used this newsgroup for RSA-related isses.
>>>> Thank you for your patience in answering these questions.
>>>>
>>>> Well, I try to describe what I'm doing in a few lines. Basically I want
>>>> to apply UML to a formal language which ultimately lets me do
>>>> performance modeling of the system under study. I'd like to be able to
>>>> draw a model and get analysis results back after the model has been
>>>> evaluated using this formal language. So, RSA is the graphical tool and
>>>> I use the UML2 API to do the mapping, carry out performance analysis
> and
>>>> annotate the results in the UML model.
>>>>
>>>> UML is a lot bigger and far more complicated than the meta-model of the
>>>> formal language, so I am now working on figuring out what is the best
>>>> subset of the UML which lets me do that. I think there are different
>>>> ways and I want to analyze their pros and cons in order to focus on the
>>>> simplest and most intuitive one. The main constraint is that the model
>>>> drawn using RSA should validate OK.
>>>>
>>>> The main problem I've had so far is how to model interaction between
> two
>>>> state machines, i.e. an effect of a transition of a state machine
>>>> calling a method of another class visible to that state machine. This
>>>> discussion has been very helpful to give me insights into that. I'm not
>>>> entirely happy with the solution of state machines exposing interfaces
>>>> in order to have a valid sequence diagram which models their
> interaction.
>>>> I would very much appreciate a "semi-reasonable comment" ;-) on
> whether
>>>> you would suggest drawing a Composite structure diagram instead.
>>>>
>>>> Regards,
>>>> Mirco
>>>>
>>>> James Bruck wrote:
>>>>> Hi Mirco,
>>>>>
>>>>> I'll try not to turn this into a RSA forum but from what you
> describe,
>>> you
>>>>> should be able to draw that interface realization.
>>>>> I have made myself a little model that I think follows what you are
>>> doing
>>>>> and it seems to work.
>>>>>
>>>>> From what I understand your state machine does not have a context and
>>> you
>>>>> are having problems because you cannot visualize that statemachine as
> a
>>>>> class on a class diagram and then draw an interface realization.
> Try
>>>>> selecting your State Machine, then go to the Properties > Advanced.
>>> Now
>>>>> select the collections editor. Select Interface Realization and then
>>> browse
>>>>> to the interface you are interested in. ( There might be an easier
> way
>>> that
>>>>> I'm unaware of ). In general, you have access to all the
> opensource
>>>>> options via the advanced tab in RSA. More common properties are
> added
>>> to
>>>>> other tabs.
>>>>>
>>>>> If you could describe the ultimate problem you are trying to solve
>>>>> there
>>> is
>>>>> a slim chance I might be able to make semi-reasonable comments :)
>>>>>
>>>>> Regards,
>>>>>
>>>>> - James.
>>>>>
>>>>>
>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>> news:esrekf$n2$1@utils.eclipse.org...
>>>>>> Hi James,
>>>>>>
>>>>>> Thank you for your thorough and interesting reply. I completed my
>>>>>> model
>>>>>> by creating an interface exposing doSomething(). B realizes the
>>>>>> interface and A uses it. Now the model validates.
>>>>>>
>>>>>> I have one more question about the UML metamodel and its
> relationship
>>>>>> with RSA and the UML2 API. I actually realized that I could make the
>>>>>> model simpler by getting rid of the classes owning the state
> machines,
>>>>>> as a state machine is itself a class according to the UML2 API.
>>>>>> Therefore I now have two state machines for which I want to describe
>>> the
>>>>>> communication between each other. I drew a little class diagram
>>>>>> including the two state machines A and B as well as the common
>>> interface
>>>>>> as you suggested. I wanted to draw an interface realization line
>>> between
>>>>>> B and the interface but apparently I am not allowed to do so. My
>>>>>> question is: Am I doing something wrong or doesn't RSA support offer
>>>>>> this possibility?
>>>>>>
>>>>>> Thank you again
>>>>>>
>>>>>> Regards,
>>>>>> Mirco
>>>>>>
>>>>>> James Bruck wrote:
>>>>>>> Hi Mirco,
>>>>>>>
>>>>>>> RSA creates an assembly connector between the two lifelines
>>>>>>> indicating
>>>>> that
>>>>>>> there is some communication at runtime.
>>>>>>> RSA does this because they can automatically generate communication
>>>>> diagrams
>>>>>>> from the sequence diagram. Those communication diagrams require
> the
>>>>>>> specification of the connector to show that the two lifelines
>>>>>>> interact
>>>>> ( ie
>>>>>>> Message Pathways are Connectors ).
>>>>>>> You can understand this better by deleting automatically generated
>>>>> connector
>>>>>>> under the interaction, then select the interaction and create a
>>>>>>> communication diagram.
>>>>>>> Now, put the connector back and create a communication diagram by
>>>>> selecting
>>>>>>> the interaction and creating the diagram.
>>>>>>> In one case, the lifelines are connected, in the other, they are
>>>>> disjoint.
>>>>>>> The validation rule is complaining because of constraints around
>>>>> connectors
>>>>>>> requiring assembly connectors to be connected to "compatible"
>>>>> Connectable
>>>>>>> Elements. Your model in effect is incomplete ( it should just be a
>>>>> warning
>>>>>>> by the way .. not an error ).
>>>>>>>
>>>>>>> If your lifelines were typed by components requiring and providing
>>>>>>> interfaces you would not get this warning. You can complete
> your
>>>>> model
>>>>>>> by creating Interface realizations and Usages from the classifiers
>>>>> typing
>>>>>>> the lifeline's to a common interface. You might alternatively use
> a
>>>>>>> Composite structure diagram to complete your model.
>>>>>>>
>>>>>>> However, you could simply delete the connector and consider your
>>>>> sequence
>>>>>>> diagram to be a "sketch" as opposed to a completely specified
> model.
>>>>>>> Regards,
>>>>>>>
>>>>>>> - James.
>>>>>>>
>>>>>>>
>>>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>>>> news:espboi$4b5$1@utils.eclipse.org...
>>>>>>>> Hi James,
>>>>>>>>
>>>>>>>> Many thanks for this. I tried to do as you suggested and now I
> have
>>> an
>>>>>>>> Interaction under the Opaque Behavior representing the effect of
> my
>>>>>>>> transition. However, the model doesn't validate and I get the
>>> following
>>>>>>>> error:
>>>>>>>>
>>>>>>>> Assembly connector '<Connector>' must only be defined from a role
>>>>>>>> end
>>>>>>>> requiring an interface to a role end providing that interface.
>>>>>>>>
>>>>>>>> The sequence diagram has two lifelines a:A and b:B and the message
>>>>>>>> b.doSomething. As the problem occurs every time I create an
>>> interaction
>>>>>>>> between two associated classes, I think I might be developing the
>>> model
>>>>>>>> in a wrong way. On the other hand, the validation on the RSA
> sample
>>>>>>>> sequence diagrams gives the same results. Any ideas about that?
>>>>>>>>
>>>>>>>> Thanks again for your time
>>>>>>>>
>>>>>>>> Cheers
>>>>>>>> Mirco
>>>>>>>>
>>>>>>>> James Bruck wrote:
>>>>>>>>> ... From RSA it looks like when you create an effect you get an
>>> opaque
>>>>>>>>> behavior.
>>>>>>>>> You can create your interaction with sequence diagram under that
>>>>> opaque
>>>>>>>>> behavior.
>>>>>>>>> In general, you should be able to simply create an Interaction as
>>> the
>>>>>>>>> effect.
>>>>>>>>>
>>>>>>>>> - James.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>>>>>>>>> news:esnlr2$hhu$1@utils.eclipse.org...
>>>>>>>>>> Hi Mirco,
>>>>>>>>>>
>>>>>>>>>> An effect is a Behavior. I would suggest creating an
>>>>>>>>>> Interaction
>>> (
>>>>>>>>> which
>>>>>>>>>> is a Behavior ) and specify a lifeline b:B that with a message
>>> whose
>>>>>>>>>> signature is "doSomething()". Set your effect to be that
>>>>> Interaction.
>>>>>>>>>> "An effect is just an optional behavior that is performed when
> the
>>>>>>>>>> transition fires"
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> - James.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> "Mirco Tribastone" <mtribast@inf.ed.ac.uk> wrote in message
>>>>>>>>>> news:esmkn1$9r0$1@utils.eclipse.org...
>>>>>>>>>>> Hi all,
>>>>>>>>>>>
>>>>>>>>>>> I have a UML2 model describing two classes A and B with an
>>>>> association
>>>>>>>>>>> which makes an instance of B be visible to A (A.b). A owns a
>>>>>>>>>>> state
>>>>>>>>>>> machine. I would like a transition in that state machine to
> have
>>> an
>>>>>>>>> Effect
>>>>>>>>>>> calling a method b.doSomething(). I've tried to accomplish this
>>> both
>>>>>>>>>>> programmatically and graphically by using RSA, with no luck.
>>>>>>>>>>>
>>>>>>>>>>> Could you point me to the correct UML2 API for creating such an
>>>>>>> effect?
>>>>>>>>>>> Thanks in advance for your help.
>>>>>>>>>>>
>>>>>>>>>>> Mirco
>>>>>
>>>
>>
>
>
Previous Topic:[Announce] MDT UML2 2.1.0 is available
Next Topic:Extending Association with Profile
Goto Forum:
  


Current Time: Fri Oct 24 13:04:12 GMT 2014

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

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