sheriff patrol: droolsjbpm-integration: failing tests
by Michael Anstis
The following tests fail on both master and 5.2.x branch:-
- org.drools.camel.component.XStreamBatchExecutionTest.testQuery
[drools-camel]
- org.drools.runtime.pipeline.impl.XStreamBatchExecutionTest.testQuery
[drools-pipeline]
They have been @Ignored on master for some time and I have ignored them on
5.2.x now too.
AFAIK, something in the land of "queries" has broken them. Since there has
been a lot of change in this area for BC it might be best somebody else
investigate the tests and provide a remedy.
Cheers,
Mike
13 years, 3 months
On the validity of drools-5.2.xsd.
by Mats Erik Andersson
Dear all,
below "drools-compiler/src/../META-INF/" lies the XML Schema
"drools-5.2.xsd". After a removing the namespace "drools",
which makes it an invalid schema, and the trivial update
of some XML rule files to rerer to "5.2" instead of "5.0",
there is a persistent problem that the logical model presently
encoded in "drools-5.2.xsd" still fails to validate
test_ParseAccumulate.xml
test_ParseLhs.xml
test_ParseRule.xml
test_SimpleRule1.xml
All of which are found in
drools-compiler/src/test/resources/org/drools/compiler/xml/rules/
QUESTION: Are all XML rule files stored in that directory
supposed to correct, and are as such supposed to
be valid by whatever XML Schema is developed?
The answer to this question is instrumental for my prospects of
reformulating the schema into something usable and valid! If the
answer is "Yes", then the schema needs several changes, otherwise
any intended invalid ingredient in an XML rule file must be properly
documented, not tacitly be maintained in a status quo.
I can in passing pin-point one issue of the present schema, which
in itself does not resolve all problems, but might convince you that
not all matters are well with the present formulation.
The available schema prefers to use <xs:choice> whenever the human
logic indicates so. However, it also combines this with <xs:extension>
to construct composite types. This technique has a pitfall:
* Extending a sequence by a second sequence, results in
a combined sequence. (Expected by a layman.)
* Extending a choice by a second choice, results in a (short)
sequence of independent choices, choices which both have to be made!
(Beware of unwanted consequences!)
The expectation that an extension of choices should produce a (larger)
combined choice is not the way the XML Schema implementation has
been done. This must be taken into account.
Please, do give me feed-back on my question, should you consider
yourself authoritative enough.
Best regards,
Mats Andersson
13 years, 3 months
A dotty bug
by Wolfgang Laun
Consider these six variations of a pattern constraint:
$a: Student( $someStudent.name != null )
$b: Student( $someStudent .name != null )
$c: Student( $someStudent. name != null )
$d: Student( $someStudent.getName() != null )
$e: Student( $someStudent .getName() != null )
$f: Student( $someStudent. getName() != null )
Where is the bug - surely a space next to a separator can't do any harm? But
indeed - $c is flagged with a not very helpful error message: "Unable to
build constraint as ' name' is invalid".
Now, what about $d, $e and $f? Is it also $f, b with the space after the
dot, which is flagged?
Surprise, surprise: here it is $e that's pilloried with a lot of
gobbledegook (note the invented "method" $someStudent):
Unable to Analyse Expression $someStudent .getName() != null:
[Error: unable to resolve method using strict-mode:
add2map.Student.$someStudent()]
[Near : {... $someStudent .getName() != nul ....}]
More fun of this kind is to be had from similar expressions on the RHS,
especially when dialect "mvel" is set.
Cheers
Wolfgang
13 years, 3 months
Cast-away bug
by Wolfgang Laun
This rule
rule "test"
when
$l : ArrayList() from collect (MyClass (attribute == false));
then
for(Object o : new ArrayList( $l )) {
MyClass o2 = (MyClass) o;
modify(o2) { setAttribute(true) }
}
end
does not compile: The method setAttribute(boolean) is undefined for the
type Object
This, however, works:
modify( (MyClass)o) { setAttribute(true) }
Explanation?
-W
13 years, 3 months