[rules-users] Rule template shortcut needed

Swindells, Thomas TSwindells at nds.com
Wed Aug 18 08:22:00 EDT 2010


How about writing a simple pre/post processor which finds and replaces string with what you want - eg converts getValue("type1") to whatever call you would prefer?

> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of djb
> Sent: 18 August 2010 12:31
> To: rules-users at lists.jboss.org
> Subject: [rules-users] Rule template shortcut needed
>
>
> Hi there,
>
> My question is related to the ability to remove criterion in a rule template
> by a cunning commenting trick so that if the variable @{VAR} is blank, the
> line will be blank.  Wolfgang wrote the code, I believe.
>
> I've got a situation where I've got DB rows where i've got:
> TYPE  |  CODE  |  TYPE2  |  CODE2_FROM  |  CODE2_TO
>
> there are 17 types.  So it lets us have rules like
> Type U code 123 cannot be charged with Type V codes 234 to 236.
>
> I need the rules to compare the correct property, but I don't want to lose
> the advantage of the RETE algorithm by using a getValue("type1") function.
>
> I see one solution:
> 2.  Make a template with 17 + 17 + 17 = 51 columns, where each one uses the
> // @{VAR} trick.
>
> Is there a better way?  Or, should I just do getValue("type")?
>
> Thanks
> Daniel
>
>
> --
> View this message in context: http://drools-java-rules-
> engine.46999.n3.nabble.com/Rule-template-shortcut-needed-
> tp1203969p1203969.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