public class April2014DagImpl extends IDag
IDag.EventNotifierAccessor
Modifier and Type | Field and Description |
---|---|
private FormDef.EvalBehavior |
mode |
accessor, conditionRepeatTargetIndex, triggerablesDAG, triggerIndex, unorderedTriggerables
Constructor and Description |
---|
April2014DagImpl(IDag.EventNotifierAccessor accessor) |
Modifier and Type | Method and Description |
---|---|
private void |
addChildrenOfElement(TreeElement el,
java.util.ArrayList<TreeReference> toAdd) |
private void |
addChildrenOfReference(EvaluationContext evalContext,
TreeReference original,
java.util.ArrayList<TreeReference> toAdd)
This is a utility method to get all of the references of a node.
|
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.Collection<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.
|
private void |
fillTriggeredElements(EvaluationContext evalContext,
QuickTriggerable qt,
java.util.ArrayList<QuickTriggerable> destination)
Get all of the elements which will need to be evaluated (in order) when
the triggerable is fired.
|
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 April2014DagImpl(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 appropriatelyprivate void fillTriggeredElements(EvaluationContext evalContext, QuickTriggerable qt, java.util.ArrayList<QuickTriggerable> destination)
qt
- private void addChildrenOfReference(EvaluationContext evalContext, TreeReference original, java.util.ArrayList<TreeReference> toAdd)
private void addChildrenOfElement(TreeElement el, java.util.ArrayList<TreeReference> toAdd)
public 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.Collection<QuickTriggerable> evaluateTriggerables(FormInstance mainInstance, EvaluationContext evalContext, java.util.ArrayList<QuickTriggerable> tv, TreeReference anchorRef)
tv
- A vector of all of the trigerrables directly triggered by the
value changedanchorRef
- The reference to original value that was updatedprivate 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