JESS: Re: the problem of query working memory

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown JESS: Re: the problem of query working memory

by Weijing Bai :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i just slove it by change the code to :
 
 result = engine.runQueryStar(sRule, vv );
 
hope it can help u.

On Thu, Oct 29, 2009 at 4:28 PM, Weijing Bai <estherbaiweijing@...> wrote:
i hava a problem when use runQueryStar with two params. with only one param situation it can works well. but with two params it's report:
 
Jess reported an error in routine runQuery.
  Message: Wrong number of variables for query mid1.
 at jess.Rete.doRunQuery(Rete.java:2889)
 at jess.Rete.runQueryStar(Rete.java:2824)
 at jess.Rete.runQueryStar(Rete.java:2807)
 at test.MidCengSequence(test.java:255)
 at test.TOSequenceADL(test.java:394)
 at test.main(test.java:492)
 
 
 
the program is:
 
 
      ValueVector vv = new ValueVector();
      vv.add(jf);
      vv.add(I);
      Value myList = new Value(vv, RU.LIST);
      result = engine.runQueryStar(sRule, new ValueVector().add(myList) );
 
the clp is :
 
(defquery mid1
(declare (variables ?x ?i)) 
     f1<- ();
     f2<-();
)
 
 
thanks very much!


Re: JESS: Re: the problem of query working memory

by Nopphadol Chalortham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think this code, It may be work.

QueryResult result = engine.runQueryStar("mid1", new ValueVector().add(jf).add(I));




On Thu, Oct 29, 2009 at 3:40 PM, Weijing Bai <estherbaiweijing@...> wrote:
i just slove it by change the code to :
 
 result = engine.runQueryStar(sRule, vv );
 
hope it can help u.

On Thu, Oct 29, 2009 at 4:28 PM, Weijing Bai <estherbaiweijing@...> wrote:
i hava a problem when use runQueryStar with two params. with only one param situation it can works well. but with two params it's report:
 
Jess reported an error in routine runQuery.
  Message: Wrong number of variables for query mid1.
 at jess.Rete.doRunQuery(Rete.java:2889)
 at jess.Rete.runQueryStar(Rete.java:2824)
 at jess.Rete.runQueryStar(Rete.java:2807)
 at test.MidCengSequence(test.java:255)
 at test.TOSequenceADL(test.java:394)
 at test.main(test.java:492)
 
 
 
the program is:
 
 
      ValueVector vv = new ValueVector();
      vv.add(jf);
      vv.add(I);
      Value myList = new Value(vv, RU.LIST);
      result = engine.runQueryStar(sRule, new ValueVector().add(myList) );
 
the clp is :
 
(defquery mid1
(declare (variables ?x ?i)) 
     f1<- ();
     f2<-();
)
 
 
thanks very much!



Re: JESS: Re: the problem of query working memory

by Weijing Bai :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the problem has been solved, thanks a lot.

On Fri, Oct 30, 2009 at 9:55 AM, Nopphadol Chalortham <nopphadolc@...> wrote:
I think this code, It may be work.

QueryResult result = engine.runQueryStar("mid1", new ValueVector().add(jf).add(I));




On Thu, Oct 29, 2009 at 3:40 PM, Weijing Bai <estherbaiweijing@...> wrote:
i just slove it by change the code to :
 
 result = engine.runQueryStar(sRule, vv );
 
hope it can help u.

On Thu, Oct 29, 2009 at 4:28 PM, Weijing Bai <estherbaiweijing@...> wrote:
i hava a problem when use runQueryStar with two params. with only one param situation it can works well. but with two params it's report:
 
Jess reported an error in routine runQuery.
  Message: Wrong number of variables for query mid1.
 at jess.Rete.doRunQuery(Rete.java:2889)
 at jess.Rete.runQueryStar(Rete.java:2824)
 at jess.Rete.runQueryStar(Rete.java:2807)
 at test.MidCengSequence(test.java:255)
 at test.TOSequenceADL(test.java:394)
 at test.main(test.java:492)
 
 
 
the program is:
 
 
      ValueVector vv = new ValueVector();
      vv.add(jf);
      vv.add(I);
      Value myList = new Value(vv, RU.LIST);
      result = engine.runQueryStar(sRule, new ValueVector().add(myList) );
 
the clp is :
 
(defquery mid1
(declare (variables ?x ?i)) 
     f1<- ();
     f2<-();
)
 
 
thanks very much!