osdir.com
mailing list archive

Subject: AW: [drools-user] Once again multiple facts of the same type - msg#00125

List: java.drools.user

Date: Prev Next Index Thread: Prev Next Index
Ok, it would be possible to add a boolean attribute on my Product object. But I
actually didn't want to change my business objects
only to have my rules work well, cause this would be a bit less declarative I
think. Do you agree to that?

Therefore would I prefer the semaphores. I will try it and post my
experiences...


- Hendrik


-----Ursprüngliche Nachricht-----
Von: Matthew Shaw [mailto:mshaw@xxxxxxxxxxxxxxxxxxxx]
Gesendet: Dienstag, 20. September 2005 06:10
An: user@xxxxxxxxxxxxxxxxxxx; hbeck_lists2@xxxxxxxxxxxxxxx
Betreff: RE: [drools-user] Once again multiple facts of the same type


You could set a boolean on your Product object, and set it to true in your
consequence, subsequently add the boolean check in your
condition for the same rule.

-----Original Message-----
From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx]
Sent: Tuesday, 20 September 2005 4:38 AM
To: user@xxxxxxxxxxxxxxxxxxx
Subject: [drools-user] Once again multiple facts of the same type


Hi!

Last days we had two examples about using more than one fact of the same type.
Now I got a similar problem though it is slightly
different.

I have a number of facts with an attribute, e.g. a "Product" with an attribute
"Category-ID". Now I want to check for a specific
category-id and do something only one time if there is at least one product
with this category-id.

<java:rule name="test">

<java:parameter name="product">
<java:class>Product</java:class>
</java:parameter>

<java:condition>product.getCategory() == 1</java:condition>

<java:consequence>
doSomething();
</java:consequence>

</java:rule>

This simple approach does it for every appropriate category-id (it's clear),
but I don't have any idea, how to get it...


Thanks in advance
Hendrik


This correspondence is for the named persons only.

It may contain confidential or privileged information or both.

No confidentiality or privilege is waived or lost by any mis transmission.

If you receive this correspondence in error please delete it from your system
immediately and notify the sender.

You must not disclose, copy or relay on any part of this correspondence, if you
are not the intended recipient.

Any opinions expressed in this message are those of the individual sender
except where the sender expressly,

and with the authority, states them to be the opinions of the Department of
Emergency Services, Queensland.





Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

AW: [drools-user] Once again multiple facts of the same type

Ok, it would be possible to add a boolean attribute on my Product object. But I actually didn't want to change my business objects only to have my rules work well, cause this would be a bit less declarative I think. Do you agree to that? Therefore would I prefer the semaphores. I will try it and post my experiences... - Hendrik -----Ursprüngliche Nachricht----- Von: Matthew Shaw [mailto:mshaw@xxxxxxxxxxxxxxxxxxxx] Gesendet: Dienstag, 20. September 2005 06:10 An: user@xxxxxxxxxxxxxxxxxxx; hbeck_lists2@xxxxxxxxxxxxxxx Betreff: RE: [drools-user] Once again multiple facts of the same type You could set a boolean on your Product object, and set it to true in your consequence, subsequently add the boolean check in your condition for the same rule. -----Original Message----- From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx] Sent: Tuesday, 20 September 2005 4:38 AM To: user@xxxxxxxxxxxxxxxxxxx Subject: [drools-user] Once again multiple facts of the same type Hi! Last days we had two examples about using more than one fact of the same type. Now I got a similar problem though it is slightly different. I have a number of facts with an attribute, e.g. a "Product" with an attribute "Category-ID". Now I want to check for a specific category-id and do something only one time if there is at least one product with this category-id. <java:rule name="test"> <java:parameter name="product"> <java:class>Product</java:class> </java:parameter> <java:condition>product.getCategory() == 1</java:condition> <java:consequence> doSomething(); </java:consequence> </java:rule> This simple approach does it for every appropriate category-id (it's clear), but I don't have any idea, how to get it... Thanks in advance Hendrik This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland.

Next Message by Date: click to view message preview

RE: [drools-user] Once again multiple facts of the same type

Yes I think in this case it probably would be better to use semaphores. I think it depends on the complexity of the business and whether those additional fields are crucial to other rules and do belong as attributes of the object. Matt. -----Original Message----- From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx] Sent: Tuesday, 20 September 2005 7:39 PM To: user@xxxxxxxxxxxxxxxxxxx Subject: AW: [drools-user] Once again multiple facts of the same type Ok, it would be possible to add a boolean attribute on my Product object. But I actually didn't want to change my business objects only to have my rules work well, cause this would be a bit less declarative I think. Do you agree to that? Therefore would I prefer the semaphores. I will try it and post my experiences... - Hendrik -----Ursprüngliche Nachricht----- Von: Matthew Shaw [mailto:mshaw@xxxxxxxxxxxxxxxxxxxx] Gesendet: Dienstag, 20. September 2005 06:10 An: user@xxxxxxxxxxxxxxxxxxx; hbeck_lists2@xxxxxxxxxxxxxxx Betreff: RE: [drools-user] Once again multiple facts of the same type You could set a boolean on your Product object, and set it to true in your consequence, subsequently add the boolean check in your condition for the same rule. -----Original Message----- From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx] Sent: Tuesday, 20 September 2005 4:38 AM To: user@xxxxxxxxxxxxxxxxxxx Subject: [drools-user] Once again multiple facts of the same type Hi! Last days we had two examples about using more than one fact of the same type. Now I got a similar problem though it is slightly different. I have a number of facts with an attribute, e.g. a "Product" with an attribute "Category-ID". Now I want to check for a specific category-id and do something only one time if there is at least one product with this category-id. <java:rule name="test"> <java:parameter name="product"> <java:class>Product</java:class> </java:parameter> <java:condition>product.getCategory() == 1</java:condition> <java:consequence> doSomething(); </java:consequence> </java:rule> This simple approach does it for every appropriate category-id (it's clear), but I don't have any idea, how to get it... Thanks in advance Hendrik This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland.

Previous Message by Thread: click to view message preview

AW: [drools-user] Once again multiple facts of the same type

Ok, it would be possible to add a boolean attribute on my Product object. But I actually didn't want to change my business objects only to have my rules work well, cause this would be a bit less declarative I think. Do you agree to that? Therefore would I prefer the semaphores. I will try it and post my experiences... - Hendrik -----Ursprüngliche Nachricht----- Von: Matthew Shaw [mailto:mshaw@xxxxxxxxxxxxxxxxxxxx] Gesendet: Dienstag, 20. September 2005 06:10 An: user@xxxxxxxxxxxxxxxxxxx; hbeck_lists2@xxxxxxxxxxxxxxx Betreff: RE: [drools-user] Once again multiple facts of the same type You could set a boolean on your Product object, and set it to true in your consequence, subsequently add the boolean check in your condition for the same rule. -----Original Message----- From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx] Sent: Tuesday, 20 September 2005 4:38 AM To: user@xxxxxxxxxxxxxxxxxxx Subject: [drools-user] Once again multiple facts of the same type Hi! Last days we had two examples about using more than one fact of the same type. Now I got a similar problem though it is slightly different. I have a number of facts with an attribute, e.g. a "Product" with an attribute "Category-ID". Now I want to check for a specific category-id and do something only one time if there is at least one product with this category-id. <java:rule name="test"> <java:parameter name="product"> <java:class>Product</java:class> </java:parameter> <java:condition>product.getCategory() == 1</java:condition> <java:consequence> doSomething(); </java:consequence> </java:rule> This simple approach does it for every appropriate category-id (it's clear), but I don't have any idea, how to get it... Thanks in advance Hendrik This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland.

Next Message by Thread: click to view message preview

RE: [drools-user] Once again multiple facts of the same type

Yes I think in this case it probably would be better to use semaphores. I think it depends on the complexity of the business and whether those additional fields are crucial to other rules and do belong as attributes of the object. Matt. -----Original Message----- From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx] Sent: Tuesday, 20 September 2005 7:39 PM To: user@xxxxxxxxxxxxxxxxxxx Subject: AW: [drools-user] Once again multiple facts of the same type Ok, it would be possible to add a boolean attribute on my Product object. But I actually didn't want to change my business objects only to have my rules work well, cause this would be a bit less declarative I think. Do you agree to that? Therefore would I prefer the semaphores. I will try it and post my experiences... - Hendrik -----Ursprüngliche Nachricht----- Von: Matthew Shaw [mailto:mshaw@xxxxxxxxxxxxxxxxxxxx] Gesendet: Dienstag, 20. September 2005 06:10 An: user@xxxxxxxxxxxxxxxxxxx; hbeck_lists2@xxxxxxxxxxxxxxx Betreff: RE: [drools-user] Once again multiple facts of the same type You could set a boolean on your Product object, and set it to true in your consequence, subsequently add the boolean check in your condition for the same rule. -----Original Message----- From: Hendrik Beck [mailto:hbeck_lists2@xxxxxxxxxxxxxxx] Sent: Tuesday, 20 September 2005 4:38 AM To: user@xxxxxxxxxxxxxxxxxxx Subject: [drools-user] Once again multiple facts of the same type Hi! Last days we had two examples about using more than one fact of the same type. Now I got a similar problem though it is slightly different. I have a number of facts with an attribute, e.g. a "Product" with an attribute "Category-ID". Now I want to check for a specific category-id and do something only one time if there is at least one product with this category-id. <java:rule name="test"> <java:parameter name="product"> <java:class>Product</java:class> </java:parameter> <java:condition>product.getCategory() == 1</java:condition> <java:consequence> doSomething(); </java:consequence> </java:rule> This simple approach does it for every appropriate category-id (it's clear), but I don't have any idea, how to get it... Thanks in advance Hendrik This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland.
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by