Next: , Previous: , Up: Individual Armour cases   [Contents]


7.3.8 ArmourOENABP (OutEventNotAllowedByPort)

The required interface is not allowed to send an out-event but may still do that. The system diagram shows the armour at the requires port of the Dezyne component:

ArmourOENABP

We only deal with one void in-event and one void out-event. The Strict interface specifies that an in-event must not lead to any out-event.

interface IStrict
{
  in void ia();
  out void oa(); // nb not part of completeness check

  behaviour
  {
    on ia: {}
  }
}

The Robust interface allows optional out-events.

interface IRobust
{
  in void ia();
  out void oa();

  behaviour
  {
    on ia: {}
    on optional: oa;
  }
}

In the armour an in-event at the provides port is passed to the requires port. If an out-event is received from the requires port it is logged as an error and suppressed.

component ArmourOENABP // IStrict to IRobust
{
  provides IStrict pStrict;
  requires IRobust rRobust;
  requires injected ILogger iLog;

  behaviour {
    on pStrict.ia(): rRobust.ia();
    on rRobust.oa(): {iLog.Log($"Out-event oa is not allowed by port"$);} // armour potential oa
  }
}

The full armour example code including the client and overall system component is here:

Basic example: ArmourOENABP
Example with error handling: ArmourOENABPError