Skip to content

Filtering Impacted Elements / Impacted Diagrams and the Tree Browser

General

LemonTree provides the possibility to filter and sort the Impacted Elements / Impacted Diagrams List and the Tree Browser. The diagrams in the Diagram Viewer are not filtered. The representation of the diagram is not changed by LemonTree, except for an overlay which highlights the kind of changes (added, modified, removed, etc.).
A filter expression can be built from logical expressions and can be saved for later use. A suggestion list provides keywords and predefined filters.

Basically, a filter is used to reduce the Impacted Elements / Impacted Diagrams List and the Tree Browser to a specfic set of elements or diagrams. Every element or diagram which matches a given filter expression is shown. If an element or diagram is not matched by the filter but is required for (hierarchical) visualization, the element or diagram is grayed out but visible.

In the filter text box the following keys can be used:

  • Arrow down, Arrow up to navigate in the dropdown list
  • Tab to select the highlighted element
  • Enter to apply the filter query

It is also possible to select the suggested keywords via click from the dropdown list.

Fallback search

If LemonTree is unable to parse the query, a fallback search is executed (on "Enter"). That means LemonTree searches the entered string in the elements properties (like Name, UmlType, ChangedType, ...).

Filter Keywords

The following keywords are used to build filter expressions:

Keyword Description Example Result Remarks
Author Filter by the Author of an element Author: "Mr. LemonTree" Shows all elements where the author contains "Mr. LemonTree"
ChangeType Filter by Change Types ChangeType: Removed Shows all removed elements
Name Filter by the name of an element Name: Configure Shows all elements where the name contains "Configure"
Sort By Sort elements by a specific property ChangeType: Removed SORT BY UmlType Shows all removed elements sorted by the UML Type
Stereotype Filter by stereotype Stereotype: Block Shows all elements with the stereotype "Block"
UmlType Filter by UML Type UmlType: Activity Shows all Activites
GUID Filter by GUID Guid: {FB95A4B4-66F5-4e21-B8E0-22ADEE0BB15F}  Shows the element with the given GUID New in LemonTree 2.1.4
ChangeIn Filter for modifications in specific properties and tagged values ChangeIn: Code Shows elements where the property "Code" has been modified New in LemonTree 2.1.4
AnyChange Matches every change in elements AnyChange All elements which have at least one change which would be matched by the corresponding ChangeIn: X query
Logical Operands, Sorted by Descending Precedence
NOT Used for negating a logical expression NOT ChangeType: Removed Shows all elements which were not removed
AND Used for combining two logical expressions where both have to be true ChangeType: Removed AND UmlType: Activity Shows all removed Activities
OR Used for combining two logical expressions where only one of them has to be true ChangeType: New OR ChangeType: Removed Shows all elements which are either new or removed
IGNORE Used to ignore certain changes while not hiding elements with such changes altogether ANYCHANGE IGNORING ChangeIn: DefaultValue Shows all elements which have at least one change in a property other than DefaultValue New in LemonTree 2.1.4

Filtering specific diff version

For Change Types it is also possible to apply the filter to a specific version of the diff (A = left model, B = right model). To use this, simply add the letter of the version to the ChangeType.

For example:
ChangeType: RemovedA → This shows the elements which are removed in model A.

Predefined Filters

Some filters are predefined, which can be used as shortcuts. The following predefined filters are available:

Predefined Filter Shortcut for Example Result
#New ChangeType: New #New Shows all new elements
#ChildModified ChangeType: ChildModified #ChildModified Shows all elements where at least one child element has been modified (even if the element itself was not changed)
#Conflicted ChangeType: Conflicted #Conflicted AND NOT UmlType: Class Shows all conflicted elements which are not a class
#Modified ChangeType: Modified #Modified SORT BY Name Shows all modified elements sorted by name
#Moved ChangeType: Moved #Moved AND NOT Stereotype: "Block" Shows all elements which were moved and do not have the stereotype "Block"
#Removed ChangeType: Removed #Removed AND Author: "LieberLieber" Shows all removed elements which were created by the author "LieberLieber"
#Reviewed - NOT #Reviewed Shows all elements which were not marked as reviewed
#Unmodified ChangeType: Unmodified #Unmodified Shows all elements with the ChangeType "Unmodified"

Filter Flags

Filter flags are used to apply additional settings for the filtering mechanism. They are marked with "$" and are also provided in the suggestion list. A flag can be added at the end of a filter expression and it can not be combined using logical operands.

Filter Flag Description Example Result
$HideGraphicalChanges This flag hides changes that are only graphical.
A graphical change is a change where only the Diagram Representation of the element has changed, but not the element itself.
#Modified
$HideGraphicalChanges
Shows all modified elements where only the element has been changed (and not its related Diagram Representation)
$OnlyMatchingChildElements Per default, child elements which do not match a given filter expression are only grayed out. To let them completely disappear this filter flag is required. #New and UmlType: Class
$OnlyMatchingChildElements
Shows all new classes and hides the elements which are not directly matched by the filter

Difference to Predefined Filters and Keywords

  • Filter flags cannot be combined using logical operands.
  • Filter flags always apply to the whole filter.
  • Filter flags have to be placed at the end.

Filtering of Diagram Representations

A filter expression is always applied to the Diagram Representation in combination with the element.
For example, the note element "double click to open diagram of the called activity" was not modified, but its Diagram Representation was.

Conflicted

Both the Element and its Diagram Representation are displayed if the filter matches either one of these.

Managing Filters

When clicking on the filter symbol Funnel Symbol a dropdown is opened where you can save the current filter and select saved filters.

Save Filter

With theSave Symbolbutton you can save the current filter and define a name for it:
Define Filter Name

To edit the name of a filter, select the Pen Symbol icon.
To delete a filter, select the Trashcan Symbolicon.

Private and Public Filters

You can define, edit and delete private filters.

Public filters are defined in a CSV file which can be placed f.e. on a network share. The path to this shared filter definition is configured in the directory %AppData%\LieberLieber\LemonTree\Configuration.xml:

<?xml version="1.0" encoding="utf-8"?>
<UserConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi:"http://www.w3.org/2001/XMLSchema-instance">
  <PublicFiltersCsvFilePath>C:\\Users\\Username\\Roaming\\LieberLieber\\LemonTree\\Filters\\PublicFiltersDemo.csv</PublicFiltersCsvFilePath>
</UserConfiguration>

LemonTree creates an example filter file called PublicFiltersDemo.csv in the directory %AppData%\LieberLieber\LemonTree\Filters\.

This demo file can be used as a template for creating a public filter definition.

Structure of the filter definition

"Impacted Elements" and "Impacted Diagrams" are the headers which then contain a number of filters that are available for the Impacted Elements or Impacted Diagrams list.

The name is displayed in the filter box, the query is placed in the textbox and executed when clicked on the filters name.

Impacted Elements

%Name%;%Query%
%Name%;%Query%

Impacted Diagrams

%Name%;%Query%
%Name%;%Query%

The example file is automatically created at startup if it does not exist.

LemonTree reads the public filter file on startup. Modifications to this file take effect only after restarting LemonTree.

How to use filters in LemonTree

In this basic example we want to find all elements containing "Display" in the name and sort it by name.

  1. We type "Na" - LemonTree suggests the keyword "Name:"
    Na

  2. The "Tab" key selects "Name: "

  3. When typing "Disp" LemonTree suggests elements that contain the string
    Disp

  4. We can select a suggested element, but we want all elements which contain "Display" so we type "Display" and "Space". LemonTree suggests other keywords.
    Space

  5. We navigate via "Arrow down" to "SORT BY" and press "Tab" to select it. (Alternatively, you can also click the suggestion list entry)

  6. LemonTree suggests the possible keywords for sorting. We select "Name" via "Tab" and hit "Enter" or click the Search Symol button to execute the search.
  7. Result
    Result

Note: Also the grouping element "MainState" and "Signals" are shown (grayed out) because they have at least one child element with "Display" in its name.

Advanced Examples

Show all diagrams with elements that are directly changed (not only ChildModified)

  1. Before using a filter:
    Before Filter

  2. The filter NOT #ChildModified is applied.
    Filter Applied
    The Activity "main" is no longer matched by the filter. Since its grouping element is matching the filter, it is still displayed but grayed out.

  3. The term "AND NOT #Unmodified" is added to exclude unmodified elements, in this case the diagram "Main" but also the Diagram Representation of the activity "main".
    Unmodified

Final filter: NOT #ChildModified AND NOT #Unmodified

Hide elements which were already reviewed

  1. Before the filter:
    already reviewed

  2. Enter the filter "NOT #Reviewed".
    Not reviewed
    The child element of the CallOperation "WriteLL" is grayed out, because it was already reviewed.

  3. If you want to reduce the list to elements which were not reviewed, the flag $OnlyMatchingChildElements can be added.
    Only Matching
    The reviewed connector is now hidden.

Final filter: NOT #Reviewed $OnlyMatchingChildElements 

Hide elements where only the DiagramRepresentation was modified

  1. The filter #Modified is already set:
    Modified

  2. However, there are elements which are only modified in their Diagram Representation.
    To hide them, add the flag $HideGraphicalChanges at the end of the filter expression.
    Hide Graphical Changes
    The elements with only graphical modifications are now hidden.

Final filter: #Modified $OnlyMatchingChildElements $HideGraphicalChanges 

Ignore certain changes

Sometimes you may want to ignore certain changes from elements, but not exclude these elements altogether. In this case, you can use the IGNORING operator.

  1. Let us assume that you want to ignore changes in Documentation but examine all other changes to elements. You filter by ChangeIn: Documentation and get these elements respectively their sub-elements:
    ChangeIn
    Worthy of note is the fact that SYSTICKS_PER_SECOND has changes in Documentation as well as DefaultValue.
  2. Applying the filter "NOT ChangeIn: Documentation" hides the property SYSTICKS_PER_SECOND even though it has changes in DefaultValue which you want to examine:
    Not ChangeIn

  3. To ignore all changes to Documentation, but still include elements if they have any other changes, you can use the ANYCHANGE keyword combined with the IGNORING operator:
    Ignoring

Final filter: ANYCHANGE IGNORING ChangeIn: Documentation

IGNORE lets you trim down your result set to focus on the changes you really want to see. To do this, combine IGNORE with arbitrary ChangeIn queries. If you have more than one term in IGNORE, make sure to encapsulate the query-to-be-ignored in parentheses, such as IGNORE (ChangeIn: Documentation OR ChangeIn: DefaultValue), as otherwise the query will be parsed as (IGNORE ChangeIn: Documentation) OR ChangeIn: DefaultValue

Advanced Combinations

When ignoring multiple property changes, be sure to use the correct operator to combine them:

  • Ignore changes in either Documentation, DefaultValue or both IGNORE (ChangeIn: Documentation OR ChangeIn: DefaultValue)
  • Ignore changes in Documentation and DefaultValue (i.e. only ignore the changes if both of the properties have changed) IGNORE (ChangeIn: Documentation AND ChangeIn: DefaultValue)
  • Ignore changes in Documentation or DefaultValue, but not if the element has changes in both IGNORE ((ChangeIn: Documentation OR ChangeIn: DefaultValue) AND NOT (ChangeIn: Documentation AND ChangeIn: DefaultValue))

The difference between AND and OR may not seem intutive at first because in english you would probably use AND when you want to ignore a set of changes, and never use OR when talking about ignoring things. However, this would reduce expressiveness of the filter and also introduce inconsistencies when re-using part of the query in a non-ignore context, so we think this compromise is worth it. Should you disagree with this, please contact support and we will find a solution!

If you are only interested in elements with changes in certain properties while at the same time ignoring other properties, but do not want new/removed/moved elements to be part of the result, you can exclude these like so:
NOT #NEW AND NOT #REMOVED AND NOT #MOVED AND IGNORE ChangeIn: Name