But assigning a value to a global isn't straightforward - you can't do it in the declaration. You'll have to do it from the application (or use some dirty hack, in a start-up rule); either way it's separate from the declaration.
IMHO, using a Java class with public static final is definitely cleaner. -W 2009/6/1 Earnest Dyke <[email protected]>: > How about adding them as Globals and referencing them that way? You should > be able to put them in a map as well in a Global and reference them. > > Earnie! > > ________________________________ > From: karthizap <[email protected]> > To: [email protected] > Sent: Monday, June 1, 2009 7:14:56 AM > Subject: re[rules-users] move hardcoded values in DRL or have constants > inside drl > > Is there is anyway i can remove hardcoded values in the DRL file? Can I have > the constants file(like data dictionary) inside drl/functions. I don't want > to refer java constants class directly in drl file and would like to declare > and refer those constants inside drl file. > ________________________________ > View this message in context: remove hardcoded values in DRL or have > constants inside drl > Sent from the drools - user mailing list archive at Nabble.com. > > _______________________________________________ > rules-users mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users > > _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
