This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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.