File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Java Products and Servers and the fly likes Jess Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Jess Question" Watch "Jess Question" New topic

Jess Question

Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 492

Hi all,

I am working on a Jess application to advise users on which programming language to use. I wanted to ask the questions in a specific order and was wondering if that was possible without adding some condition to the rules.

Right now to get them to fire in the order i want I have to do this:

I was wondering is there was a better way of doing this.


"If the facts don't fit the theory, get new facts" --Albert Einstein
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

If there is a specific order in which you want to ask a set of questions, then that order has to be encoded somehow. This is one way to do it. Another way would be just to keep an explicit list of the questions in the order in which you want to ask them. Have a look at the "stack" example that comes with Jess, in which a bunch of rules all operate on a shared list structure. A third way would be to encode the dependencies as facts -- for example, each question fact might include a multislot holding the names of the questions that must be asked before it. Then the question-asking rule would just ask whatever questions had all their prerequisites met. I think I like that last one best.

[Jess in Action][AskingGoodQuestions]
Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 492

The third way you mentioned sounds like it will work perfectly for my program. Thank you for your response.

I agree. Here's the link:
subject: Jess Question
It's not a secret anymore!