]
Davide Sottara resolved JBRULES-3612.
-------------------------------------
Fix Version/s: FUTURE
Resolution: Out of Date
Obsolete. Will be managed in 6.x using strong negation and TMS
Prevent a trait from being applied to a given object
----------------------------------------------------
Key: JBRULES-3612
URL:
https://issues.jboss.org/browse/JBRULES-3612
Project: JBRULES
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Reporter: Davide Sottara
Assignee: Davide Sottara
Priority: Optional
Fix For: FUTURE
For various reasons, a rule may want to prevent the future "don" of a given
trait for a given object.
I propose the use of the "ward" macro, as follows:
Thing t = ward( $core, BannedTrait.class );
If another rule, at a later point, will try to apply the BannedTrait or any of its
subtypes to $core, that trait will not be applied to $core and (potentially) an exception
will be thrown.
Details:
$core can be a @Traitable object or a Thing (i.e. an instance of a trait proxy). THe
"ward" operation automatically applies the "Thing" trait to $core in
case it has not been done yet.
Optionally, one might use the "grant" macro to undo a ward (suggestions for a
better name are encouraged).
This feature will help in the implementation of "disjunct" or "mutually
exclusive" traits, which are incompatible and can't be applied to the same
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: