rule
"A Rule"LoanBean loan =
new LoanBean();loan.setLoanId(
"1");System.out.println(
"A rule");loan.setLoanId(
"1"); assertLogical(loan);end
rule
"B Rule" whena:LoanBean(loanId ==
"1"); thenSystem.out.println(
"B Rule");end
In the above examples, if I am using assert(loan), then it is printing as "A Rule" and "B Rule". But when I have used assertLogical(loan), then "A Rule" is printing continously, without "B Rule" printing. Why?
And also I am able to use Global variable for loan(LoanBean loan). I have setGlobal in the workingMemory. The same thing If I used like below using global, I am getting the NullPointer Exception. I have set
global LoanBean loan;
rule "A Rule"
when
not LoanBean();
then
loan = loan.setLoanId(
local like LoanBean loan = new LoanBean(), then all the properties are
displaying
System.out.println( loan.setLoanId( end
rule a:LoanBean(loanId == System.out.println( end
Regards,
Micheal john