run <ProtocolName> "(" <param> ( "," <param> )* ")" at <Role>;
Protocols can be defined in a modular way, with one protocol
being able to compose another using the run construct.
The run construct composes another protocol in
a synchronous manner. This means that the composed protocol will
complete before any subsequent activity in the composing protocol
can proceed.
There are two ways in which another protocol can be composed. These are:
Nested
The nested variation defines the sub-protocol as an inner part of the
composing protocol - in a similar way to an inner class in Java.
External
The external variation defines the sub-protocol in a separate
protocol definition, which is then referenced within the
composing protocol.
The syntax for the nested and external run construct is:
run <ProtocolName> "(" <param> ( "," <param> )* ")" at <Role>;
An example of the nested variation, using the run, is:
run PlaceOrder(Client, Supplier) at Client; .... protocol PlaceOrder(role Buyer, role Seller) { .... }
The external variation is similar to the nested variation above, except
that the composed protocol definition (i.e. PlaceOrder in this case), would
be stored in a separate definition.