Skip to content

Commit

Permalink
JBRULES-3087 NPE in PatternBuilder due to missing field position numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
mdproctor committed Jun 23, 2011
1 parent 8892222 commit 0b0ce66
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Expand Up @@ -73,6 +73,23 @@ for ( QueryResultsRow row : results ) {
System.out.println( person.getName() + "\n" );
}</programlisting>

<para>Support for positional syntax has been added for more compact code.
By default the the declared type order in the type declaration matches the
argument position. But it possible to override these using the @position
annotation.</para>

<programlisting>declare Cheese
name : String @position(1)
shop : String @position(2)
price : int @position(0)
end
</programlisting>

<para>The @Position annotation, in the org.drools.definition.type package,
can be used to annotate original pojos on the classpath. Currently only
fields on classes can be annotated. Inheritence of classes is supported,
but not interfaces of methods yet.</para>

<para>Queries can now call other queries, this combined with optional
query arguments provides deriviation query style backward chaining.
Positional and mixed positional/named type is supported. Literal
Expand Down
Expand Up @@ -220,7 +220,20 @@
two more defined for the name attribute (<code>@key</code> and
<code>@maxLength</code>). Please note that the <code>@key</code> metadata
has no required value, and so the parentheses and the value were
omitted.</para>
omitted.:</para>

<para>@position can be used to declare the position of a field, overriding
the default declared order. This is used for positional constraints in
patterns.</para>

<programlisting>declare Cheese
name : String @position(1)
shop : String @position(2)
price : int @position(0)
end
</programlisting>

<para></para>
</section>

<section>
Expand Down

0 comments on commit 0b0ce66

Please sign in to comment.