[
https://issues.jboss.org/browse/JBRULES-2700?page=com.atlassian.jira.plug...
]
Geoffrey De Smet commented on JBRULES-2700:
-------------------------------------------
One resolution would be the ability to hook in a WorkingMemoryPreperator, which is a class
that would be run every time a new memory is created. The problem is you 'll probably
want to be able to fetch those constants from some service that you need to inject in that
Preperator, which would be hard...
I am not yet convinced that simply putting some InstitutionWeightings instance like in
Examination example doesn't suffice :/
Allow setting a global variable (for example a service) which can be
used by the score rules
--------------------------------------------------------------------------------------------
Key: JBRULES-2700
URL:
https://issues.jboss.org/browse/JBRULES-2700
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: drools-planner
Reporter: Wouter Horré
Assignee: Geoffrey De Smet
Currently, it is not possible to set a global variable in the working memory used by the
solver. If a scoring rule needs an external helper for calculating scores (e.g. a
dependency injected with OSGi DS), a workaround using a static variable in some class
accessible by the scoring rules is needed.
The easiest implementation is probably a new method in the Solver interface:
public WorkingMemory getWorkingMemory();
which provides access to the working memory used by the solver.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira