stop

Syntax

stop cause;

where:

Description

The stop statement aborts the evaluation process. This is something like an emergency brake: don't use it in normal situations. Aborting happens by throwing a com.sodius.core.mdw.eval.EvaluationException, and this exception will hold the value of cause parameter.

Examples

This aborts the evaluation if the model parameter does not contain any instance:

package com.mycompany.example;

public ruleset Transform(in model : uml21) {

    public rule main() {
        if (model.instances.isEmpty()) {
            stop "Wow! The model is not supposed to be empty here !";
        }
        ...
    }
}