On this page

According to the UML specification, a message defines a particular communication between lifelines of an Interaction. Cameo Simulation Toolkit simulates messages whose message sorts are asynchSignalsynchCallasynchCall, and reply. You can specify a connector for the message. If the role of one connector end is the property specified by a source object of the message, Cameo Simulation Toolkit will send the message along the connector. A target object will be the object at the other end of the connector. 

Asynchronous Signal Message (asynchSignal) 

Cameo Simulation Toolkit simulates an asynchronous signal message by creating a signal object from a signal specified as a signature of the message. It sends the signal object to a target object asynchronously. The following figure shows that the bank sent the signal maintain to the teller using an asynchronous signal message. When the target object (the ATM object specifying the teller) received the signal, the State changed to Maintained

Executing An Asynchronous Signal Message to Send a Signal
Simulation console showing the simulation of an asynchronous signal message.

Synchronous Call Message (synchCall)

When executing a synchronous call message, Cameo Simulation Toolkit simulates a Behavior (the method of called operation of a target object) from beginning to end before it can carry out the next message. The simulation method is similar to that of the call operation Action with "isSynchronous = true". 

You can substitute values for input parameters of the called operation by specifying argument values on a synchronous call message. 

A Simulation of Synchronous Call and Reply Messages
Simulation console showing the execution of an asynchronous call message.

The preceding figure illustrates the synchronous call messages simulation. A synchronous call message 1 shows the bank object calling the operation retrieveAccount(accountNumber : String) of the ledger object. The substitution value for accountNumber is the value of lookupAccountNumber, which is 0003 in this example. lookupAccountNumber is the property of the bank. 

The simulation looked for the account object with that particular accountNumber and returned it to the bank object with a reply message 2 (2 is a reply message of 1). The returned account object would be specified as the value of the buyerAccount represented by the lifeline buyerAccount:Account. The bank object would then call the operation getBalance() of the account object with a synchronous call message that caused the balance value to reply to the bank with a reply message 4 (4 is a reply message of 3). Finally, the bank called itself to print the balance value with the operation printBalance(balance:Real)

Asynchronous Call Message (asynchCall) 

The simulation of an asynchronous call message is similar to that of a synchronous call message. In this simulation, Cameo Simulation Toolkit simulates a Behavior (a method of a called operation of a target object) on a new thread. Cameo Simulation Toolkit will immediately proceed to the next message once the simulation of the Behavior starts. It will not wait until the simulation of the Behavior completes. This type of simulation is similar to that of a call operation Action with "isSynchronous = false". 

Reply Message (reply) 

A reply message is a message sent as a reply to a call message (synchronous or asynchronous). If the argument of a reply message meets the following criteria:

  • it is an OpaqueEpression with the element name, a LiteralString with the element name, or an ElementValue, and
  • this element (an OpaqueExpression, a LiteralString, or an ElementValue) is the StructuralFeature of a represented lifeline or the parameter of an executed Interaction,

then the result of the called operation is set as the runtime value of that StructuralFeature or parameter.

If such an element is not found or the argument of a reply message does not meet the above criteria, the argument is compared against the actual return value of the called operation in order to validate the result.

Important

  • Constraint evaluation will compare an actual result value to the value specified in the Reply Message. It may fail with a warning message on the Console pane if the constraint is not satisfied.
  • The execution can stop at breakpoints by setting the Constraint Failure As Breakpoint option to true in the Specification window of «SimulationConfig».

buyerAccount is the property of the Balance Lookup Class which is the context of a sequence diagram. Therefore, the returned account object from the operation of the ledger object retrieveAccount(accountNumber : String) will be set as a value of the property buyerAccount when the reply message 2 is simulated.