1

I have extensive overtime rules implemented in DRL that I'd like to reuse in a rostering application developed with Optaplanner on Quarkus. The Quarkus guide shows an example using a streaming ConstraintProvider. I assume it is not a problem to instead use a SolverFactory with Quarkus. I doesn't seem possible that they can work together.

If they can't, is there some way to execute the DRL overtime rules from a constraint stream definition? I guess I could insert the employee and shifts into a drools session whenever there is a match in the stream but that doesn't seem like it would perform well.

David Bush
  • 11
  • 1

1 Answers1

0

I am afraid that scoreDRL and ConstraintProvider can't be used together for a single solver - the architecture doesn't allow that, for various reasons.

We still support scoreDRL (it's not deprecated), but ConstraintProvider is the future, for ease-of-use, ease-of-testing and easy-of-learning reasons, especially now that 8.3.0.Final will bring it on par performance wise.

That being said, scoreDRL doesn't allow native compilation in Quarkus currently, an issue that's in our backlog. Also, to use scoreDRL with optaplanner-quarkus, replace the transitive dependency drools-core-static with drools-core-dynamic. Note that ConstraintProvider has none of these pitfalls: out-of-the-box, it supports Quarkus, native or non-native, and everything else.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • If ContraintProvider is the future, then how does it support changing the rules after everything's been compiled? – Elec0 Feb 27 '22 at 01:38