Extension conditions are used to determine if an extension should be used or not. Many of the Extension Types support conditions, but not all of them.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
All given conditions for an extension must be valid for an extension to be utilized.
In the following example we define the manifest for a Workspace Action, this action will only be available in the workspace with the alias My.Example.Workspace
.
The conditions are defined as an array of conditions. Each condition is an object with the following properties:
alias
- The alias of the condition to utilize.
...
- The rest of the properties of the object are specific to the condition.
In the above example the Umb.Condition.SectionAlias
condition is used, this condition takes a property match
which must be set to the alias of the section to match.
The following conditions are available out of the box, for all extension types that support conditions.
Umb.Condition.SectionAlias
- Checks if the current section alias matches the one specified.
Umb.Condition.WorkspaceAlias
- Checks if the current workspace alias matches the one specified.
You can make your own conditions by creating a class that implements the UmbExtensionCondition
interface.
This has to be registered in the extension registry like shown below:
Finally, you can make use of the condition in your configuration. See an example of this below:
As can be seen in the code above, we never make use of match
. We can do this by replacing the timeout with some other check.
With all that in place, the configuration can look like shown below: