...
The following attributes must be set in a <condition> element definition:
Attribute | Usage |
---|---|
| The type of the condition. For built-in types, this is the lowercase portion of the condition class name without condition appended (variable,packselection,java, ...). Custom condition types should be referenced by the full qualified class name, e.g. de.dr.rules.MyCoolCondition. |
| The id of the condition. This will be used to refer to this conditions in other elements |
<condition> - Nested Elements
...
From IzPack 3.11 on, you don't have to define compound conditions because you can use a simple expression language. The language supports the following operators:
+ | an operator for the And Condition |
| an operator for the Or Condition |
| an operator for the Xor Condition |
| an operator for the Not Condition |
These simple expressions DO NOT follow the usual boolean logic with precedence rules. Instead, they are evaluated left to right in a simple way.
...
Code Block |
---|
!(conditionA && (conditionB && !(conditionC))) |
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
<dynamicvariables> <variable name="db.instance" value="MSSQLSERVER" checkonce="true" condition="useMssql+mssqlInstanceSelected+!haveDatabaseURL" /> </dynamicvariables> |
Anchor | ||||
---|---|---|---|---|
|
Beginning with IzPack 5.0, there is also the possibility to use a more complex expression language which evaluates based on boolean precedence rules, which is also reflected in the following table. The higher an operator is, the higher is its precedence.
^ | an operator for the Xor Conditon |
| an operator for the And Condition |
| an operator for the Or Condition |
| an operator for the Not Condition |
Example:
Code Block |
---|
@!conditionA&&conditionB&&!conditionC |
...
In order to use the complex expression language the expression must start with a '@
' character.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
<dynamicvariables> <variable name="db.instance" value="MSSQLSERVER" checkonce="true" condition="@useMssql && !haveDatabaseURL && mssqlInstanceSelected" /> </dynamicvariables> |