Hi everybody,
 As I am developing using JESS, I have some doubts. Here is more one...
Consider that I have one fact and the two rules below. They are
automatically created using Java and Rete. Actually, I used the STORE and a
bean because I want to retrieve (FETCH) a list of results. For example, I
know that when running this algorithm if I used "printout" I will receive as

Actually I want to retrieve these values. Probably my use of STORE is not
correct and you have another simple solution. The problem here is that even
if I declared my bean as global, this means, it will be instanciated only
one time, as I saw the answers I received, it is passing two times when I
call it. Thus I can conclude that it is creating two instances of my bean,
one for creationEscalierBeton and another for fournitureBeton. Thus this is
the reason that my "StringBuffer" inside the bean only have one result.
Actually I want to retrieve an order list telling which rule is fired
firstly, and so on. I want to retrieve as 
 System.out.println("Order List: " + rete.fetch("RESULT"));

Do you know another way to FETCH the RESULT value since this RESULT should
be a list of the name of my rules or the name that I am saying? 
If in the place of the set and store I used printout, everything works as I
need. However the problem is that I need to retrieve these results. 

Best regards,

(assert (existPlancher))

(defglobal ?*obj* = (new MarchePublicBeanPlan))

(defrule creationEscalierBeton 
        (assert (existEscalierBeton))
        (set ?*obj*  action "creationEscalierBeton")
        (store RESULT (get ?*obj* action))

(defrule fournitureBeton 
        (assert (betonFournit))
        (set ?*obj*  action "fournitureBeton")
        (store RESULT (get ?*obj* action))

I have this bean: 
import java.io.Serializable;

public class MarchePublicBeanPlan implements Serializable{
  private String action;
  public StringBuffer plan;

  public MarchePublicBeanPlan() {
    System.out.println("************* Inside BEAN******************");
    action = null;
    plan = new StringBuffer();
  public void setAction(String action) {
  public String getAction() {
    return plan.toString();
And this is the answer I get when I rete.run it. 
####################STARTING RETE################
************* Inside BEAN******************
************* Inside BEAN******************
Order List: "fournitureBeton"

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