If you change a fact and want to inspect it after firing all rules, use a query.
There is an example in the Drools Expert manual.
-W
On 13/07/2012, Ravikiran wrote:
> Hi Laune,
>
> As i mentioned before, I have given some sample code only before. But i
> actually meant that "percent" is an ins
Hi Laune,
As i mentioned before, I have given some sample code only before. But i
actually meant that "percent" is an instance variable of type double from
class "LoanFormula", sorry for creating the confusion. Both Person & Loan
formula classes are like this,
declare Person
age: Integer
-
DRL:
LoanFormula percent;
then
percent = ...;
=
Java:
ksession.fireAllRules();
LoanFormula percent = ksession.getGlobal( "percent" );
I suspect that your knowledge of Java is flawed since you can't have a
class of your own and then assign a double to it:
LoanFormula percen
Thanks Lane.
Since i am new to this Area, could you please help me with some sample code
how to query the objects that are involved in a rule. Please consider above
my example, on successful execution of Rule 1, i want to access the value of
"Percent" from Class LoanFormula.
Thanks a lot.
--
Vie
You cannot access any variable declared between 'then' and 'end'.
These are local in the same sense as a variable declared in a Java
method.
For passing anything computed in a rule consequence to the embedding
Java program you might
* insert a Fact of some suitable type and retrieve this from the
Hi Drools Gurus,
One more newbie here for Drools Guvnor. I have chosen
"guvnor-distribution-5.3.0.Final" (I could see version as SNAPSHOT 5.4.0
within Guvnor-->Administration-->About) to start with. After reading through
the complete user manual, I was able to setup and deploy Drools Guvnor war
in