Skip to end of metadata
Go to start of metadata

The BEFORE instruction calls an action before calling another action. 

Syntax

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

Description

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

Parameters

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.

Examples

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

  • No labels