JBoss Rules (Drools 4.0.3), DSL, and setting values.

Discussion in 'Java' started by andrewfsears@gmail.com, Dec 19, 2007.

  1. Guest

    I'm not sure of the place to post this question, but I'm trying to
    create a Domain Specific Language rules file.

    For this one, I would like to see if the current date/time is between
    two dates, inclusive.

    I would like to be able to write in my rules.dslr file:

    ------------------------------------------------------
    package com.abc.test
    expander rules.dsl
    rule "Between two dates"
    when
    The current date is between "2007-12-01" and "2007-12-31"
    then
    Print "is in between"
    end
    ----------------------------------------------------

    and rules.dsl:

    ----------------------------------------------------
    [condition][]The current date is between "{startDate}" and
    "{endDate}"="{startDate}" <= new Date(); "{endDate}" >= new Date();
    [consequence][]Print "{message}"=System.out.println("{message} ");
    ----------------------------------------------------

    Clearly, the "condition" doesn't work. What should I be doing?

    Thanks for anyone willing to help me with this, Andy

    PS: Also, I tried going off of the documentation for 4.0.3, as well as
    the examples that come with Drools, but they don't seem to help me
    that much when the rules start getting a little more complicated. Is
    there another source that will be more beneficial?

    Thanks.
    , Dec 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. han
    Replies:
    0
    Views:
    476
  2. drools rule engine

    , Dec 29, 2007, in forum: Java
    Replies:
    1
    Views:
    846
    Manish Pandit
    Dec 31, 2007
  3. tomo

    drools+rational 7

    tomo, Dec 22, 2009, in forum: Java
    Replies:
    2
    Views:
    402
  4. tomo

    IBM rational + drools ?

    tomo, Jan 25, 2010, in forum: Java
    Replies:
    0
    Views:
    406
  5. deostroll
    Replies:
    7
    Views:
    554
    Arne Vajhøj
    Mar 14, 2010
Loading...

Share This Page