Bug 727784 - Unable to construct expressions containing 'from' using Rules API
Summary: Unable to construct expressions containing 'from' using Rules API
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.2.0-ER1
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: Edson Tirelli
QA Contact: Tomas Schlosser
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-03 08:48 UTC by Tomas Schlosser
Modified: 2012-06-15 00:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, an error prevented rules using the API from including 'from' in the Rule. This has been resolved by changing a line of code in drools/drools-compiler/src/main/java/org/drools/lang/api/PatternDescrBuilder.java:</para> <para> From: </para> <screen> public SourceDescrBuilder&lt;?&gt; from(); </screen> <para> To: </para> <screen>public SourceDescrBuilder&lt;PatternDescrBuilder&lt;P&gt;&gt; from();</screen> <para>
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-3354 None Closed Unable to construct expressions containing 'from' using Rules API 2012-06-15 00:08:41 UTC

Description Tomas Schlosser 2011-08-03 08:48:26 UTC
Description of problem:
When trying to construct a new rule containing 'from' I can't continue constructing the rule due to error:
"The method rhs(String) is undefined for the type capture#3-of ?"

How reproducible:
KnowledgeDescr descr =
    DescrFactory.newPackage().name("org.jboss.qa.drools.rulesapi")

    .newDeclare().type("String")
    .newAnnotation("role").value("event").end()
    .end()

    .newRule().name("from rule")
    .lhs()
    .pattern("String").id("s", false).from().entryPoint("EventStream").end()
    .end()
    .rhs("System.out.println(")

    .end().getDescr();


Additional info:
The end() after pattern doesn't help (neither removing, nor adding more)

Comment 1 Tomas Schlosser 2011-08-04 07:54:06 UTC
Just a little change is required:
drools/drools-compiler/src/main/java/org/drools/lang/api/PatternDescrBuilder.java

change:
45:    public SourceDescrBuilder<?> from();

to:
45:    public SourceDescrBuilder<PatternDescrBuilder<P>> from();

Comment 2 JBoss JIRA Server 2012-01-19 22:06:44 UTC
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira JBRULES-3354 to Resolved

Comment 3 JBoss JIRA Server 2012-01-19 22:06:44 UTC
Edson Tirelli <ed.tirelli@gmail.com> made a comment on jira JBRULES-3354

Done.

Comment 4 JBoss JIRA Server 2012-01-19 22:06:51 UTC
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira JBRULES-3354 to Closed

Comment 5 Edson Tirelli 2012-01-19 22:07:17 UTC
Fixed. Thanks.

Comment 7 Tomas Schlosser 2012-01-30 14:27:09 UTC
It is fixed now. Thank you Edson

Comment 8 lcarlon 2012-05-03 02:56:18 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, an error prevented rules using the API, from including 'from' in the Rule.

Comment 9 lcarlon 2012-05-30 05:33:51 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,12 @@
-Previously, an error prevented rules using the API, from including 'from' in the Rule.+Previously, an error prevented rules using the API from including 'from' in the Rule. This has been resolved by changing a line of code in drools/drools-compiler/src/main/java/org/drools/lang/api/PatternDescrBuilder.java:</para>
+<para>
+From:
+</para>
+<screen>
+public SourceDescrBuilder<?> from();
+</screen>
+<para>
+To:
+</para>
+<screen>public SourceDescrBuilder<PatternDescrBuilder<P>> from();</screen>
+<para>

Comment 10 lcarlon 2012-06-15 00:02:39 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -3,7 +3,7 @@
 From:
 </para>
 <screen>
-public SourceDescrBuilder<?> from();
+public SourceDescrBuilder&lt;?&gt; from();
 </screen>
 <para>
 To:

Comment 11 lcarlon 2012-06-15 00:08:35 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -8,5 +8,5 @@
 <para>
 To:
 </para>
-<screen>public SourceDescrBuilder<PatternDescrBuilder<P>> from();</screen>
+<screen>public SourceDescrBuilder&lt;PatternDescrBuilder&lt;P&gt;&gt; from();</screen>
 <para>


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