Bug 1266076 - DSL sentences not working in guided rule templates
Summary: DSL sentences not working in guided rule templates
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: CR1
: 6.2.0
Assignee: manstis
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-24 12:25 UTC by Zuzana Krejčová
Modified: 2020-03-27 20:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:02:02 UTC
Type: Bug


Attachments (Terms of Use)

Description Zuzana Krejčová 2015-09-24 12:25:19 UTC
Description of problem:
DSL sentences in guided rule templates cause validation errors, project cannot be built. Source looks correct though.


Version-Release number of selected component (if applicable):
6.2 ER3


Steps to Reproduce:
1. Create a data object: Fact with String field
2. Create a simple dsl definition: [when]There is a Fact with=f : Fact()
3. Create a guided rule template, add (non-dsl) constraint on Fact.field, bind it to a template key.
4. In the Data tab, add a new row, fill in some value.
5. Save and validate the template -> everything is fine.
6. Add the dsl sentence 'There is a Fact with' (from step 2), save, validate.


Actual results:
Validation Errors:
[ERR 102] Line 6:2 mismatched input '>' in rule "rtemplate_0"
Parser returned a null Package


Expected results:
Validation passed.


Additional info:
Source looks as expected - "There is a Fact with" in the guided editor is turned into "f : Fact()" in the Source tab.

There is no such trouble with guided rules, just rule templates.

Comment 3 Toni Rikkola 2015-10-23 14:11:27 UTC
The problem is that we only generate DRL from the templates, without translating the DSL parts to DRL. The guided template editor should have never allowed the user to add DSL. Based on the code this has never worked.

My first fix attempt was to translate the DSL in the knowledge builder. While this works if there is DSL in the file, it breaks the build if there is not. We have this similar issue with decision tables that have DSL. The plan is to group this fix with that work.

Comment 4 Petr Široký 2015-10-28 21:13:14 UTC
Fixed by detecting if templates contain DSL sentences. If they do, the generated source is treated as DSLR, otherwise as standard DRL.

6.3.x:
https://github.com/droolsjbpm/drools/commit/e88a97ee84

master:
https://github.com/droolsjbpm/drools/commit/6bc7cdb4a8

Comment 5 Zuzana Krejčová 2015-11-03 16:05:59 UTC
The e88a97 commit didn't make it into the product it seems.

Comment 6 Petr Široký 2015-11-03 17:39:39 UTC
Correct, the commit is not part of 6.2.0.ER5.

@Ryan, I guess you take the cutoff date and consider BZs according to that. However, the cut off date does not really say at which time we actually branched, so there is several hours where the commits can be pushed into the branch, but won't make it into the tag. Is there any way to fix this?

Comment 7 rekha 2016-07-22 07:04:25 UTC
I am facing this issue drool workbench in 6.3 version. Is this issue is not resoled in in 6.3 version?

Issue- When I create rule in Guided Rule Template with DSL in “When” and “Then” condition it very much shows in the “SOURCE” tab but not in the “DATA” tab columns where table is created.


Note You need to log in before you can comment on or make changes to this bug.