| Summary: | DSL transformation function a?b/c can't use = sign in replacements | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Tomas Schlosser <tschloss> | ||||||
| Component: | BRE | Assignee: | Edson Tirelli <etirelli> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Tomas Schlosser <tschloss> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | unspecified | CC: | etirelli, mfusco, mwinkler | ||||||
| Target Milestone: | ER1 | ||||||||
| Target Release: | 6.0.1 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-08-06 19:57:49 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: | |||||||
| Attachments: |
|
||||||||
I have just narrowed the problem. It appears that the exception does not depend on how many nested transformations are used, but rather by use of '=' sign. No matter on which position it appears (or if there are actually more than one transformations).
These expressions work:
[when]- with a {what} {attr}={attr} {what!positive?>0/EROOR}
[when]- with a {what} {attr}={attr} {what!positive?>0/negative?<0/EROOR}
These do not:
[when]- with a {what} {attr}={attr} {what!zero?==0/!=0}
[when]- with a {what} {attr}={attr} {what!positive?>0/==0}
[when]- with a {what} {attr}={attr} {what!positive?>0/negative?<0/zero?==0/EROOR}
I'll also include the dsl and dslr used to test this.
Created attachment 805894 [details]
Dslr used for testing the bug
Created attachment 805895 [details]
Dsl used for testing the bug
Contains valid DSL expression. To reproduce the bug, simply change the fifth line to whatever is in the bug report.
I added a test case reproducing the problem https://github.com/droolsjbpm/drools/commit/f080cc297 Fixed. (master): https://github.com/droolsjbpm/drools/commit/64501a22e38c14c3e525df0dc2b517cc5de0448d (6.0.x): https://github.com/droolsjbpm/drools/commit/2d1d9769050133a8c68220a0022ca2dfa5c6a092 Verified in Brms 6.0.1.ER1 |
Description of problem: Trying the example in Drools Expert user guide does not work. If you use only one triplet, it works as described in documentation (the string is compared to a and if they are equal it returns b, otherwise it returns c). However if more there is another triplet in c, it throws compilation error. Version-Release number of selected component (if applicable): BRMS 6.0.0.ER3 How reproducible: # definitions for conditions [when][]There is an? {entity}=${entity!lc}: {entity!ucfirst}() [when][]- with an? {attr} greater than {amount}={attr} <= {amount!num} [when][]- with a {what} {attr}={attr} {what!positive?>0/negative?%lt;0/zero?==0/ERROR} Steps to Reproduce: 1. create a new DSL including lines mentioned above 2. compile a kie base Actual results: Message [id=1, level=ERROR, path=null, line=5, column=0 text=DSL parser error] Message [id=2, level=ERROR, path=null, line=5, column=0 text=DSL parser error] Expected results: compilation goes without error, expressions are expanded correctly Additional info: