TaskControl class
Links a trigger to a task: when the trigger fires, start or stop the task.
Once the condition of the trigger with triggerId applies, the task with taskName on destinationDeviceRoleName is started or stopped (as specified by control). Task controls are created by StudyProtocol.addTaskControl; you rarely create one yourself.
The JSON holds the trigger id, task name, target device role name, control and hasBeenScheduledUntil; task and targetDevice are runtime references that are not part of the JSON.
- Annotations
-
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
Constructors
-
TaskControl({required int triggerId, TaskConfiguration? task, DeviceConfiguration<
DeviceRegistration> ? targetDevice, Control control = Control.Start}) - Create a TaskControl.
-
TaskControl.fromJson(Map<
String, dynamic> json) -
factory
Properties
- control ↔ Control
-
What to do with a task once the condition of a trigger is met.
getter/setter pair
- destinationDeviceRoleName ↔ String?
-
The role name of the device to which to send the task with taskName
when the trigger condition is met.
getter/setter pair
- hasBeenScheduledUntil ↔ DateTime?
-
The time the task have been scheduled until.
Mainly used when scheduling a series of tasks for this trigger.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
targetDevice
↔ DeviceConfiguration<
DeviceRegistration> ? -
The device to send the task to. Not serialized; may be null after
deserialization.
getter/setter pair
- task ↔ TaskConfiguration?
-
The task to control. Not serialized; may be null after deserialization.
getter/setter pair
- taskName ↔ String
-
The name of the task to send to destinationDeviceRoleName when the
trigger condition is met.
getter/setter pair
- triggerId ↔ int
-
The id of the TriggerConfiguration; its key in StudyProtocol.triggers.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited