TriggerableDag class final

The dependency graph of a form's calculations and relevant, required and readonly conditions: which triggerables a change re-evaluates, and in which order.

Port of org.javarosa.core.model.TriggerableDag. JavaRosa wraps each triggerable in a QuickTriggerable for identity hashing; Dart's Triggerable already uses identity equality, so it is used directly. JavaRosa's sets are ordered by identity hash code (different on every run); DartRosa's keep registration order, one of the orders JavaRosa can produce.

Constructors

TriggerableDag(void _publish(EvaluationEvent event))
Creates an empty graph publishing evaluation events to the given callback.

Properties

hashCode → int
The hash code for this object.
no setterinherited
predicateCaching ↔ bool
Whether each batch of evaluations caches idempotent predicate results (IdempotentExpressionCacheFilterStrategy).
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sorted → List<Triggerable>
The triggerables in evaluation (topological) order, once finalized.
no setter
triggerables → List<Triggerable>
All registered triggerables, in registration order.
no setter

Methods

addTriggerable(Triggerable triggerable) → Triggerable
Registers triggerable, or returns an equal one already registered (with its context narrowed to cover both).
copyItemsetAnswer(FormInstance mainInstance, EvaluationContext ec, TreeReference copyRef, TreeElement copyToElement) → void
Updates the form after itemset copies were made at copyRef (deprecated <copy> itemsets).
createRepeatInstance(FormInstance mainInstance, EvaluationContext ec, TreeReference createdRef, TreeElement createdElement) → void
Updates the form after the repeat instance createdElement was added at createdRef.
deleteRepeatInstance(FormInstance mainInstance, EvaluationContext ec, TreeReference deleteRef, TreeElement deletedElement) → void
Updates the form after the repeat instance deletedElement at deleteRef was removed.
finalizeTriggerables(FormInstance mainInstance, EvaluationContext ec) → void
Orders the triggerables topologically; throws StateError with the nodes involved when there is a cycle.
immediateCascades(Triggerable triggerable) → Set<Triggerable>
The triggerables directly affected by triggerable's targets.
initializeTriggerables(FormInstance mainInstance, EvaluationContext ec, TreeReference rootRef, [Set<Triggerable> alreadyEvaluated = const {}]) → Set<Triggerable>
Evaluates every triggerable with a target at or under rootRef (and what they cascade to); returns the evaluated triggerables.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publishSummary(String lead, TreeReference? ref, Iterable<Triggerable> triggerables) → void
Publishes how many triggerables an operation fired.
relevanceForRepeat(TreeReference genericRepeatRef) → Triggerable?
The relevance condition of the repeat at genericRepeatRef, if any.
reportDependencyCycles() → void
Checks the trigger → target graph for cycles. Port of reportDependencyCycles (unused by JavaRosa itself).
toString() → String
A string representation of this object.
inherited
triggerablesFor(TreeReference trigger) → Set<Triggerable>
The triggerables that a change to trigger (a generic reference) directly re-evaluates.
triggerTriggerables(FormInstance mainInstance, EvaluationContext ec, TreeReference changedRef, [Set<Triggerable> affectAllRepeatInstances = const {}, Set<Triggerable> alreadyEvaluated = const {}]) → Set<Triggerable>
Re-evaluates what depends on the node at changedRef; returns the evaluated triggerables.

Operators

operator ==(Object other) → bool
The equality operator.
inherited