2. The OCL pre-condition is expressed either as conditions in this transition or as
appropriate instantiations in the label of the input arc from the state place. If other
messages are required in the pre-conditions, input
3. The OCL post-condition part clause is modeled as an appropriate inscription terms
of an output arc that goes to the object place.
4. Finally the calling clause is captured by associating output arcs labelled by the
corresponding called messages and destinated to their associated (message) places.
In the same spirit, for communicating different templates, external event behaviour
is captured by transitions that make into relation only external attributes part and im-
ported / exported events. We survey all these translating steps in the table below.
UML Concepts Mapping to the CO-NETS concepts
Attributes Object state as term with addition of the identity
—constant As constant in the corresponding (algebraic) structure
—restricted, initialized conditions in creation/deletion net
state change in SM additional attributes called State
events messages with explicit identity of the invoked object
— OCL pre- Transition condition
— OCL post- Transition (output) effect
Example 1. By applying the above translating ideas to our running example, we result
in two CO-NETS components reflecting respectively the behaviour associated with HTS
and Machine CO-NETS template signatures (i.e. the HTS and the Machine). Moreover
and because the interaction between these two components have to be achieved only
through their explicit interfaces a further ’communicating’ CO-NET is to be conceived
for capturing their interaction.
For instance, by respecting the aforementioned translating steps, the CO-NET as-
sociated with the HTS template is depicted in figure 3. In this net, besides the state
place OBJ
HTS that contains all HTS state instances, with each message generator
a corresponding place is associated. Places reflecting imported / exported messages
are represented in bold. For the Job component declared as a subcomponent (in the
HTS TROLL text), we have just represented the places of imported messages namely
RCV
ApvD, RCV ApvO, ADD JOB and the exported attributes Type of job (i.e. OFFER
or DEMAND). Each transition reflect the effect of messages on the just concerned state
parts. The transition RCV
JOB, where the message Receive J(J,M,H) (with J, M, H de-
notes respectively job identity, machine identity and HTS identity) enters into with state
part hH|StateH : Ready, J ob : Jb, P artner Rq : Ri. This means that according to the
HTS state diagram, the HTS state of H should be Ready and their is some (list of) jobs
Jb. The effect of such contact depending on whether a partner is requested or not (i.e.
the variable R is true or not) is as follows. In the first case (i.e. Partner
Rq = True) the
invoked part of HTS object state is modified to hH|StateH : Calculated, Job : J b :
J, P artner
Rq : Ri with a simultaneous sending of the messages Request P(J,H,M),
Add Job (to the job subcomponent) and Calc Offer(J,H). In the second case, the HTS
object part of state is modified to hH|StateH : Contact
J, Job : Jb : J, P artner Rq : Ri
with a simultaneous sending of the messages Add Job and Calc Offer(J,H).
70