java - Regular expression in Drools -


i keep getting compile errors when try write rules.

i trying translate condition drools

if(model.type.series != null && model.type.series.name.mathes(".*fanr.*") ||                        model.type.series.name.matches(".*sana.*"))     //do something.... 

this have...

rule "rule 01" salience 0         when             m : model(type.series != null,                        type.series.name.matches(".*fanr.*") ||                        type.series.name.matches(".*sana.*")              : result(state == result.good )                a.setstate(result.bad);           .... end 

what trying use regular expression match part of string 'name' string type. fair new drools don't see can cause problems, appreciated

use correct drools syntax, according matches operator, described in drools manual.

rule fanrorsana when     $n: model($v: type.series.name matches ".*(fanr|sana).*") 

and can use power of regular expressions testing alternatives.


Comments

Popular posts from this blog

php - mysql multiple keyword search in any order -

routing - AngularJS State management ->load multiple states in one page -

unity3d - Problems porting a GLSL shadertoy shader to unity -