[rules-users] verifying 'is not null' in decision table?
Swindells, Thomas
TSwindells at nds.com
Tue Dec 22 08:39:06 EST 2009
You can probably do what you need by using XOR-GROUPS (activation groups).
If your spreadsheet is configured to be sequential (or you explicitly set rule priority levels) then only the highest priority matching rule in a particular xor-group will be fired.
So you may be able to specify the rules as follows:
CONDITION
CONDITION
CONDITION
CONDITION
ACTION
XOR-GROUP
Foo
Date1 $param null
Date2 $param null
Date3 $param null
Date4 $param null
setPriority($param)
Date1
Date2
Date3
Date4
setPriority($param)
!=
1
DateXORGroup
!=
2
DateXORGroup
!=
3
DateXORGroup
!=
4
DateXORGroup
Then if Date4 is set the first rule would be fired, otherwise if date3 is set then row 2 would be fired etc.
If there are more permuations that you want to consider you can easily insert them too.
Hope that helps,
Thomas
> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of HonorGod
> Sent: 22 December 2009 11:21
> To: rules-users at lists.jboss.org
> Subject: Re: [rules-users] verifying 'is not null' in decision table?
>
>
> Thanks Thomas. I got this part now. But I guess the real scenarios I have
> been looking is -
>
> I have 4 different date fields and I need to check if they are not null and
> set a priority using decision table.
>
> Lets say I have Date 1 , Date 2 , Date 3 , Date 4. If Date 1 is not null
> and rest of them are null then my priority is Date 1. If Date 1 and Date 2
> are not null and the rest are null then my priority is Date 2 and so
> no.....so we are looking at 16 different possibilites and the
> priorities....how can i set the priority in this case...
>
> Thanks
>
> Swindells, Thomas wrote:
> >
> > The key thing to remember with decision tables is that currently a column
> > is only included if there is a value in the rule row and that value will
> > always be included in the rule. The easiest way to do this is to have a
> > condition in the form "firstName != $param" and then have null as the cell
> > value. The other solution if you want separate rules for each field which
> > cannot be null is to have it in the form "$param != null" and enter the
> > field name as the cell value.
> >
> > Thomas
> >
> >> -----Original Message-----
> >> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> >> bounces at lists.jboss.org] On Behalf Of HonorGod
> >> Sent: 21 December 2009 15:52
> >> To: rules-users at lists.jboss.org
> >> Subject: [rules-users] verifying 'is not null' in decision table?
> >>
> >>
> >> How can I verify if my condition attribute is not null in decision table?
> >>
> >> I have a class -
> >>
> >> Public Class Person {
> >>
> >> String firstName = null;
> >> String lastName = null ;
> >>
> >> }
> >>
> >> In my decision table I have to check if firstName and lastName are not
> >> null
> >> and then fire actions.
> >>
> >> How I can do this? I know I can get that through drl.
> >>
> >> Thanks
> >>
> >> --
> >> View this message in context:
> >> http://n3.nabble.com/verifying-is-not-null-in-
> >> decision-table-tp96386p96386.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
> >
> ******************************************************************************
> ********
> >
> > 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.
> >
> > An NDS Group Limited company. www.nds.com
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context: http://n3.nabble.com/verifying-is-not-null-in-
> decision-table-tp96386p97139.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
**************************************************************************************
________________________________
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.
An NDS Group Limited company. www.nds.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091222/dff59734/attachment.html
More information about the rules-users
mailing list