[jboss-jira] [JBoss JIRA] (JBRULES-2700) Allow setting a global variable (for example a service) which can be used by the score rules
Henrik Saksela (JIRA)
jira-events at lists.jboss.org
Fri Aug 17 08:29:15 EDT 2012
[ https://issues.jboss.org/browse/JBRULES-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712205#comment-12712205 ]
Henrik Saksela commented on JBRULES-2700:
-----------------------------------------
Thanks for a quick reply! I'll see what I can do. Proposal A is probably more reasonable, I can't see a reason for exposing the rest of WorkingMemory? I read through the stuff you mentioned, and this seems straightforward.
Regarding thread safety: Should the globals possibly implement some interface to allow them to be notified when the solver session starts / ends? This could allow the globals to handle thread specific db-connection lifecycle stuff.
> 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: // Impossible
> public WorkingMemory getWorkingMemory();
> which provides access to the working memory used by the solver.
> => Impossible because the number of WorkingMemory equals the number of threads being used by Planner, and sometimes they are reset.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list