Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
11.22. Removing Traits
The business logic may require that a trait is removed from a wrapped object. There are two ways to do so:
- Logical don
- Results in a logical insertion of the proxy resulting from the traiting operation.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The shed keyword
- The shed keyword causes the retraction of the proxy corresponding to the given argument type
then Thing t = shed( $x, GoldenCustomer.class )
then Thing t = shed( $x, GoldenCustomer.class )
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This operation returns another proxy implementing the org.drools.factmodel.traits.Thing interface, where the getFields() and getCore() methods are defined. Internally, all declared traits are generated to extend this interface (in addition to any others specified). This allows to preserve the wrapper with the soft fields which would otherwise be lost.