Evaluation context

An evaluation context is represented by the interface EvaluationContext. It provides services that help to build model transformators or generators. It is especially useful if you intend to write Java code that interfaces with MDWorkbench. It enables you to call text templates and rules from Java code.

An instance of EvaluationContext is always available in MQL and TGL code, as well as in Java scripts, through the context variable.

Examples (MQL syntax)

// Evaluates a text template
context.generate("com.mycompany.example.GenerateJava", [arg1, arg2]) 

// Cancels the evaluation process
context.cancelEvaluation() 

// Logs a warnings
context.logger.warning("A warning"); 

// Creates an empty UML 2.1 model
context.createModel("uml21")