Navigate with AQL

Use this tutorial to practice the Acceleo Query Language (AQL) that powers labels, styles, filters, and tooling in Sirius Web.

1. Prerequisites

  • A studio project with at least one domain and view defined.

  • A sandbox project where you can open the representations and observe the effect of expressions.

  • Familiarity with basic AQL syntax (attribute access, self, simple filters).

2. Steps

  1. Review the evaluation context

    1. Open the Query view and select an element in your representation.

    2. Evaluate simple expressions such as self.name, self.eClass().name, and self.eContents()→size() to ensure you understand the current context.

    3. Note that self changes when you run expressions inside descriptions, styles, or tools, so always confirm it before writing complex logic.

  2. Add expressions to styles

    1. Pick a description and edit its label expression to use AQL (for example aql:self.name.concat(' (', self.status, ')')).

    2. Configure conditional styles that switch colors or icons based on properties (aql:self.isCritical).

    3. Refresh the representation to observe the result and iterate until the behavior matches your expectations.

  3. Use AQL in other widgets

    1. Add expressions to table columns or form widgets to display computed values (counts, derived booleans, formatted strings).

    2. When needed, combine filters (select(e | e.status = 'Open')) or aggregations (size()).

  4. Validate complex queries

    1. Whenever you are unsure of the evaluation context, switch back to the Query view and paste the expression there first.

    2. Fix errors such as “unresolved feature” or type incompatibilities before applying the expression to the representation.

3. Tips

  • Keep expressions small and composable; if they become unwieldy, refactor them into Java services.

  • Use string helpers such as toUpper, toLower, substring, and concat to format labels consistently.