Next: Component with behavior must define a provides port, Previous: out
-event must be void
, Up: Well-formedness – Top level [Contents][Index]
Any component with a behavior
specification is supposed to be
’reactive’. This implies that it should have at least one
provides
interface with an in
-event, or at least one
requires
Interface with an out
-event. Such an event acts
as a trigger
for the component to react on. So-called “active”
components are not supported.
An example:
interface iworld { out void world (); behavior {on optional:world;} } component component_provides_without_trigger { provides iworld p; behavior {} }
This results in the following error message:
component-provides-without-trigger.dzn:7:1: error: component with behavior must have a trigger
Another example:
interface ihello { in void hello (); behavior {on hello:{}} } component component_requires_without_trigger { requires ihello r; behavior {} }
This results in the following error messages:
component-requires-without-trigger.dzn:7:1: error: component with behavior must define a provides port component-requires-without-trigger.dzn:7:1: error: component with behavior must have a trigger