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)
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();
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3354 to Resolved
Edson Tirelli <ed.tirelli> made a comment on jira JBRULES-3354 Done.
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3354 to Closed
Fixed. Thanks.
It is fixed now. Thank you Edson
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.
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>
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<?> from(); </screen> <para> To:
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<PatternDescrBuilder<P>> from();</screen> <para>
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.