MVEL fails at analyzing the condition input == "a", I suspect it
confuses "input" with "input.class",
which of course is different from the literal "a". The alpha constraint
is then reduced to "false",
and no rule will fire. An edge case, but a bug.

HOWEVER, I would recommend to follow the java best practices and naming
conventions.
"declare" is effectively defining a new class, so you should rename it
Input, which will also
avoid the problem.

Davide

On 10/22/2013 05:45 PM, richie wrote:
> declare input
> input : String
> end
>
> declare output
> taskname : String
> end
>
> rule "Rule A"
> dialect "mvel"
> salience 0
> no-loop
> when
> $input:input(input == "a")
> $output:output()
> then
> modify ($output) {taskname = "Hello"};
> end

But if I created a fact object of input and set attribute input to "a", it
did not fire any rules.

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to