InternalWorkingMemory wm,
LeftTupleSets srcLeftTuples,
LeftTupleSets trgLeftTuples,
LeftTupleSets stagedLeftTuples,
RuleExecutor executor) {
ConditionalBranchEvaluator branchEvaluator = branchNode.getBranchEvaluator();
RuleAgendaItem ruleAgendaItem = executor.getRuleAgendaItem();
int salienceInt = 0;
Salience salience = ruleAgendaItem.getRule().getSalience();
if ( !salience.isDynamic() ) {
salienceInt = ruleAgendaItem.getRule().getSalience().getValue();
salience = null;
}
for (LeftTuple leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != null; ) {
LeftTuple next = leftTuple.getStagedNext();
LeftTuple rtnLeftTuple = null;
LeftTuple mainLeftTuple = null;
LeftTuple child = leftTuple.getFirstChild();
if ( child != null ) {
// assigns the correct main or rtn LeftTuple based on the identified sink
if ( child.getSink() == sink ) {
mainLeftTuple = child;
} else {
rtnLeftTuple = child;
}
child = child.getLeftParentNext();
if ( child != null ) {
if ( child.getSink() == sink ) {
mainLeftTuple = child;
} else {
rtnLeftTuple = child;
}
}
}
RuleTerminalNode oldRtn = null;
if (rtnLeftTuple != null) {
oldRtn = (RuleTerminalNode) rtnLeftTuple.getSink();
}
ConditionalExecution conditionalExecution = branchEvaluator.evaluate(leftTuple, wm, cbm.context);
RuleTerminalNode newRtn = null;
boolean breaking = false;
if (conditionalExecution != null) {
newRtn = (RuleTerminalNode) conditionalExecution.getSink().getFirstLeftTupleSink();