Skip to main content
Version: 5.x

BEFORE statement

The BEFORE statement calls an action before calling another action.


BEFORE action(param1, ..., paramN) DO aspectAction;


The BEFORE statement defines an action (let's call it an aspect) that will be called before the specified one.


  • action

    The ID of the action before which the aspect will be called.

  • param1, ..., paramN

    List of action parameter names. Each name is defined by a simple ID. These parameters can be accessed while defining an aspect.

  • aspectAction

    A context-dependent action operator describing the aspect.


changeName(Sku s, STRING[100] name)  { name(s) <- name; }

// The message will be shown before each call to changeName
BEFORE changeName(Sku s, STRING[100] name) DO MESSAGE 'Changing user name';