wasNegated,
wasConflicting );
} else if ( primeChanged ) {
// we know there must be at least one more of the same type, as they are still in conflict
String value;
InternalFactHandle handle;
Object object = null;
if ( jtmsBeliefSet.isNegated() ) {
value = MODE.NEGATIVE.getId();
handle = jtmsBeliefSet.getNegativeFactHandle();
// Find the new node, and update the handle to it, Negatives iterate from the last
for ( LinkedListEntry<LogicalDependency> entry = (LinkedListEntry<LogicalDependency>) jtmsBeliefSet.getLast(); entry != null; entry = (LinkedListEntry<LogicalDependency>) entry.getPrevious() ) {
if ( entry.getObject().getValue().equals( value ) ) {
object = entry.getObject().getObject();
break;
}
}
} else {
value = MODE.POSITIVE.getId();
handle = jtmsBeliefSet.getPositiveFactHandle();
// Find the new node, and update the handle to it, Positives iterate from the front
for ( LinkedListEntry<LogicalDependency> entry = (LinkedListEntry<LogicalDependency>) jtmsBeliefSet.getFirst(); entry != null; entry = (LinkedListEntry<LogicalDependency>) entry.getNext() ) {
if ( entry.getObject().getValue().equals( value ) ) {
object = entry.getObject().getObject();
break;
}
}
}
// Equality might have changed on the object, so remove (which uses the handle id) and add back in
((NamedEntryPoint) handle.getEntryPoint()).getObjectStore().updateHandle( handle, object );
retractOrUpdateBelief( node, context, handle, true, false ); // fully retract must be false, as this is an update
}
}