It seems to me that rule metadata would be the answer to your problem.
This keeps the ID right in the rule.

Alternatively, you could make the ID an immutable part of the rule name,
e.g. "change me here but [don't change me here]".

-W


On 8 May 2011 06:17, harishtejwani <harish@htejwani.com> wrote:
All:

We are using Drools to detect specific events/conditions in our system.

In the 'then' condition of Drools rule, we would like to persist the "Rule
Id" of the rule that created the specific event/condition

This is because all our reporting is based on "rules" as filters, where
users can look at exceptions by specific rules.

Is there a suggestion or sample as how can the "Rule Id" be persisted or
indicated in the then condition that is immutable or can be long-lived. The
current approach of using Rule Name itself as the ID is brittle as this can
be changed and suddenly all reports would break.

If we assign ID's to rules, where do we keep the mapping of RULE ID to
Rules. If we store rules in GUVRNOR is there a way we can get Rule Id's for
Rules?

Best regards

Harish Tejwani

--
View this message in context: http://drools.46999.n3.nabble.com/Rule-Id-for-a-Drools-Rule-tp2914385p2914385.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users