Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-253

Solver configuration must be able to use KieSession defined in kmodule.xml

    XMLWordPrintable

Details

    Description

      Currently we support scoring function in the form of DRL, defined as follows:

      <scoreDirectorFactory>
          ...
          <scoreDrl>some.drl</scoreDrl>
      </scoreDirectorFactory>
      

      What I would like to be able to do is something like this:

      Proposal A) - Rejected in favor of B (see https://github.com/droolsjbpm/optaplanner/pull/82#issuecomment-103377504 for motivation)

      <scoreDirectorFactory>
          ...
          <scoreKjar>org.foo:bar:1.0</scoreKjar> <!-- Maven GAV -->
      </scoreDirectorFactory>
      

      This means two things:

      • I can either include a kjar from the Business Central.
      • Or I can include a kjar from Maven. (Including -SNAPSHOTs.)

      Either of the two will allow me to deploy the same solver on different rulebases without recompiling, and to create some distribution mechanisms around the scoring rules.

      Proposal B) The solverConfig.xml is a resource of a kjar, so it's part of the KContainer and automatically has access to the KContainer.

      Proposal B1)

      <scoreDirectorFactory>
          ...
          <ksessionName>ksession1</ksessionName> <!-- References a ksession name in kmodule.xml -->
      </scoreDirectorFactory>
      

      Proposal B2)

      <scoreDirectorFactory>
          ...
          <kbaseName>kbase1</kbaseName> <!-- References a kbase name in kmodule.xml -->
      </scoreDirectorFactory>
      

      Attachments

        Issue Links

          Activity

            People

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: