using OR operator

Help
venki
2008-01-08
2012-12-13
  • venki
    venki
    2008-01-08

    Hi,

    As per the documentation all if conditions are connected by AND operator. Can you let me know how can apply OR operator.

    Can I use "||" for OR operator?

    example:

    <if leftterm="x" op="=" rightterm="1" op="||" leftterm="x" op="=" rightterm="2" />
    <then method="example1.Invoice.setStatus" arg1="paid" />

     
    • mcarniel
      mcarniel
      2008-03-12

      Hi!

      sorry if I respond you so late, but I never received the email notification about this issue.
      Well, to apply an or condition you have to write two rules like these:

      <rule ...
        <if leftterm="x" op="=" rightterm="1" />
        <then method="example1.Invoice.setStatus" arg1="paid" />
      </rule>
      <rule ...
        <if leftterm="x" op="=" rightterm="2" />
        <then method="example1.Invoice.setStatus" arg1="paid" />
      </rule>