I think chris poppe wrote:
> 
> 
> 
> Hello,
> 
> Im currently using Jess in combination with the java Petstore. The goal is 
> to write business rules in jess wich can be applied to the petstore and this 
> works fine, I had a couple of questions though.
> 
> I enter my rules as a String and via rete.executeCommand(rule1) they are 
> introduced in the rete
> an example of my rules is the following:
> 
> String rule1="
> (defrule nofishcat( cart (OBJECT ?ca) )
> =>(bind ?items (get ?ca cart))

[... Few dozen lines of procedural code deleted ... ]

>    )";
> 

> I was wondering if there are shorter ways to write these rules, or maybe 
> simpler ways or in an alternate form or an alternate language (?) cause in 
> my program its the administrators who have to supply the rules and making 
> such a jessrule is not that easy. (what im hoping for is some kinda of 
> language and some translation to the jessrules)

Note that your rule here is absolutely trivial -- there's only one
pattern on the LHS -- but the actions it takes are complex. Long
tracts of procedural code are hard to understand for novices in *any*
language. If this rule's RHS consists of a few actions which will be
taken by many rules, then you can provide "building blocks" by writing
either deffunctions or Java Userfunctions to simplify them.

> 
> secondly in case the only way to make these rules is in the Jesslanguage I 
> was wondering if Jess has some kinda verifier or something wich can say if a 
> rule has the right syntax or something. (Now if you have an error in your 
> rule it just throws an exception during execution but i would like to check 
> my rules before the execution, even entirely independent from execution, 
> that is on syntax not on what it actually does. So i can check the rules my 
> administrator fills in.)


Some things can be checked at compile time, and many of these things
are; others can't for the same reasons that faulty Java Reflection
code fails at runtime, not compile time -- the Jess language is weakly
typed. Long stretches of procedural code can be compile-time checked
by rewriting them in Java and calling them as
Userfunctions. Meanwhile, compile-time checking continues to improve
as Jess evolves.

> 
> And finally I was wondering if there exists some GUI in wich you can enter 
> rules or work with jess?
> 

There are a few things you can use right now: in particular, there's
the Jess IDE JessWin, available from the "User Contributions" page of
the Jess web site. That same page contains setup files to make working
with Jess from your favorite editor somewhat easier.

Jess 7 will (famously) include an Eclipse-based IDE; we hope to start
public beta testing later this Spring.

The Jess book "Jess in Action" talks some about custom rule editors
and about XML-based rule languages. Jess 7 will have native XML
support. 


---------------------------------------------------------
Ernest Friedman-Hill  
Science and Engineering PSEs        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to