I've used Jess before and one of the things that I really found helpful was
it has an interactive shell and the fact that you can model fact definitions
(deftemplate - equivalent to a Java class) and insert facts (via assert) in
the shell directly. That allowed for very easy experimentation without
getting into too much programming. An example is provided below and you can
see that examples like this are easy to experiment with.
Is there an equivalent interactive shell in Drools? Would it allow the
definition and creation of Facts in this fashion?
Or do most of you just cut the java code to experiment?
> SAMPLE JESS CODE
; This is equivalent to a Java class definition
(deftemplate day_time
(slot time_of_day)
(slot day_of_week)
)
; Rule 1
(defrule have_a_nice_weekend
(day_time (time_of_day EVENING) (day_of_week FRI))
=>
(printout t "Good night. Have a great Weekend")
)
; Rule 2
(defrule tgif
(day_time (time_of_day MORNING) (day_of_week FRI))
=>
(printout t "Good Morning. Aren't you glad its Friday?")
)
; Insert a Fact
(assert (day_time (time_of_day EVENING)(day_of_week FRI)))
; Execute whatever is on the agenda
(run)