use of org.drools.core.common.NamedEntryPoint in project drools by kiegroup.
the class TraitHelper method updateManyTraits.
private void updateManyTraits(Object object, BitMask mask, Collection<Thing> originators, Class<?> modifiedClass, Collection<Thing> traits, Activation activation) {
for (Thing t : traits) {
if (!originators.contains(t)) {
InternalFactHandle h = (InternalFactHandle) lookupFactHandle(t);
if (h != null) {
NamedEntryPoint nep = (NamedEntryPoint) h.getEntryPoint();
PropagationContext propagationContext = nep.getPctxFactory().createPropagationContext(nep.getInternalWorkingMemory().getNextPropagationIdCounter(), PropagationContext.Type.MODIFICATION, activation != null ? activation.getRule() : null, activation != null ? activation.getTuple().getTupleSink() : null, h, nep.getEntryPoint(), mask, modifiedClass, null);
nep.update(h, t, t, nep.getObjectTypeConfigurationRegistry().getObjectTypeConf(nep.getEntryPoint(), t), propagationContext);
}
}
}
}
use of org.drools.core.common.NamedEntryPoint in project drools by kiegroup.
the class BeliefSystemLogicalCallback method execute.
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, handle.getObject(), allSetButTraitBitMask(), Object.class, null);
}
} else {
if (fullyRetract) {
((NamedEntryPoint) handle.getEntryPoint()).delete(this.handle, context.getRuleOrigin(), this.activation.getTuple().getTupleSink());
} else {
final ObjectTypeConf typeConf = nep.getObjectTypeConfigurationRegistry().getObjectTypeConf(nep.getEntryPoint(), handle.getObject());
((NamedEntryPoint) handle.getEntryPoint()).getEntryPointNode().retractObject(handle, context, typeConf, workingMemory);
}
}
}
Aggregations