[rules-users] Accessing List<String> with mvel in condition
Wolfgang Laun
wolfgang.laun at gmail.com
Mon Jun 27 12:18:40 EDT 2011
The rule should be called "B Number consists of a single character that is
not a digit".
In patterns, "[...]" means a single character, and matches succeeds if all
of the target string matches the pattern.
Try
... matches ".*[^0-9].*"
-W
On 27 June 2011 15:41, esstrata <esstrata at yahoo.es> wrote:
> Hi,
>
> I've tried several options but none working so I welcome any help.
>
> * I'm using Drools 5.1.1.
> * I succesfully insert several List<String> into Working Memory and I'm
> able
> to printout them with a debug rule.
> * The problem is, when I try to access a position in a list I get no match
> even though I have values that should match. Here is the relevant code:
>
> rule "B Number has characters other than numbers"
> dialect "mvel"
> when
> $traffic_row : List(this[5] matches "[^0-9]")
> then
> System.out.println("row found" + $traffic_row)
> end
>
>
> Thank you in advance
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Accessing-List-String-with-mvel-in-condition-tp3113685p3113685.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110627/9b96ad3a/attachment.html
More information about the rules-users
mailing list