{"action":"created","issue":{"url":"https://api.github.com/repos/droolsjbpm/optaplanner/issues/82","labels_url":"https://api.github.com/repos/droolsjbpm/optaplanner/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/droolsjbpm/optaplanner/issues/82/comments","events_url":"https://api.github.com/repos/droolsjbpm/optaplanner/issues/82/events","html_url":"https://github.com/droolsjbpm/optaplanner/pull/82","id":72115425,"number":82,"title":"Added feature that allows loading Drools rules from a KJAR via kie-ci (i...","user":{"login":"DuncanDoyle","id":875822,"avatar_url":"https://avatars.githubusercontent.com/u/875822?v=3","gravatar_id":"","url":"https://api.github.com/users/DuncanDoyle","html_url":"https://github.com/DuncanDoyle","followers_url":"https://api.github.com/users/DuncanDoyle/followers","following_url":"https://api.github.com/users/DuncanDoyle/following{/other_user}","gists_url":"https://api.github.com/users/DuncanDoyle/gists{/gist_id}","starred_url":"https://api.github.com/users/DuncanDoyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DuncanDoyle/subscriptions","organizations_url":"https://api.github.com/users/DuncanDoyle/orgs","repos_url":"https://api.github.com/users/DuncanDoyle/repos","events_url":"https://api.github.com/users/DuncanDoyle/events{/privacy}","received_events_url":"https://api.github.com/users/DuncanDoyle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-30T09:54:47Z","updated_at":"2015-05-19T07:20:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/droolsjbpm/optaplanner/pulls/82","html_url":"https://github.com/droolsjbpm/optaplanner/pull/82","diff_url":"https://github.com/droolsjbpm/optaplanner/pull/82.diff","patch_url":"https://github.com/droolsjbpm/optaplanner/pull/82.patch"},"body":"....e. Maven GAV).\r\n\r\nGeoffrey, as discussed, an initial version of the feature that allows one to load score rules from a Drools KJAR via Maven (kie-ci and Maven GAV). Including unit-tests ;-)\r\n\r\nTo use it in, for example, the cloud-balancing example, you would need to externalize the score rules in a KJAR and reference the KJAR from the solver config like this:\r\n\r\n```xml\r\n<!-- Score configuration -->\r\n<scoreDirectorFactory>\r\n    <scoreDefinitionType>HARD_SOFT</scoreDefinitionType>\r\n    <scoreKJarReleaseId>\r\n    \t<groupId>org.optaplanner.example.cloudbalancing</groupId>\r\n    \t<artifactId>CloudBalancingRules</artifactId>\r\n    \t<version>1.0.0</version>\r\n    </scoreKJarReleaseId>\t\r\n    <initializingScoreTrend>ONLY_DOWN</initializingScoreTrend>\r\n</scoreDirectorFactory>\r\n```"},"comment":{"url":"https://api.github.com/repos/droolsjbpm/optaplanner/issues/comments/103377504","html_url":"https://github.com/droolsjbpm/optaplanner/pull/82#issuecomment-103377504","issue_url":"https://api.github.com/repos/droolsjbpm/optaplanner/issues/82","id":103377504,"user":{"login":"ge0ffrey","id":176880,"avatar_url":"https://avatars.githubusercontent.com/u/176880?v=3","gravatar_id":"","url":"https://api.github.com/users/ge0ffrey","html_url":"https://github.com/ge0ffrey","followers_url":"https://api.github.com/users/ge0ffrey/followers","following_url":"https://api.github.com/users/ge0ffrey/following{/other_user}","gists_url":"https://api.github.com/users/ge0ffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ge0ffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ge0ffrey/subscriptions","organizations_url":"https://api.github.com/users/ge0ffrey/orgs","repos_url":"https://api.github.com/users/ge0ffrey/repos","events_url":"https://api.github.com/users/ge0ffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ge0ffrey/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T07:20:37Z","updated_at":"2015-05-19T07:20:37Z","body":"Bad news, @DuncanDoyle : perfect code, but me and Lukas have just come to the conclusion that our feature requirement is faulty. Let me explain:\r\n\r\n- To author rules the domain model most be available. So to other a \"CPU capacity hard constraint\" rule, the \"Process\" and \"Computer\" classes must be in the classpath. This means the domain classes are included in the kjar (or a dependency of the kjar).\r\n- If the domain classes are included in the kjar, OptaPlanner either needs to load them from the kjar (which it currently doesn't do) or optaplanner's solver xml should be part of the kjar itself. \r\n- In OptaPlanner Workbench (which will be part of Business Central), it will be possible to design the domain model and add OptaPlanner annotations. It will also be possible to author a solver xml.\r\n\r\nThis means we will end up with 2 different ways of doing the same thing:\r\nA) OptaPlanner solver xml (not in a kjar) that can use score rules (and domain classes??) from a kjar. \r\nB) Kjar that contains domain classes, score rules AND solver xml.\r\n\r\nOne of the design philosophies is not to expose the user to 2 different ways to do the same thing if 1 way is consistently superior to the other way. Basically KISS principle. I believe B) (once implemented...) will be superior to A) at which point having to keep A) for backwards compatibility support is undesired...\r\n\r\nNevertheless, this PR isn't a waste:\r\n- I 'll reuse the testing code (it's great!) for testing B)\r\n- This PR has made us realize the problem of our feature requirement (again, not in your code). During research, failure is also a good result."}}