Information Technology Reference
In-Depth Information
interaction protocol. So although this interaction is not visible in the original
protocol diagram, any number of cascading protocol executions can result from
the execution of a specific interaction protocol. To restrict sending of concurrent
messages to the start message flow of an interaction protocol is therefore actually
not a real restriction but enforces structure that reduces complexity.
The interaction protocol describes the interaction among the actors (i.e. the
agents that perform the roles that are bound to the actors) from a centralized
point of view.
To actually describe the model to model transformations from interaction
protocols to local behaviors for individual agents we use operational QVT 8 .
helper pim4agents::interaction::Actor::collectMsfs () :
Set(pim4agents::interaction::MessageFlow) {
var res : Set(pim4agents::interaction::MessageFlow);
res := self.activeState;
self.subactor->forEach(a) {
res := res->union(a.collectMsfs());
};
return res
}
Fig. 12. Helper of a QVT Transformation
Operational QVT offers two types of procedural concepts. The first straight
forward concept are helpers. Helpers are very similar to methods of an object
oriented language. The helper can be typed and in this case it basically extends
the signature of the concept that is defined in the metamodel and allows compu-
tations that are useful for handling this concept. The definition of the helper also
shows how the concepts in the PIM4Agents metamodel are addressed: first the
metamodel is named, then the package in the metamodel, and last the concept.
In the body of the helper OCL expressions can be used which allow to express
complex computations in a compact manner. The helper in Figure 12 collects
all message flows that are included in an actor in a given interaction protocol.
mapping PIM4Agents::interaction::Actor::toDomainRole () :
PIM4Agents::role::DomainRole {
var msf : Set(pim4agents::interaction::MessageFlow) :=
self.collectMsfs();
var rmsf : Set(pim4agents::interaction::MessageFlow) :=
msf -> select(d|d.isInitialMessageFlow or
((d.forkOperator <> null) and (d.MsfSuccessors(msf)->size() > 0)));
name := 'Role' + self.name;
providesCapability := rmsf.map toCapability(msf,rmsf);
}
Fig. 13. QVT Mapping Rule, Creation of a Domain Role from an Actor of a Protocol
8 Query view transformation.
 
Search WWH ::




Custom Search