public class LegacyDagImpl extends IDag
IDag.EventNotifierAccessor
Modifier and Type | Field and Description |
---|---|
private FormDef.EvalBehavior |
mode |
accessor, conditionRepeatTargetIndex, triggerablesDAG, triggerIndex, unorderedTriggerables
Constructor and Description |
---|
LegacyDagImpl(IDag.EventNotifierAccessor accessor) |
Modifier and Type | Method and Description |
---|---|
void |
copyItemsetAnswer(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference copyRef,
TreeElement copyToElement,
boolean midSurvey)
Take actions related to changes of select-one and select-multiple
itemsets.
|
void |
createRepeatGroup(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference createRef,
TreeElement parentElement,
TreeElement createdElement)
Take whatever action is required when creating a repeat group.
|
void |
deleteRepeatGroup(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference deleteRef,
TreeElement parentElement,
TreeElement deletedElement)
Take whatever action is required when deleting a repeat group.
|
private void |
evaluateTriggerable(FormInstance mainInstance,
EvaluationContext evalContext,
QuickTriggerable qt,
TreeReference anchorRef)
Step 3 in DAG cascade.
|
private java.util.List<QuickTriggerable> |
evaluateTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
java.util.ArrayList<QuickTriggerable> tv,
TreeReference anchorRef)
Step 2 in evaluating DAG computation updates from a value being changed
in the instance.
|
void |
finalizeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext)
Finalize the DAG associated with the form's triggered conditions.
|
FormDef.EvalBehavior |
getEvalBehavior()
The EvalBehavior that the implementation provides.
|
QuickTriggerable |
getTriggerableForRepeatGroup(TreeReference repeatRef)
Used to obtain the triggerable that impacts the relevancy of the repeat
group.
|
java.util.Collection<QuickTriggerable> |
initializeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference rootRef,
boolean midSurvey)
Walks the current set of conditions, and evaluates each of them with the
current context.
|
boolean |
shouldTrustPreviouslyCommittedAnswer()
Specifies if unchanged answers should be trusted (and not re-committed).
|
java.util.Collection<QuickTriggerable> |
triggerTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
boolean midSurvey)
The entry point for the DAG cascade after a value is changed in the
model.
|
addTriggerable, getConditionExpressionForTrueAction, getConditions, getRecalculates, printTriggerables, publishSummary, publishSummary, reportDependencyCycles, validate
private final FormDef.EvalBehavior mode
public LegacyDagImpl(IDag.EventNotifierAccessor accessor)
public FormDef.EvalBehavior getEvalBehavior()
IDag
getEvalBehavior
in class IDag
public QuickTriggerable getTriggerableForRepeatGroup(TreeReference repeatRef)
IDag
getTriggerableForRepeatGroup
in class IDag
public void deleteRepeatGroup(FormInstance mainInstance, EvaluationContext evalContext, TreeReference deleteRef, TreeElement parentElement, TreeElement deletedElement)
IDag
deleteRepeatGroup
in class IDag
public void createRepeatGroup(FormInstance mainInstance, EvaluationContext evalContext, TreeReference createRef, TreeElement parentElement, TreeElement createdElement)
IDag
createRepeatGroup
in class IDag
public void copyItemsetAnswer(FormInstance mainInstance, EvaluationContext evalContext, TreeReference copyRef, TreeElement copyToElement, boolean midSurvey)
IDag
copyItemsetAnswer
in class IDag
public void finalizeTriggerables(FormInstance mainInstance, EvaluationContext evalContext) throws java.lang.IllegalStateException
finalizeTriggerables
in class IDag
java.lang.IllegalStateException
- - If the trigger ordering contains an illegal cycle and the
triggers can't be laid out appropriatelypublic java.util.Collection<QuickTriggerable> initializeTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference rootRef, boolean midSurvey)
initializeTriggerables
in class IDag
midSurvey
- true if we are during the survey, false if we are on loading/saving phasepublic java.util.Collection<QuickTriggerable> triggerTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, boolean midSurvey)
triggerTriggerables
in class IDag
ref
- The full contextualized unambiguous reference of the value
that was changed.private java.util.List<QuickTriggerable> evaluateTriggerables(FormInstance mainInstance, EvaluationContext evalContext, java.util.ArrayList<QuickTriggerable> tv, TreeReference anchorRef)
tv
- A list of all of the trigerrables directly triggered by the
value changedanchorRef
- private void evaluateTriggerable(FormInstance mainInstance, EvaluationContext evalContext, QuickTriggerable qt, TreeReference anchorRef)
qt
- The triggerable to be updatedanchorRef
- The reference to the value which was changed.public boolean shouldTrustPreviouslyCommittedAnswer()
IDag
shouldTrustPreviouslyCommittedAnswer
in class IDag