The use of "Otherwise" is not supported in XLS at the moment.

There is an open JIRA to address this: https://issues.jboss.org/browse/GUVNOR-1278

With kind regards,

Mike

On 15 August 2012 21:16, dme1 <mehtad@hotmail.com> wrote:
Hi,

How do I use <otherwise> in Decision Tables created using Eclipse (Excel
Spreadsheets). I have created a rule where I have provided "<otherwise>" as
a criteria but its been taken as the value of the parameter instead of
creating a separate rule with the "not" clause. I am providing the
screenshot of the decision table as well as the rules generated by Drools.

I would much appreciate if someone can advise on how I can use <otherwise>
in my rules.

http://drools.46999.n3.nabble.com/file/n4019162/droolsdt.jpg

Drools conversion to ".drl" below (Rule Flight_Type_Rules_15 shows
<otherwise> being used as parameter valUE):

DRL is :: package com.test.BasicDTRules;
//generated from Decision Table
import java.util.Date;
import com.test.Flight;
// rule values at C11, header at C6
rule "Flight Type Rules_11"
        when
                flight : Flight(flightNumber >= "0001", flightNumber <= "1000",
airlineCode == "BA")
        then
                flight.setFlightType("SH");
                flight.setValid(true);
                System.out.println("Row 1");
end

// rule values at C12, header at C6
rule "Flight Type Rules_12"
        when
                flight : Flight(flightNumber >= "0001", flightNumber <= "1000",
airlineCode == "AA")
        then
                flight.setFlightType("SH");
                flight.setValid(true);
                System.out.println("Row 2");
end

// rule values at C13, header at C6
rule "Flight Type Rules_13"
        when
                flight : Flight(flightNumber >= "1001", flightNumber <= "2500",
airlineCode == "VG")
        then
                flight.setFlightType("LH");
                flight.setValid(true);
                System.out.println("Row 3");
end

// rule values at C14, header at C6
rule "Flight Type Rules_14"
        when
                flight : Flight(flightNumber >= "1001", flightNumber <= "2500",
airlineCode == "AA")
        then
                flight.setFlightType("550");
                flight.setValid(true);
                System.out.println("Row 4");
end

// rule values at C15, header at C6
rule "Flight Type Rules_15"
        when
                flight : Flight(flightNumber >= "2501", flightNumber <= "9999",
airlineCode == "<otherwise>")
        then
                flight.setFlightType("Invalid");
                flight.setValid(false);
                System.out.println("Row 5");
end


Thanks,
dme



--
View this message in context: http://drools.46999.n3.nabble.com/otherwise-in-Excel-Decision-Table-tp4019162.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users