[izpack-users] nested conditions in conditions.xml

Dennis Reil Dennis.Reil at reddot.de
Fri Jan 19 14:17:31 CET 2007


> I wanted to specify nested condition in conditions.xml 
> I.e I wanted to copy packs if my both  conditions specified in
> conditions.xml are true. 
> 
> My xml tags are  ........ 
> 
> ..............................condition1........................................................ 
> <condition type="variable" id="client_select_var"> 
>                         <name>client</name> 
>                         <value>clientselected</value> 
> </condition>  
> ..................................condition2.................................................................... 
> <condition type="variable" id="struts_selected"> 
>                         <name>install_type</name> 
>                         <value>Struts</value> 
> </condition> 
> 
> 
> I wanted to copy below pack if  both condition 1and 2 are
> true(client=clientselected and install_type=Struts) 


Just use the and and ref condition ;-)

<condition type="and" id="clientandstruts">
   <condition type="ref" refid="client_select_var"/>
   <condition type="ref" refid="struts_selected" />
</condition>


Btw, there are also Not, Or, Xor conditions. 
For most cases, the already implemented conditions should be enough, but
if there is a condition type, which is not available at the moment, you
can implement one by deriving the abstract base class
com.izforge.izpack.rules.Condition
Your new condition should be in the same package. At the moment it has
to be named <Yourname>Condition.java and the only the first character of
<Yourname> has to be capital. The new condition could then be referenced
like:

<condition type="<Yourname>" id="">
...
</condition>

Regards,
   Dennis



More information about the izpack-users mailing list