Thanks for the information.
I am trying to get the value in the when condition from a function(that returns a value). But facing some errors in doing that...May be I am doing some mistake in creating drl.
Below is my drl and the Pojo that I am using, please guide me on this :
Drl :
Pojo :
package com.sample;
public class Customer {
private double si;
private String val;
public double getSi() {
return si;
}
public double setSi(double p,double r, double t) {
si = (p*r*t)/100;
return si;
}
public String getVal() {
return val;
}
public void setVal(String val) {
this.val = val;
}
}
public class Customer {
private double si;
private String val;
public double getSi() {
return si;
}
public double setSi(double p,double r, double t) {
si = (p*r*t)/100;
return si;
}
public String getVal() {
return val;
}
public void setVal(String val) {
this.val = val;
}
}
The error that I get while executing is :
From:
Wolfgang Laun <[email protected]>To:
Rules Users List <[email protected]>Date:
08/04/2011 04:05 PMSubject:
Re: [rules-users] Some basic queriesSent by:
[email protected]
2011/8/4 Gaurav Silakari <[email protected]>Hi,
I have some queries on Drools. These might be very basic but I need to get them cleared.
1) Is it possible to bind the constructor name of java class(provided in the 'import' syntax) with a bind variable in LHS of the rule
Whatever would you need the binding for? MyClass.class.getName() is also the constructor's name.
2) Is it possible to call a parameterised (single parameter) method of a class (by giving class reference as bind variable and class being declared in 'import' syntax ) in LHS of the rule
If the Class object is an attribute of some fact it can be bound and you can use
reflection to call the method. This could be written as a DRL function.
3) Is it possible to call a parameterised method (with single parameter) in the RHS of the rule (The method would be pertaining to the class imported in the 'import' syntax and method name being invoked through the bind variable reference )
Assuming the method name (or the Method object) comes from a field in some fact, it can be bound to a variable. On the RHS you proceed as in Java.
-W
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
_______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
