Closing the loop.
Implemented as proposed and seconded by Wolfgang with the additional nicety of also checking for common auto-corrections in spreadsheet applications (left-quote/right-quote replacing double-quote etc).
Also ensured guided templates, guided decision tables and XLS decision tables all work consistently with empty cells and empty Strings.
Sent on the move
On 01/08/2014, Michael Anstis <michael.anstis@gmail.com> wrote:
> I propose the following:
>
> - For a Pattern, with no constraints we exclude the pattern (this is
> current XLS behaviour).
>
> e.g. Person( name == $name, age == $age ). If we don't provide values for
> $name and $age we don't include the Person pattern. If a user wants to
> include the Pattern they'd need to add a constraint "this != null".
>
> If we include the pattern when there are no constraints then it is more
> difficult to provide a work-around to exclude the pattern if this is what
> some users need (and since it's the existing behaviour; less likely to be
> an issue for the majority of XLS users).
>
>
> - Support escaping String literals with quotes; so a user would enter ""
> or " ". This make it obvious that the cell contains a non-null value.
> The
> surrounding quotation marks would be stripped before being used in the
> DRL.
If the first character is not the quote character (0x22), assume that
the value in the cell is the actual value of a String. The result to
be used in DRL code will be quoted, and all characters will be escaped
as required according to Java rules.
If the first character is a quote character (0x22), assume that the
value in the cell is a complete String literal, according to Java
rules. It will be used "as is" in DRL code.
my 2¢
Wolfgang
>
>
> WDYT? Should I put this out to the community for opinions too?
>
> With kind regards,
>
> Mike
>
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev