Decision decision = new Decision(
"Main",
"file:/Users/anuj/Work/Worxogo/Workspace/BeatPlan/rules/main/DecisionFTRAvailability.xls");
// SCE sce = new SCE();
// sce.setFtrAvailability("Y");
DynaProperty ftrAvailability = new DynaProperty("ftrAvailability",
String.class);
DynaProperty sceCode = new DynaProperty("sceCode", Integer.class);
BasicDynaClass sceClass = new BasicDynaClass("SCE", null,
new DynaProperty[] { ftrAvailability, sceCode });
//Points points = new Points();
DynaBean db = sceClass.newInstance();
db.set("ftrAvailability", "Y");
decision.put("sce", db);
DynaProperty ftrAvailabilityPoints = new DynaProperty("ftrAvailabilityPoints", Double.class);
BasicDynaClass points = new BasicDynaClass("Points", null,
new DynaProperty[] { ftrAvailabilityPoints});
decision.put("points", points.newInstance());
decision.execute();
this code throws various error. I debugged the code but I dont think open rules takes care of dyna bean in assigning the values.
Anuj,
We will see how to add direct support for DynaBean. Meanwhile you may simply convert our DynaBean instances to our DynamicObjects instances before passing them to your Decision object. See the attached example that shows how it can be done.
OpenRules Support
ERROR in Glossary trying to compare a value of <Login day of month> with <[1;9]> using oper Within: property=2 type=java.lang.String value=[1;9]
I hope I have provided a better explanation of the problem I am facing right now.
Workaround I have used -
Implementation Restriction. Make sure that the very first attribute in a Datatype table has type String or your own type but not a basic Java type like int.
Sorry, this is an implementation restriction but it never creates any issues – just add the first field “String id” to your datatype and yo do not have to use it.
OpenRules Support
From: open...@googlegroups.com [mailto:open...@googlegroups.com] On Behalf Of Anuj Bhatnagar
Sent: Thursday, January 28, 2016 7:46 AM
To: OpenRules
Subject: [openrules:418] Re: Using DynaBean for java classes
Thanks for the response. I have used the solution suggested by you. Generating java source and compiling it on the fly.
Is there any workaround for -
1. Implementation Restriction. Make sure that the very first attribute in a Datatype table has type String or your own type but not a basic Java type like int.
--
You received this message because you are subscribed to the Google Groups "OpenRules" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrules+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.