Papyrus Banner

Introduction

Since Papyrus 3.0 (Eclipse Oxygen), Papyrus provides the Expressions Framework. This framework provides one basis interface IExpression<CONTEXT_TYPE, RETURN_TYPE>. This interface provides the method evaluate(CONTEXT_TYPE):RETURN_TYPE. This framework has been developed to be hightly extensible. Please read the expression developer documentation to go further.

Why this framework?

The Expressions have initially been developed for Papyrus Matrices Table. Developing the matrices, we need to provide a way to the user to easily filter the rows and the columns to show. That's the reason for which the first expressions available in Papyrus are the boolean expressions.

General Presentation

Nowadays (Papyrus 3.0), for the users, the expressions are only used in the context of the Papyrus Matrices Table. Throw the Matrix Property View, the user can create its own expressions to use them as filter. It is also possible for him to reference existing expressions provides by Papyrus.

ExpressionCatalog

An ExpressionCatalog owns IExpression<?,?>. It allows to provide predefined expressions to the user.

Existing IExpression<EObject,Boolean>

For these expressions, the evaluate method takes as argument an EObject and returns a Boolean, so true or false. If you don't know what is an EObject, it is not matter. It is a detail of the implementation of UML in Eclipse. The only thing to know for Papyrus user, it that all UML Elements are EObject.

Here, we present you the generic boolean expressions provided by Papyrus:

After defining these main objects required to write boolean expression, we provided some expressions dedicated to UML: