public void setFullyRetract(boolean fullyRetract) {
this.fullyRetract = fullyRetract;
}
public void execute(InternalWorkingMemory workingMemory) {
NamedEntryPoint nep = (NamedEntryPoint) handle.getEntryPoint() ;
BeliefSet bs = handle.getEqualityKey().getBeliefSet();
bs.setWorkingMemoryAction( null );
if ( update ) {
if ( !bs.isEmpty() ) {
// We need the isEmpty check, in case the BeliefSet was made empty (due to retract) after this was scheduled
((NamedEntryPoint) handle.getEntryPoint() ).update( handle, true, handle.getObject(), Long.MAX_VALUE, Object.class, null );
}
} else {
if ( fullyRetract ) {
((NamedEntryPoint) handle.getEntryPoint()).delete( this.handle,
(Rule) context.getRuleOrigin(),
this.activation );
} else {
final ObjectTypeConf typeConf = nep.getObjectTypeConfigurationRegistry().getObjectTypeConf( nep.getEntryPoint(),
handle.getObject() );
((NamedEntryPoint) handle.getEntryPoint() ).getEntryPointNode().retractObject( handle,
context,
typeConf,
workingMemory );