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.