[rules-users] Can we set a default value for emlpty cells in Drools templates

Swindells, Thomas TSwindells at nds.com
Fri Jan 20 04:25:23 EST 2012


There isn't a nice way to do this unfortunately.
One hack around it is to have two columns with the object merged across them
The first column would have the condition $a : Company(this != $param), every cell in the column is then given the value 'null'.
This would then always ensure that $a will always exist. The second column can then be written as normal with your optional condition.

Thomas

> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of swaroop
> Sent: 20 January 2012 08:34
> To: rules-users at lists.jboss.org
> Subject: [rules-users] Can we set a default value for emlpty cells in Drools
> templates
>
> Hi,
>
> I am trying to write a template and came across a scenario where one of the
> condition cell                         $a : Company(condition), When
> condition is left blank then entire predicate is missed and iam using the ref of
> the company obj $a to set some values which is failing as the declaration part
> is missing, So i was thinking, if we can have a default value to the cell as $a :
> Company(), then the scenario will be handled.Kindly let me know how to
> implement the default value for a cell in template to overcome the above
> mentioned scenario
>
>
> Thanks
> Swaroop
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Can-we-
> set-a-default-value-for-emlpty-cells-in-Drools-templates-
> tp3674849p3674849.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


**************************************************************************************
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