Menu

Restrictions Multiple Provides

For a component with a behaviour and with multiple provides ports, two restrictions hold. These restrictions relate to the fact that activity cannot be forked. These are the restrictions:

Within the handling of an in-event of a provides port, it is not allowed to post an out-event on another provides port.

Within the handling of an out-event of a requires port, it is not allowed to post an out-event to more than one provides port.

The violation of any of these restrictions will be reported as a compliance error.

These are examples of the two types of violations:

interface Intf
{
    in void e();
    out void c();

    behaviour
    {
        on e: {}
        on optional: c;
    }
}

component ViolationType1
{
    provides Intf p0;
    provides Intf p1;

    behaviour
    {
        on p0.e(): p1.c(); // compliance error: p1.c not allowed by port p1
        on p1.e(): {}
    }
}

component ViolationType2
{
    provides Intf p0;
    provides Intf p1;
    requires Intf r;

    behaviour
    {
        on p0.e(), p1.e(): {}
        on r.c(): { p0.c(); p1.c(); } // compliance error: p1.c not allowed by port p1
    }
}

See also:

The example project MultipleProvides.

Enjoy this article? Don't forget to share.