Bug 1000403
Summary: | Functions not recognized | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Jiri Locker <jlocker> | ||||||
Component: | Migration Tool | Assignee: | Neus Miras <nmirasch> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Jiri Svitak <jsvitak> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 6.0.0 | CC: | etirelli, jsvitak, mbaluch, pzapataf, trikkola | ||||||
Target Milestone: | ER1 | Keywords: | TestBlocker | ||||||
Target Release: | 6.0.1 | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Known Issue | |||||||
Doc Text: |
Cause: Using a DRL function in any guided rule.
Consequence: The rule using function declared in a DRL file cannot be validated successfully.
Workaround (if any): None.
Result:
|
Story Points: | --- | ||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2014-08-06 19:58:56 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Jiri Locker
2013-08-23 11:44:12 UTC
Hello, Functions are created as plain DRL in 6.0.x (there is no explicit "New Function"). Functions should appear under the "DRL" section in Project Explorer. I checked operation of creating a new function and rule with 6.0.x (in the mortgages project):- func1.drl --------- function String hello(String name) { return "Hello "+name+"!"; } rule1.drl --------- rule "using a static function" when eval( true ) then System.out.println( hello( "Bob" ) ); end Both Validated OK (after a fix I've made; see below) and the Project built OK. I'll assign this to Jervis to check data-migration; but since (AFAIK) data migration is not supported as part of the Productization think this BZ is no longer a blocker. @Jervis, Could you please check functions in 5.x are migrated as .drl in 6.0.x (I had a quick look at the code and it appears to do so; but Jiri is reported a migrated function appears under "Other" and not "DRL" in Project Explorer). @Jiri, Can you try migrating your test project again (in case there have been other fixes that ensure functions are migrated as DRL). Thanks. Verified in BRMS 6 ER7. I've used Michael's steps from comment #2. Rule validation didn't produce any error nor the project deployment operation. Function are correctly listed in 'DRL' section as is should be. I've tried also to use Guided rule editor and the problem persists: Unable to Analyse Expression System.out.println( hello( "Bob" ) );: [Error: unable to resolve method using strict-mode: org.drools.core.spi.KnowledgeHelper.hello(java.lang.String)] [Near : {... System.out.println( hello( "Bob" ) ); ....}] ^ [Line: 3, Column: 0] (I've used free form drl.) Created attachment 850483 [details]
5.6.1 repository with the example
Created attachment 854352 [details]
5.6.1 repository with the example, just the repo zipped
The package reference is now added to the header of the function. It is done in this commit: 6.0.x https://github.com/droolsjbpm/drools-wb/commit/e23b8ce96de630429c59aca4592caaa494da2046 After this change the function passes the DRL validation but not the Guided editor rule validation. I've tried a DRL with the same code and it works right. I've tried to create a new function and I've got the same error message using that from the guided rule editor. It seems to be related to the strict-validation more than the migrated data. Guided Rule Editor's validation call probably doesn't include DRL files. See https://github.com/droolsjbpm/drools-wb/blob/master/drools-wb-screens/drools-wb-guided-rule-editor/drools-wb-guided-rule-editor-backend/src/main/java/org/drools/workbench/screens/guided/rule/backend/server/GuidedRuleEditorServiceImpl.java#L288 DRLs need to be included too. The same problem probably occurs for Guided Templates and Guided Decision Tables. Fixed at commits: Master: kie-wb-common https://github.com/droolsjbpm/kie-wb-common/commit/bdd0f9e27f0f9481bee6a1a4e95adbbc052b50ab drools-wb https://github.com/droolsjbpm/drools-wb/commit/5e98b7a6b4719bfabbc7e55f79b450184b6340de 6.0.x kie-wb-common https://github.com/droolsjbpm/kie-wb-common/commit/f7192ade569faf866ca019858b3eba6686ddccee drools-wb https://github.com/droolsjbpm/drools-wb/commit/cb91b39a6ddc4fb54210d5df1fb701dce89e24c5 This no longer has a target release of 6.0.0. I have tested again with BPMS 6.0.1.ER1, drl files pass, guided rules now work too as well. QE test suite currently covers only drl files, so updating the qe_test_coverage flag. For further functions issues please file rather a new BZ. Verified. |