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
