Every DSL template phrase must be written on a single line. That's just how the syntax
works.
Hence why I do unfortunately have lines of DSL that are over 1000 characters long. :(
Steve
On 27 Aug 2013, at 19:14, Stefan <stefan(a)schiffer.at> wrote:
I have written a simple DSLR-rule with a rather long sentence in the
when-part:
-----------------------------------------------------------------
rule "NR3620"
when
tariff number of a position starts with "0301" and the duty measure
is one of "112", "122", "142", "141",
"143" and code of condition is "M" and
customs value of position is less than the reference value of condition
then
Error F3620
end
-----------------------------------------------------------------
When I try to break up the sentence into serveral lines for better
readability I get an error. This does not word:
-----------------------------------------------------------------
rule "NR3620"
when
tariff number of a position starts with "0301" and
the duty measure is one of "112", "122", "142",
"141", "143" and
code of condition is "M" and
customs value of position is less than the reference value of
condition
then
Error F3620
end
-----------------------------------------------------------------
Here is the corresponding expander (line breaks at the lhs of the 5th
when-clause are ok!):
-----------------------------------------------------------------
[when]condition code=condCode
[when]customs value=custValue
[when]reference value=condAmount
[when]less than=<=
[when]
tariff number of a position starts with {tariffNumberPrefix} and
the duty measure is one of {dutyMeasureCodes} and
code of condition is {conditionCode} and
{propPosition} of position is {comparator} the {propCondition} of condition
=
$measure: DutyMeasure(
tariffCode str[startsWith] {tariffNumberPrefix},
addCodeNumber in ({dutyMeasureCodes})
);
$condition: Condition(
condCode == {conditionCode}
)
$position: ImportPosition(
tariffNumber str[startsWith] {tariffNumberPrefix},
{propPosition} {comparator} $condition.{propCondition}
);
[then]
Error {code} = System.out.println("{code}");
-----------------------------------------------------------------
Any idea how to break up the long DSL-sentence into several lines?
Thx Stefan
--
View this message in context:
http://drools.46999.n3.nabble.com/Line-breaks-in-DSLR-tp4025707.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users