Red Hat Bugzilla – Bug 1267510
Not able to execute rules from guided decision table if we build kjar through mvn command.
Last modified: 2016-02-25 07:00:33 EST
Created attachment 1078565 [details]
Description of problem:
if we build kjar through business central console and try to execute rule through standalone code, it works fine. If we build same kjar through maven command then rule is not executed through same standalone code.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a new project in Business Central, in this project create guided decision table, and build kjar from console.
2.Execute the rules using the kjar generated by the workbench.(Verify all rules executed)
3.Checkout the project from the Business Central Git Repository and build using maven command.
4. Execute the rule using the KJAR generated by maven.Notice that the Guided rules do not execute.
Rules from guided decision table are not executed if we build kjar through mvn command.
Rules from guided decision table should be executed if we build kjar through mvn command.
Reproducer is attached.
This is related with (if not a duplicate of) https://bugzilla.redhat.com/show_bug.cgi?id=1209949 so I'm reassigning this to Michael.
As discussed with Mario and Mike, there are missing Drools converter jars in the kie-maven-plugin. I will add those to make the guided dtables (and other similar assets) compile successfully.
There is one more related issue. In some cases we also need to add some dependencies directly to the kjar's pom.xml in case they are needed during Java compile phase (done by maven-compiler-plugin). Few example (there are likely more):
- when using KIE annotations like @Position or @KBase, the project needs direct dependency on kie-api.
The best way to do this seems to be to add the deps into the pom, but only with <provided> scope so that we don't leak those dependencies to other projects depending on kjars. Kjars are then used by other kjars or applications which will responsible to provide correct set of dependencies itself.
Finally fixed and merged into master and 6.3.x.
The root cause was hidden in drools-compiler, as some resources (like .gdst) were not treated as regular KIE resources. That would lead to the case where the .gdst wasn't compiled at all. The fix introduces two new KIE resources -- GDST (guided dtable) and SCGD (guided score card). kie-maven-plugin now supports these as well.
Verified using BxMS 6.2.1.
Note: It is necessary to add dependency on "drools-workbench-models-guided-dtable" to "pom.xml" in reproducer.