Re: [rules-users] create .pkg file with or without BRMS

2007-11-15 Thread Arnaud B


Yes, exactly:DroolsCompilerAntTask generates a serialized RuleBase.
So, i can't generate the same pkg file with drools-ant and with BRMS

so is there a way to generate a .pkg file without BRMS ? 



LNguyen wrote:
 
 I think the DroolsCompilerAntTask generates a serialized RuleBase, not a
 Package.
 
 Linh
 
 
 Arnaud Bouzinac wrote:
 
 Hi,
 
 I'm using BRMS to generate a .pkg for an application
 
 i need to generate the same file without BRMS:
 i'm trying to use a drools-ant task, but, pkg file generated with
 drools-ant
 task is not the same !!!
 i don't found a specific documentation to do that ?
 
 Somebody can help me please ?
 
 thanks for your help
 
 project default=rules
 property name=eclipsepath  value=/
 
 path id=qirules.classpath
 pathelement location=${eclipsepath}../install/*/
 /path
 
 path id=drools.classpath
 fileset dir=${eclipsepath}../
 include name=**/*.jar/
 /fileset
 pathelement location=target/
 /path
 
 taskdef name=rulebase classname=
 org.drools.contrib.DroolsCompilerAntTask classpathref=drools.classpath
 /
 
 target name=rules 
 rulebase
 srcdir=${eclipsepath}../rules/
 tofile=${eclipsepath}../rules/FLIResultsUpdateRules.pkg
 classpathref=qirules.classpath 
 include name=*.drl /
 /rulebase
 /target
 
 /project
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/create-.pkg-file-with-or-without-BRMS-tf4803289.html#a13763405
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Another rule vendor being acquired

2007-11-15 Thread Michael Neale
Excellent work Paul !

As an Australian, I am quite proud that it is RuleBurst ! I have met a few
of them and they are great people with an interesting product.

On Nov 15, 2007 7:07 AM, Paul Haley [EMAIL PROTECTED] wrote:

  I hope it is interesting to the community to consider the second business
 rules vendor acquisition within the last 30 days.



 Haley Systems (www.haley.com), the company that I founded many years ago
 (hopefully, some of you have heard of it!), is in the process of being
 acquired by Ruleburst.  I am not going with the acquisition but have started
 up my own vendor neutral business practice in which I anticipate helping
 improve and support Drools and the emerging standards in rules and web
 semantics.



 See
 http://www.ad-hoc-news.de/CorporateNews/en/14178920/RuleBurst-Acquires-US-Business-Rules-Technology-Vendor



 Regards,

 Paul







 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
Michael D Neale
home: www.michaelneale.net
blog: michaelneale.blogspot.com
image002.jpg___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to get the Eclipse Rules View to show my rules?

2007-11-15 Thread Kris Verlaenen
Did you try cleaning your entire project? Or maybe even re-import the 
project in eclipse?
Occasionally it happens that an eclipse project gets messed up in some way 
...


If this fails, could you open a JIRA with a selfcontained sample eclipse 
project showing the error? I'll try to take a look then.


Kris

- Original Message - 
From: LNguyen [EMAIL PROTECTED]

To: rules-users@lists.jboss.org
Sent: Tuesday, November 13, 2007 11:53 PM
Subject: Re: [rules-users] How to get the Eclipse Rules View to show my 
rules?





Thanks for your reply.

After converting to a Drools project, I now get the Only a type can be
imported errors on all my import statements in the DRLs (and other errors
as consequences of that).  I compare the structures of my project to the
examples and can't find much different.

What do you think I'm still missing?

(As a Java project, the project still works fine.  All my jUnit tests 
still

run ok)

Thanks.
Linh



ekke wrote:


have you tried your-eclipse-project - right-click - convert to Drools
project ?
ekke

LNguyen wrote:


Hello everyone,

I'm using Drools 4.0.3 and Eclipse 3.3.  The Rules View shows the rules
in the drools-examples-drl package, but not my own rules.

Is there any configuration or registration needed for the Rules View to
recognize my rules?  The rest of Drools work fine.

TIA
Linh






--
View this message in context: 
http://www.nabble.com/How-to-get-the-Eclipse-Rules-View-to-show-my-rules--tf4800253.html#a13736443

Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users 


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Remotely debugging application server code

2007-11-15 Thread Marcus Ilgner
Hi list,

I'm experiencing problems when remotely debugging my JBoss-Rules-using
application running on an application server.
The application server is JBoss 4.2.1.GA and I connect to it via
Eclipse. My JBoss Rules version is 4.0.3.
As soon as I start inserting facts, the application seems to hang. The
debugger reports the status Running on all threads, however the
application does not seem to reach the next statement (which is a
logging statement).
When I disconnect the debugger, the execution resumes and everything works fine.
The displayed callstack when suspending the execution claims that the
execution has reached the next breakpoint, however I'm in doubt that
this is true and there's no way for me to resume the execution.

Maybe some of you have experienced something similar. I had no
problems at all debugging the code that does all the work before the
fact insertion. Only after starting to insert facts the debugging goes
awry.

Best regards
Marcus
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Classloader issues with webapp : No ClassLoaders found, Circular dependencies...

2007-11-15 Thread Julien Cassignol
Hello,

Following Mark's advice, I decided to mail about a problem I experienced
and managed to fix, with Mark's and Edson Tirelli's help.

I was trying to build a RuleBase with the following code :

final SpreadsheetCompiler converter = new SpreadsheetCompiler();
FileInputStream file = new FileInputStream(decTable);
final String drl = converter.compile(file, InputType.XLS);
System.out.println(drl);
Properties properties = new Properties();
properties.setProperty( drools.dialect.default,
java );
properties.setProperty(drools.compiler,JANINO);
PackageBuilderConfiguration conf = new
PackageBuilderConfiguration(properties);
PackageBuilder builder = new PackageBuilder( conf );
builder.addPackageFromDrl(new StringReader(drl));
Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);

Nothing difficult, but it was failing on the construction of
PackageBuilderConfiguration :

No ClassLoaders found for:
org.drools.rule.builder.dialect.java.JavaDialect

Followed by an unhelpful stack. 

Debugging my webapp (which sources I didn't have), I noticed that my
class ClassLoader was different from the thread one. The thread
classloader was the JBoss ClassLoader, and my class classloader was the
one of the webapp.

Setting the classloader of the thread manually to the classloader of my
webapp failed to cope with the problem, as the drools jars were
installed on Jboss, and drools instantiated object couldn't find core
objects within the classpath with the classloader of the webapp. To fix
the problem, I had to use the following code :

PackageBuilderConfiguration conf = new 
PackageBuilderConfiguration(
properties);
conf.setClassLoader(MyClass.class.getClassLoader());
RuleBaseConfiguration ruleBaseConf = new 
RuleBaseConfiguration();
ruleBaseConf.setClassLoader(MyClass.class.getClassLoader());

Setting the classloader property of the drools configuration objects
allowed me to use imports of local classes (I mean local to the webapp)
within rule packages, and solved my problem (or so it seems).

I hope this short explanation will help someone !
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] RE: Duplicate check using dialect(firing multiple times)

2007-11-15 Thread Edson Tirelli
Basha,

This is the correct behavior since both facts match both patterns (one
at a time). If you don't want them to fire 2 times, you need a way to tell
the engine there is an order on the facts. I.e., (A,B) is a valid tuple for
you, but (B,A) is not.
One way of doing that is if the facts have some ID attribute that can be
ordered:

$f1 : Message( $id1 : id, $m1 : message )
$f2 : Message( id  $id1, $m2 : message == $m1, eval( $f1 != $f2 ) )

If your facts have no attribute that allow a user to establish an order
between them, then the only way is to use java system id to do that:

$f1 : Message( $m1 : message )
$f2 : Message( $m2 : message == $m1, eval( System.identityHashCode(
$f1 )  System.identityHashCode( $f2 ) ) )

[]s
Edson

2007/11/15, Sikkandar Nawabjan [EMAIL PROTECTED]:

 Edson,

 With this code it is firing. But it is firing 2 times(u also got same 2
 time output). why is that? how we can avoid?

 Thanks and Regss,

 Basha







Sorry, my mistake. this is a reserved word in java (duh!!), and so
 you need to use your own binding:

 m : Message( $message1 : message )
 mdup : Message($message2:message==$message1,eval(mdup != m) )

You can't use mvel dialect, because in MVEL the operators == and !=
 will call the equals() method anyway.
Other than that, it is working just fine for me:

 rule Find duplicates
 salience 10
 when
 $f1 : Message( $m1 : message )
 $f2 : Message( $m2 : message == $m1, eval( $f1 != $f2 ) )
 then
 System.out.println( FIRED DUPLICATE: );
 System.out.println(   $f1 = +$f1+ [ message=+$m1+ ]  );
 System.out.println(   $f2 = +$f2+ [ message=+$m2+ ]  );
 end

 rule Find differents
 when
 $f1 : Message( $m1 : message )
 $f2 : Message( $m2 : message != $m1 )
 then
 System.out.println( FIRED DIFFERENT: );
 System.out.println(   $f1 = +$f1+ [ message=+$m1+ ] );
 System.out.println(   $f2 = +$f2+ [ message=+$m2+ ]  );
 end

 The code to insert facts is:

 Message message1 = new Message();
 message1.setMessage(  Hello World );
 workingMemory.insert( message1 );
 Message message2 = new Message();
 message2.setMessage(  Hello World );
 workingMemory.insert( message2 );
 Message message3 = new Message();
 message3.setMessage(  Hello Bob );
 workingMemory.insert( message3 );
 workingMemory.fireAllRules();

 And the result is:

 FIRED DUPLICATE:
   $f1 = [EMAIL PROTECTED] [ message=Hello World ]
   $f2 = [EMAIL PROTECTED] [ message=Hello World ]
 FIRED DUPLICATE:
   $f1 = [EMAIL PROTECTED] [ message=Hello World ]
   $f2 = [EMAIL PROTECTED] [ message=Hello World ]
 FIRED DIFFERENT:
   $f1 = [EMAIL PROTECTED] [ message=Hello Bob ]
   $f2 = [EMAIL PROTECTED] [ message=Hello World ]
 FIRED DIFFERENT:
   $f1 = [EMAIL PROTECTED] [ message=Hello World ]
   $f2 = [EMAIL PROTECTED] [ message=Hello Bob ]
 FIRED DIFFERENT:
   $f1 = [EMAIL PROTECTED] [ message=Hello Bob ]
   $f2 = [EMAIL PROTECTED] [ message=Hello World ]
 FIRED DIFFERENT:
   $f1 = [EMAIL PROTECTED] [ message=Hello World ]
   $f2 = [EMAIL PROTECTED] [ message=Hello Bob ]

 []s
 Edson



 2007/11/14, Sikkandar Nawabjan [EMAIL PROTECTED]:

 i just use this sort of rule

 rule Hello World

 dialect mvel

 when

 m : Message( $message1 : message )

 mdup : Message($message2:message==$message1,eval(this!=m) )

 then

 System.out.println(Rule Fired+m +::+mdup );

 System.out.println (Rule Fired+$message1 +::+$message2 );

 end



 if i put rule parameter dialect MVEL  the error this should be
 used in static context is gone. But now the rule is firing whatever may be
 the data

 i assert 2 objects with message Hello and Hello1.

 still the rule is firing(2 times).

 Thanks and regs,

 basha




 Message: 1
 Date: Wed, 14 Nov 2007 09:48:02 -0200
 From: Edson Tirelli  [EMAIL PROTECTED]
 Subject: Re: [rules-users] RE: how to find duplicate inlineeval
 To: Rules Users List rules-users@lists.jboss.org 
 Message-ID:
 
 [EMAIL PROTECTED]
 Content-Type: text/plain; charset=iso-8859-1

Sorry, you lost me. What is the error message?
Can you send us a self contained test showing the problem you
 are having?

[]s
Edson

 2007/11/14, Sikkandar Nawabjan  [EMAIL PROTECTED]mailto:
 [EMAIL PROTECTED] :
 
  Edson,
 
  As you said i used inline eval. But am getting erroe message
 like this
  can't be used in static context.am http://context.am/ using
 statelesssession to assert my
  objects.
   

Re: [rules-users] mvel regex not working???

2007-11-15 Thread Edson Tirelli
   Len,

   When you use code inside eval(), it is executed in the chosen dialect
(default is java). So, the regexp of your first rule is parsed and executed
in java and is correct.
   When you use code outside eval(), it is parsed by the Drools parser and
the drools parser do not require the extra '\' to escape escape-codes. See
the examples bellow:

java: ^[a-zA-Z0-9\\!\\#\\$\\%\\]
equivalent drools regexp: ^[a-zA-Z0-9\!\#\$\%\]

   If you change your regexp to use single '\' instead of double, it should
work fine.

[]s
Edson

2007/11/14, Carlsen, Len [EMAIL PROTECTED]:

  Hi,



 I have an email validation regex where the mvel matches doesn't seem to
 work. I have created 2 rules where test1 uses the Java String matches and
 test2 uses the mvel matches. Test1 works but test2 doesn't. I am using
 Drools 4.0.3 and JDK 1.6.0_02.



 *rule* Test1

 *when*

 // This works

 email : String()

 *eval*( !email.*matches*(
 ^[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+(\\.[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+)[EMAIL
  
 PROTECTED]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,6}$)
  )

 *then*

 System.out.println( 1-Invalid Email Address:  + email );

 *end*



 *rule* Test2

 *when*

 // This doesn't work

 email : String( toString *not* *matches*
 ^[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+(\\.[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+)[EMAIL
  
 PROTECTED]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,6}$)

 *then*

 System.out.println( 2-Invalid Email Address:  + email );

 *end*



 Here's the output using email addresses [EMAIL PROTECTED] (valid) and x.xx.com
 (invalid):



 test1-Invalid Email Address: x.xx.com

 test2-Invalid Email Address: [EMAIL PROTECTED]

 test2-Invalid Email Address: x.xx.com



 The regex expressions are exactly the same. Am I doing something wrong
 here?



 Thanks,



 Len



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] using primitive datatypes?

2007-11-15 Thread Fabian Weisensee

Hello everyone

just one quick question:

I tried to invoke a rule from inside of jBPM. This works now, but I have 
a major problem. The rule is quite simple and should only check if an 
integer from the jBPM process is greater than a limit. I insert this 
integer into the workingmemory, but as I understand it, drools only 
works with objects.
I tried Integer(intValue = limit) on the LHS but that only let my 
process hang at the drools-decision.


Is this possible at all? Or do I have to wrap this integer into an object?

-- Fabian

PS: the whole rule looks like this:

rule Rechnung pruefen
when
r1 :Integer(intValue = 500) 
ci : ContextInstance (id = 0)
then
ci.setVariable(mussPruefen, true);
System.out.println(Rechnung muss geprueft werden);  
end
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Classloader issues with webapp : No ClassLoaders found, Circular dependencies...

2007-11-15 Thread Robert Morse

Very helpful to me!  Thank you Julien!

On Nov 15, 2007, at 8:48 AM, Edson Tirelli wrote:



   Julien,

   Thanks for reporting back!

   Edson

2007/11/15, Julien Cassignol [EMAIL PROTECTED]:

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Classloader issues with webapp : No ClassLoaders found, Circular dependencies...

2007-11-15 Thread Edson Tirelli
   Julien,

   Thanks for reporting back!

   Edson

2007/11/15, Julien Cassignol [EMAIL PROTECTED]:

 Hello,

 Following Mark's advice, I decided to mail about a problem I experienced
 and managed to fix, with Mark's and Edson Tirelli's help.

 I was trying to build a RuleBase with the following code :

 final SpreadsheetCompiler converter = new
 SpreadsheetCompiler();
 FileInputStream file = new FileInputStream(decTable);
 final String drl = converter.compile(file, InputType.XLS);
 System.out.println(drl);
 Properties properties = new Properties();
 properties.setProperty( drools.dialect.default,
 java );
 properties.setProperty(drools.compiler,JANINO);
 PackageBuilderConfiguration conf = new
 PackageBuilderConfiguration(properties);
 PackageBuilder builder = new PackageBuilder( conf );
 builder.addPackageFromDrl(new StringReader(drl));
 Package pkg = builder.getPackage();
 RuleBase ruleBase = RuleBaseFactory.newRuleBase();
 ruleBase.addPackage(pkg);

 Nothing difficult, but it was failing on the construction of
 PackageBuilderConfiguration :

 No ClassLoaders found for:
 org.drools.rule.builder.dialect.java.JavaDialect

 Followed by an unhelpful stack.

 Debugging my webapp (which sources I didn't have), I noticed that my
 class ClassLoader was different from the thread one. The thread
 classloader was the JBoss ClassLoader, and my class classloader was the
 one of the webapp.

 Setting the classloader of the thread manually to the classloader of my
 webapp failed to cope with the problem, as the drools jars were
 installed on Jboss, and drools instantiated object couldn't find core
 objects within the classpath with the classloader of the webapp. To fix
 the problem, I had to use the following code :

 PackageBuilderConfiguration conf = new
 PackageBuilderConfiguration(
 properties);
 conf.setClassLoader(MyClass.class.getClassLoader());
 RuleBaseConfiguration ruleBaseConf = new
 RuleBaseConfiguration();
 ruleBaseConf.setClassLoader(MyClass.class.getClassLoader
 ());

 Setting the classloader property of the drools configuration objects
 allowed me to use imports of local classes (I mean local to the webapp)
 within rule packages, and solved my problem (or so it seems).

 I hope this short explanation will help someone !
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Defining the Object Model in Drools IDE 4.0.3...HOWTO????

2007-11-15 Thread mmquelo massi
Hi everybody,

I am starting to define my little Drools Project.

I am using DROOLS IDE 4.0.3 for Eclipse 3.2 .

I already have some underlying Java classes and want to build my rules
over those classes.

In other words I need to define the Object Model to execute the rules
against it.

I added all the Object Model classes in the same Rule workspace, but
once I started
te Guided Rule Editor to define the rules, I did not see any fact
coming out from the
Fact list.

So what should I do in order to get a Nice and Cool (  :D  ) list
with all the classes
I put within the Eclipse Workspace.

Thank You everybody.

I hope u can help me to work it out.

Massi
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Stop Processing Rules

2007-11-15 Thread Ronald R. DiFrango
All,

I have a situation where I want the rules execution to stop processing
immediately when it encounters a situation like the following:

rule Invalid RTV Line
salience 100

when
rtvDetailLine : DetailLine(detailRtvNumber:rtvNumber != null,
lineNumber != null )
rtvHeader : RtvHeader( rtvNumber != detailRtvNumber )
then
logger.debug(Invalid RTV Line);
throw new RuntimeException(Invalid RTV Line);
end

Basically this is a parent child relationship and under some circumstances
the process that feeds data into the rules it corrupts this relationship.  I
want to stop the rules process immediately and do nothing further.  As you
see above, my first attempt is just throw a runtime exception that is
caught/ logged and report by the calling program.  Does this seem like a
reasonable approach or is there a better approach to do this?

Ron
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Stop Processing Rules

2007-11-15 Thread Edson Tirelli
Throwing exceptions in the consequence is not safe and not advisable.
To stop the rules engine you can use the following statement in your
consequence:

drools.halt();

Use a fact, a call back, or an attribute to identify the problem you
detected.

[]s
Edson

2007/11/15, Ronald R. DiFrango [EMAIL PROTECTED]:

 All,

 I have a situation where I want the rules execution to stop processing
 immediately when it encounters a situation like the following:

 rule Invalid RTV Line
 salience 100

 when
 rtvDetailLine : DetailLine(detailRtvNumber:rtvNumber != null,
 lineNumber != null )
 rtvHeader : RtvHeader( rtvNumber != detailRtvNumber )
 then
 logger.debug(Invalid RTV Line);
 throw new RuntimeException(Invalid RTV Line);
 end

 Basically this is a parent child relationship and under some circumstances
 the process that feeds data into the rules it corrupts this relationship.  I
 want to stop the rules process immediately and do nothing further.  As you
 see above, my first attempt is just throw a runtime exception that is
 caught/ logged and report by the calling program.  Does this seem like a
 reasonable approach or is there a better approach to do this?

 Ron

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] mvel regex not working???

2007-11-15 Thread Carlsen, Len
Thanks a lot Edson. I had escaped characters that don't need to be
escaped which works in Java but not in mvel (error: no viable
alternative at character '\').

 

Java: ^[a-zA-Z0-9\\#]$

mvel: ^[a-zA-Z0-9#]$

 

Len



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Thursday, November 15, 2007 7:47 AM
To: Rules Users List
Subject: Re: [rules-users] mvel regex not working???

 


   Len,

   When you use code inside eval(), it is executed in the chosen dialect
(default is java). So, the regexp of your first rule is parsed and
executed in java and is correct.
   When you use code outside eval(), it is parsed by the Drools parser
and the drools parser do not require the extra '\' to escape
escape-codes. See the examples bellow: 

java: ^[a-zA-Z0-9\\!\\#\\$\\%\\]
equivalent drools regexp: ^[a-zA-Z0-9\!\#\$\%\]

   If you change your regexp to use single '\' instead of double, it
should work fine.

[]s
Edson 
 

2007/11/14, Carlsen, Len [EMAIL PROTECTED]:

Hi,

 

I have an email validation regex where the mvel matches doesn't seem to
work. I have created 2 rules where test1 uses the Java String matches
and test2 uses the mvel matches. Test1 works but test2 doesn't. I am
using Drools 4.0.3 and JDK 1.6.0_02.

 

rule Test1

when

// This works 

email : String() 

eval( !email. matches(
^[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+(
\\.[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+
)[EMAIL PROTECTED]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9
-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,6}$ ) )

then

System.out.println( 1-Invalid Email Address:  + email ); 

end 

 

rule Test2

when

// This doesn't work 

email : String( toString not matches
^[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+(
\\.[a-zA-Z0-9\\!\\#\\$\\%'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]+
)[EMAIL PROTECTED]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9
-]{0,61}[a-zA-Z0-9])?)*\\.[a-zA-Z]{2,6}$ )

then

System.out.println( 2-Invalid Email Address:  + email ); 

end 

 

Here's the output using email addresses [EMAIL PROTECTED] (valid) and x.xx.com
(invalid): 

 

test1-Invalid Email Address: x.xx.com

test2-Invalid Email Address: [EMAIL PROTECTED]

test2-Invalid Email Address: x.xx.com

 

The regex expressions are exactly the same. Am I doing something wrong
here?

 

Thanks,

 

Len

 


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646 
  JBoss, a division of Red Hat @ www.jboss.com 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Log4j in the rules?

2007-11-15 Thread granz
Hi,

Is it possible to use Log4j inside the rules (RHS)?? (drl file)

Thanks,

Fabrice
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Log4j in the rules?

2007-11-15 Thread Eric Miles
I set a logger as a global and use it just fine in the RHS.


On Thu, 2007-11-15 at 19:30 -0500, [EMAIL PROTECTED] wrote:
 Hi,
 
 Is it possible to use Log4j inside the rules (RHS)?? (drl file)
 
 Thanks,
 
 Fabrice
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Re: Fire Rules in DT based on a rule in DT

2007-11-15 Thread Arjun Dhar
Steven Williams stevearoonie at gmail.com writes:

 
 
 I added agenda-group to decision tables in September 2006.cheersSteve

2006, or 2007? Because it was not there in JBoss Rules 4.0.0 (at least not 
documented). 

Either way, it means it exists now. So will look at the latest release 
documentation.

Thanks

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: Fire Rules in DT based on a rule in DT

2007-11-15 Thread Steven Williams
I'm not sure if it made its way into the doco. I don't have the code with me
but will check for you what the value is.

cheers
Steve

On Nov 16, 2007 1:21 PM, Arjun Dhar [EMAIL PROTECTED] wrote:

 Steven Williams stevearoonie at gmail.com writes:

 
 
  I added agenda-group to decision tables in September 2006.cheersSteve

 2006, or 2007? Because it was not there in JBoss Rules 4.0.0 (at least not
 documented).

 Either way, it means it exists now. So will look at the latest release
 documentation.

 Thanks

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How and when are objects released in Stateless Session

2007-11-15 Thread Arjun Dhar
Hi,
 can someone please explain; if a stateless session is used over a log period 
of time. How are the objects (rather the shadows to them) released?

I understand that as long as a class is not final, its shadow is created and 
used. This raises a concern about the life cycle of that object.

perhaps the cause of memory leaks in the past.

Wanted to nkow the life cycle in breif.

Thanks

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users