List Info

Thread: Re: Date arithmetic in “when” session




Re: Date arithmetic in “when” session
country flaguser name
Netherlands
2008-05-07 09:06:50
>
> I tried this approach, but I get compilation errors for
tokens '-' and '+'
>  I
> get similar errors for any arithmetic symbols (*, + or
-)
>
> What is the right way to add or subtract or multiply
with in "when"
> session?

I don't know why the example doesn't work. Try this:

rule "ITR Discard"
    when
         req : LowFareRequest(
            $reqTime : requestedDeparture.time)
         itr : AirItinerary( discarded == false )
         flight : Flight(
            departure.time <
                    ($reqTime / 3600000 + 2),
            departure.time  >
                    ($reqTime / 3600000 - 4))
    then
         System.out.println("discard true");
    end



Christine




_______________________________________________
rules-users mailing list
rules-userslists.jboss.org

https://lists.jboss.org/mailman/listinfo/rules-users

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )