[rules-users] Throwing exceptions from rules.

Swindells, Thomas TSwindells at nds.com
Fri Sep 10 09:10:38 EDT 2010


Have you tried doing e.getCause() to get whatever caused the consequence exception to be thrown? (I've not tried it but I assume the drools guys have done their job properly).

Thomas

> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of tom
> Sent: 10 September 2010 13:59
> To: rules-users at lists.jboss.org
> Subject: [rules-users] Throwing exceptions from rules.
>
>
> Hi,
> I have a rule, which in "then section" has:
>
> throw new java.lang.Exception("I cant get this message!");
>
> I throw this exception, and I can get it using catch
> (org.drools.runtime.rule.ConsequenceException e) {} in java. But when I try
> to get message from exception "e", I get only rule's name:
>
> rule: <rule name>
>
> How can I throw exception with message that I want to have on java side?
>
> I hope it is understandeble... :)
>
> Thanks,
> tom.
> --
> View this message in context: http://drools-java-rules-
> engine.46999.n3.nabble.com/Throwing-exceptions-from-rules-
> tp1452162p1452162.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************




More information about the rules-users mailing list