Re: [rules-users] Object referencing error

2010-06-04 Thread Fnu Mahalakshmi
Thank you guys so much for all the help!!! I am trying out what you suggested. 
:)


-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Friday, June 04, 2010 7:48 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 18

Send rules-users mailing list submissions to
rules-users@lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-requ...@lists.jboss.org

You can reach the person managing the list at
rules-users-ow...@lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."


Today's Topics:

   1. Using the ForEach component in RuleFlow (Darshan)
   2. Re: forEach node Clarification (Darshan)
   3. Re: Object Referencing Error (Esteban Aliverti)


--

Message: 1
Date: Fri, 4 Jun 2010 03:30:46 -0700 (PDT)
From: Darshan 
Subject: [rules-users] Using the ForEach component in RuleFlow
To: rules-users@lists.jboss.org
Message-ID: <1275647446097-870012.p...@n3.nabble.com>
Content-Type: text/plain; charset=us-ascii



I am trying to use ForEach component in the process flow. I need to call a
set of rules in loop. I have this subFlow created inside ForEach component.
The collection set in the working memory becomes available to the ForEach
component and infact even in subFlow the OnEntryAction and OnExitAction can
access the integerObject from the collection. But when it comes to executing
the rules, looks like the integerObject is not available to the rule and
none of the rules are executed. If I add a dummy rule without any condition
it does get executed but only once. Have anybody tried similar kind of
scenario. If yes please send me some example, as I am really stuch out here
trying to call rules in a loop.

I am attaching the souce code along with this post. Please have a look.

Here is how the ForEach flow looks like
http://drools-java-rules-engine.46999.n3.nabble.com/file/n870012/ForEachFlow.jpg

Here is my SubFlow layout
http://drools-java-rules-engine.46999.n3.nabble.com/file/n870012/subProcessFlow.jpg


Here is the output of Java Program

Setting numberList
Entry 1
Entry 2
Exit 1
Entry 3
Exit 2
Entry 4
Exit 3
Entry 5
Exit 4
Entry 6
Exit 5
Entry 7
Exit 6
Entry 8
Exit 7
Entry 9
Exit 8
Entry 10
Exit 9
Entry 11
Exit 10
Entry 12
Exit 11
Entry 13
Exit 12
Entry 14
Exit 13
Entry 15
Exit 14
Entry 16
Exit 15
Entry 17
Exit 16
Entry 18
Exit 17
Entry 19
Exit 18
Exit 19
Rules executed



testSubFlowForEach.rf looks like this


http://drools.org/drools-5.0/process";
 xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
 xs:schemaLocation="http://drools.org/drools-5.0/process
drools-processes-5.0.xsd"
 type="RuleFlow" name="testForEach" id="processForEach"
package-name="com.sample" >

  

  
  


  

  
  

  

  

  


  

  
  
System.out.println("Entry
" + ((IntegerObject) integerObject).getIntVal());
  
  
System.out.println("Exit "
+ ((IntegerObject) integerObject).getIntVal());
  

  
  
  
  

  
  

  


  

  


  




http://drools-java-rules-engine.46999.n3.nabble.com/file/n870012/testForEach.zip
testForEach.zip
--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Using-the-ForEach-component-in-RuleFlow-tp870012p870012.html
Sent from the Drools - User mailing list archive at Nabble.com.


--

Message: 2
Date: Fri, 4 Jun 2010 04:21:50 -0700 (PDT)
From: Darshan 
Subject: Re: [rules-users] forEach node Clarification
To: rules-users@lists.jboss.org
Message-ID: <1275650510581-870109.p...@n3.nabble.com>
Content-Type: text/plain; charset=us-ascii




Hi Rajakanthan,

I am trying similar kind of thing and need help. I need to call a set of
rules in loop by passing a object fro0 a collection to the rules. Here are
more details about What I am trying to do. Please help.

http://drools-java-rules-engine.46999.n3.nabble.com/Using-the-ForEach-component-in-RuleFlow-td870012.html#a870012

Here is the code
http://drools-java-rules-engine.46999.n3.nabble.com/file/n870109/testForEach.zip
testForEach.zip
--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/forEach-node-Clarification-tp60090p870109.html
Sent from the Drools - User mailing list archive at Nabble.com.


----------

Message: 3
Date: Fri, 4 Jun 2010 08:47:29 -0300
From: Esteban Aliv

Re: [rules-users] Object Referencing Error

2010-06-04 Thread Esteban Aliverti
True, I forgot about the objectB field restriction.

2010/6/4 Swindells, Thomas 

>  In fact in your case you when condition doesn’t make any sense – B will
> never equal the empty string as B isn’t a string.
>
> You probable want the following:
>
> rule “foo”
>
> when
>$a :A(Type == "Prod" , objectB == null)
>
> then
>B bobject = new B();
>
>bobject.setType(“Prod”);
>
>bobject.setId($a.getNumber().getId());
>
>modify($a) {
>
>   setObjectB(bobject);
>
> };
>
> end
>
>
>
> This rule only executes when objectB  is null, this means you won’t get
> into the loop as once you have created objectB  the rule won’t evaluate to
> true again.
>
>
>
> Thomas
>
>
>
>   *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti
> *Sent:* 03 June 2010 23:43
> *To:* Rules Users List
> *Subject:* Re: [rules-users] Object Referencing Error
>
>
>
> Yes, your rule entered in an infinite loop because when every time you
> insert/modify/retract a Fact, rules are reevaluated to check if the
> insertion/modification/retraction generates activations or not. In your
> case, your rule is being reevaluated every time you update your $a object,
> the evaluation ends firing the rule, and this starts an endless loop.
>
> If you only have this behavior with this rule, you can consider using the
> "no-loop" attribute. If your problem is multiple rules being re executed
> (and you don't wont that) you can use "lock-on-active" attribute. Try to
> read the documentation about these attributes for further information.
>
> It is very important for the people new in drools to understand the life
> cycle of a rule.
>
>
>
> Best,
>
> On Thu, Jun 3, 2010 at 7:33 PM, Fnu Mahalakshmi 
> wrote:
>
> Hi,
>
> I tried what you said but program goes into an infinite loop.
> It does not break out of the when loop only.
> I did exactly as you mentioned.
> In the test information I put in a.type = "Prod"
> And a.bObject(new B());
> Any idea whats wrong??
>
> Thanks,
> M
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of
> rules-users-requ...@lists.jboss.org
> Sent: Thursday, June 03, 2010 4:52 PM
> To: rules-users@lists.jboss.org
> Subject: rules-users Digest, Vol 43, Issue 15
>
> Send rules-users mailing list submissions to
>rules-users@lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>rules-users-requ...@lists.jboss.org
>
> You can reach the person managing the list at
>rules-users-ow...@lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>   1. Re: Object Referencing error: (Esteban Aliverti)
>
>
> --
>
> Message: 1
> Date: Thu, 3 Jun 2010 17:51:10 -0300
> From: Esteban Aliverti 
> Subject: Re: [rules-users] Object Referencing error:
> To: Rules Users List 
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> You can't modify bobject, becuase it doesn't exist inside the session. You
> just created it a few lines above. Maybe you need an insert() or maybe you
> need the bobject reference from the LHS. Something like this:
>
> *rule* "prod"
>
>
>
>  *when*
>
> $a :A(Type == "Prod" , objectB != "")
>
>  *then*
>
>   B bobject = *new* B();
>
> $a.getObjectB().setType( "Prod" );
>
> $a.getObjectB().setId($a.getNumber().getId());
>
> *update*($a);
>
> *  end*
>
> Note that you need to update $a and not B, because A is the inserted Fact
> in
> your session.
>
> Best,
>
>
> 2010/6/3 Fnu Mahalakshmi 
>
> >  Hi,
> >
> >
> >
> > I am getting the following error when I try to do complex object
> > referencing in drools:
> >
> > My class:
> >
> > A{
> >
> > String Type;
> >
> > B objectb;
> >
> > //getters and setters for above
> >
> > }
> >
> >
> >
> > My rules:
> >
> >
> >
> > *rule* "prod"
> >
> >
> >
> >   *

Re: [rules-users] Object Referencing Error

2010-06-04 Thread Swindells, Thomas
In fact in your case you when condition doesn't make any sense - B will never 
equal the empty string as B isn't a string.
You probable want the following:
rule "foo"
when
   $a :A(Type == "Prod" , objectB == null)
then
   B bobject = new B();
   bobject.setType("Prod");
   bobject.setId($a.getNumber().getId());
   modify($a) {
  setObjectB(bobject);
};
end

This rule only executes when objectB  is null, this means you won't get into 
the loop as once you have created objectB  the rule won't evaluate to true 
again.

Thomas


From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti
Sent: 03 June 2010 23:43
To: Rules Users List
Subject: Re: [rules-users] Object Referencing Error

Yes, your rule entered in an infinite loop because when every time you 
insert/modify/retract a Fact, rules are reevaluated to check if the 
insertion/modification/retraction generates activations or not. In your case, 
your rule is being reevaluated every time you update your $a object, the 
evaluation ends firing the rule, and this starts an endless loop.
If you only have this behavior with this rule, you can consider using the 
"no-loop" attribute. If your problem is multiple rules being re executed (and 
you don't wont that) you can use "lock-on-active" attribute. Try to read the 
documentation about these attributes for further information.
It is very important for the people new in drools to understand the life cycle 
of a rule.

Best,
On Thu, Jun 3, 2010 at 7:33 PM, Fnu Mahalakshmi 
mailto:fmahalaks...@nyx.com>> wrote:
Hi,

I tried what you said but program goes into an infinite loop.
It does not break out of the when loop only.
I did exactly as you mentioned.
In the test information I put in a.type = "Prod"
And a.bObject(new B());
Any idea whats wrong??

Thanks,
M

-Original Message-
From: 
rules-users-boun...@lists.jboss.org<mailto:rules-users-boun...@lists.jboss.org> 
[mailto:rules-users-boun...@lists.jboss.org<mailto:rules-users-boun...@lists.jboss.org>]
 On Behalf Of 
rules-users-requ...@lists.jboss.org<mailto:rules-users-requ...@lists.jboss.org>
Sent: Thursday, June 03, 2010 4:52 PM
To: rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>
Subject: rules-users Digest, Vol 43, Issue 15

Send rules-users mailing list submissions to
   rules-users@lists.jboss.org<mailto:rules-users@lists.jboss.org>

To subscribe or unsubscribe via the World Wide Web, visit
   https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
   
rules-users-requ...@lists.jboss.org<mailto:rules-users-requ...@lists.jboss.org>

You can reach the person managing the list at
   
rules-users-ow...@lists.jboss.org<mailto:rules-users-ow...@lists.jboss.org>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."


Today's Topics:

  1. Re: Object Referencing error: (Esteban Aliverti)


--------------

Message: 1
Date: Thu, 3 Jun 2010 17:51:10 -0300
From: Esteban Aliverti 
mailto:esteban.alive...@gmail.com>>
Subject: Re: [rules-users] Object Referencing error:
To: Rules Users List 
mailto:rules-users@lists.jboss.org>>
Message-ID:
   
mailto:aanlktimezij5vfmtbeslfjiwoc_4mezsxbkmixavj...@mail.gmail.com>>
Content-Type: text/plain; charset="iso-8859-1"

You can't modify bobject, becuase it doesn't exist inside the session. You
just created it a few lines above. Maybe you need an insert() or maybe you
need the bobject reference from the LHS. Something like this:

*rule* "prod"



 *when*

$a :A(Type == "Prod" , objectB != "")

 *then*

  B bobject = *new* B();

$a.getObjectB().setType( "Prod" );

$a.getObjectB().setId($a.getNumber().getId());

*update*($a);

*  end*

Note that you need to update $a and not B, because A is the inserted Fact in
your session.

Best,


2010/6/3 Fnu Mahalakshmi mailto:fmahalaks...@nyx.com>>

>  Hi,
>
>
>
> I am getting the following error when I try to do complex object
> referencing in drools:
>
> My class:
>
> A{
>
> String Type;
>
> B objectb;
>
> //getters and setters for above
>
> }
>
>
>
> My rules:
>
>
>
> *rule* "prod"
>
>
>
>   *when*
>
>  $a :A(Type == "Prod" , objectB != "")
>
>   *then*
>
> B bobject = *new* B();
>
>  bobject.setType( "Prod" );
>
>  bobject.setId($a.getNumber().getId());
>
>  *update*(bobject);
>
>
>
> *end*
>
&

Re: [rules-users] Object Referencing Error

2010-06-03 Thread Esteban Aliverti
Yes, your rule entered in an infinite loop because when every time you
insert/modify/retract a Fact, rules are reevaluated to check if the
insertion/modification/retraction generates activations or not. In your
case, your rule is being reevaluated every time you update your $a object,
the evaluation ends firing the rule, and this starts an endless loop.
If you only have this behavior with this rule, you can consider using the
"no-loop" attribute. If your problem is multiple rules being re executed
(and you don't wont that) you can use "lock-on-active" attribute. Try to
read the documentation about these attributes for further information.
It is very important for the people new in drools to understand the life
cycle of a rule.

Best,

On Thu, Jun 3, 2010 at 7:33 PM, Fnu Mahalakshmi wrote:

> Hi,
>
> I tried what you said but program goes into an infinite loop.
> It does not break out of the when loop only.
> I did exactly as you mentioned.
> In the test information I put in a.type = "Prod"
> And a.bObject(new B());
> Any idea whats wrong??
>
> Thanks,
> M
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of
> rules-users-requ...@lists.jboss.org
> Sent: Thursday, June 03, 2010 4:52 PM
> To: rules-users@lists.jboss.org
> Subject: rules-users Digest, Vol 43, Issue 15
>
> Send rules-users mailing list submissions to
>rules-users@lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>rules-users-requ...@lists.jboss.org
>
> You can reach the person managing the list at
>rules-users-ow...@lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>   1. Re: Object Referencing error: (Esteban Aliverti)
>
>
> ----------
>
> Message: 1
> Date: Thu, 3 Jun 2010 17:51:10 -0300
> From: Esteban Aliverti 
> Subject: Re: [rules-users] Object Referencing error:
> To: Rules Users List 
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> You can't modify bobject, becuase it doesn't exist inside the session. You
> just created it a few lines above. Maybe you need an insert() or maybe you
> need the bobject reference from the LHS. Something like this:
>
> *rule* "prod"
>
>
>
>  *when*
>
> $a :A(Type == "Prod" , objectB != "")
>
>  *then*
>
>   B bobject = *new* B();
>
> $a.getObjectB().setType( "Prod" );
>
> $a.getObjectB().setId($a.getNumber().getId());
>
> *update*($a);
>
> *  end*
>
> Note that you need to update $a and not B, because A is the inserted Fact
> in
> your session.
>
> Best,
>
>
> 2010/6/3 Fnu Mahalakshmi 
>
> >  Hi,
> >
> >
> >
> > I am getting the following error when I try to do complex object
> > referencing in drools:
> >
> > My class:
> >
> > A{
> >
> > String Type;
> >
> > B objectb;
> >
> > //getters and setters for above
> >
> > }
> >
> >
> >
> > My rules:
> >
> >
> >
> > *rule* "prod"
> >
> >
> >
> >   *when*
> >
> >  $a :A(Type == "Prod" , objectB != "")
> >
> >   *then*
> >
> > B bobject = *new* B();
> >
> >  bobject.setType( "Prod" );
> >
> >  bobject.setId($a.getNumber().getId());
> >
> >  *update*(bobject);
> >
> >
> >
> > *end*
> >
> > * *
> >
> > *I want to basically output a file which has updated values of B (type,
> > Id)
> >
> > *
> >
> > * *
> >
> > *Error:*
> >
> > *org.drools.spi.ConsequenceException*: *org.drools.FactException*: Update
> > error: handle not found for object: com.org...@f42ad0. Is it in the
> > working memory?
> >
> >   at
> > org.drools.base.DefaultConsequenceExceptionHandler.handleException(*
> > DefaultConsequenceExceptionHandler.java:13*)
> >
> >   at org.drools.common.DefaultAgenda.fireActivation(*
> > DefaultAgenda.java:558*)
> >
> >   at org.drools.common.DefaultAgenda.fireNextItem(*
> > DefaultAgenda.java:518*)
&

Re: [rules-users] Object Referencing Error

2010-06-03 Thread Fnu Mahalakshmi
Hi,

I tried what you said but program goes into an infinite loop.
It does not break out of the when loop only.
I did exactly as you mentioned.
In the test information I put in a.type = "Prod"
And a.bObject(new B());
Any idea whats wrong??

Thanks,
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Thursday, June 03, 2010 4:52 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 15

Send rules-users mailing list submissions to
rules-users@lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-requ...@lists.jboss.org

You can reach the person managing the list at
rules-users-ow...@lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."


Today's Topics:

   1. Re: Object Referencing error: (Esteban Aliverti)


--

Message: 1
Date: Thu, 3 Jun 2010 17:51:10 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Object Referencing error:
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

You can't modify bobject, becuase it doesn't exist inside the session. You
just created it a few lines above. Maybe you need an insert() or maybe you
need the bobject reference from the LHS. Something like this:

*rule* "prod"



  *when*

 $a :A(Type == "Prod" , objectB != "")

  *then*

   B bobject = *new* B();

 $a.getObjectB().setType( "Prod" );

 $a.getObjectB().setId($a.getNumber().getId());

 *update*($a);

*  end*

Note that you need to update $a and not B, because A is the inserted Fact in
your session.

Best,


2010/6/3 Fnu Mahalakshmi 

>  Hi,
>
>
>
> I am getting the following error when I try to do complex object
> referencing in drools:
>
> My class:
>
> A{
>
> String Type;
>
> B objectb;
>
> //getters and setters for above
>
> }
>
>
>
> My rules:
>
>
>
> *rule* "prod"
>
>
>
>   *when*
>
>  $a :A(Type == "Prod" , objectB != "")
>
>   *then*
>
> B bobject = *new* B();
>
>  bobject.setType( "Prod" );
>
>  bobject.setId($a.getNumber().getId());
>
>  *update*(bobject);
>
>
>
> *end*
>
> * *
>
> *I want to basically output a file which has updated values of B (type,
> Id)
>
> *
>
> * *
>
> *Error:*
>
> *org.drools.spi.ConsequenceException*: *org.drools.FactException*: Update
> error: handle not found for object: com.org...@f42ad0. Is it in the
> working memory?
>
>   at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(*
> DefaultConsequenceExceptionHandler.java:13*)
>
>   at org.drools.common.DefaultAgenda.fireActivation(*
> DefaultAgenda.java:558*)
>
>   at org.drools.common.DefaultAgenda.fireNextItem(*
> DefaultAgenda.java:518*)
>
>   at org.drools.common.AbstractWorkingMemory.fireAllRules(*
> AbstractWorkingMemory.java:475*)
>
>   at org.drools.common.AbstractWorkingMemory.fireAllRules(*
> AbstractWorkingMemory.java:439*)
>
>   at com.org.DroolsTest.main(*DroolsTest.java:30*)
>
> Caused by: *org.drools.FactException*: Update error: handle not found for
> object: com.org...@f42ad0. Is it in the working memory?
>
>   at org.drools.base.DefaultKnowledgeHelper.update(*
> DefaultKnowledgeHelper.java:100*)
>
>   at com.org.Rule_Prod_Ip_0.consequence(*Rule_Prod_Ip_0.java:10*)
>
>   at com.org.Rule_Prod_Ip_0ConsequenceInvoker.evaluate(*
> Rule_Prod_Ip_0ConsequenceInvoker.java:22*)
>
>   at org.drools.common.DefaultAgenda.fireActivation(*
> DefaultAgenda.java:554*)
>
>   ... 4 more
>
>
>
> Please help! I am very new to drools! Not able to figure out why this
> error:
>
>
>
> I am using eclipse and working on Windows machine. Error above was
> generated on eclipse console.
>
>
>
> Thank you.
>
>
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is

Re: [rules-users] Object Referencing error:

2010-06-03 Thread Esteban Aliverti
You can't modify bobject, becuase it doesn't exist inside the session. You
just created it a few lines above. Maybe you need an insert() or maybe you
need the bobject reference from the LHS. Something like this:

*rule* "prod"



  *when*

 $a :A(Type == "Prod" , objectB != "")

  *then*

   B bobject = *new* B();

 $a.getObjectB().setType( "Prod" );

 $a.getObjectB().setId($a.getNumber().getId());

 *update*($a);

*  end*

Note that you need to update $a and not B, because A is the inserted Fact in
your session.

Best,


2010/6/3 Fnu Mahalakshmi 

>  Hi,
>
>
>
> I am getting the following error when I try to do complex object
> referencing in drools:
>
> My class:
>
> A{
>
> String Type;
>
> B objectb;
>
> //getters and setters for above
>
> }
>
>
>
> My rules:
>
>
>
> *rule* "prod"
>
>
>
>   *when*
>
>  $a :A(Type == "Prod" , objectB != "")
>
>   *then*
>
> B bobject = *new* B();
>
>  bobject.setType( "Prod" );
>
>  bobject.setId($a.getNumber().getId());
>
>  *update*(bobject);
>
>
>
> *end*
>
> * *
>
> *I want to basically output a file which has updated values of B (type,
> Id)
>
> *
>
> * *
>
> *Error:*
>
> *org.drools.spi.ConsequenceException*: *org.drools.FactException*: Update
> error: handle not found for object: com.org...@f42ad0. Is it in the
> working memory?
>
>   at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(*
> DefaultConsequenceExceptionHandler.java:13*)
>
>   at org.drools.common.DefaultAgenda.fireActivation(*
> DefaultAgenda.java:558*)
>
>   at org.drools.common.DefaultAgenda.fireNextItem(*
> DefaultAgenda.java:518*)
>
>   at org.drools.common.AbstractWorkingMemory.fireAllRules(*
> AbstractWorkingMemory.java:475*)
>
>   at org.drools.common.AbstractWorkingMemory.fireAllRules(*
> AbstractWorkingMemory.java:439*)
>
>   at com.org.DroolsTest.main(*DroolsTest.java:30*)
>
> Caused by: *org.drools.FactException*: Update error: handle not found for
> object: com.org...@f42ad0. Is it in the working memory?
>
>   at org.drools.base.DefaultKnowledgeHelper.update(*
> DefaultKnowledgeHelper.java:100*)
>
>   at com.org.Rule_Prod_Ip_0.consequence(*Rule_Prod_Ip_0.java:10*)
>
>   at com.org.Rule_Prod_Ip_0ConsequenceInvoker.evaluate(*
> Rule_Prod_Ip_0ConsequenceInvoker.java:22*)
>
>   at org.drools.common.DefaultAgenda.fireActivation(*
> DefaultAgenda.java:554*)
>
>   ... 4 more
>
>
>
> Please help! I am very new to drools! Not able to figure out why this
> error:
>
>
>
> I am using eclipse and working on Windows machine. Error above was
> generated on eclipse console.
>
>
>
> Thank you.
>
>
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 


Esteban Aliverti
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Object Referencing error:

2010-06-03 Thread Fnu Mahalakshmi
Hi,

I am getting the following error when I try to do complex object referencing in 
drools:
My class:
A{
String Type;
B objectb;
//getters and setters for above
}

My rules:

rule "prod"

  when
 $a :A(Type == "Prod" , objectB != "")
  then
B bobject = new B();
 bobject.setType( "Prod" );
 bobject.setId($a.getNumber().getId());
 update(bobject);

end

I want to basically output a file which has updated values of B (type, Id)


Error:
org.drools.spi.ConsequenceException: org.drools.FactException: Update error: 
handle not found for object: com.org...@f42ad0. Is it in the working memory?
  at 
org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13)
  at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
  at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
  at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
  at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
  at com.org.DroolsTest.main(DroolsTest.java:30)
Caused by: org.drools.FactException: Update error: handle not found for object: 
com.org...@f42ad0. Is it in the working memory?
  at 
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:100)
  at com.org.Rule_Prod_Ip_0.consequence(Rule_Prod_Ip_0.java:10)
  at 
com.org.Rule_Prod_Ip_0ConsequenceInvoker.evaluate(Rule_Prod_Ip_0ConsequenceInvoker.java:22)
  at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
  ... 4 more

Please help! I am very new to drools! Not able to figure out why this error:

I am using eclipse and working on Windows machine. Error above was generated on 
eclipse console.

Thank you.

M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users