trigger
trigger ¶
Classes for managing Domo trigger configurations (dataflow execution triggers)
This module extends the DomoSchedule system to handle complex trigger scenarios: - Multiple triggers per entity (vs single schedule) - Dataset-based triggers (in addition to time-based) - Conditional execution logic - Multiple event types per trigger
DomoTriggerEvent_Schedule leverages the DomoSchedule factory to parse schedule configurations, ensuring consistency with how DomoStream and other entities handle time-based execution.
Architecture
DomoTriggerSettings (container) └── DomoTrigger (individual trigger) ├── DomoTriggerEvent_Schedule --> DomoSchedule_Base (reuses schedule parsing) ├── DomoTriggerEvent_DatasetUpdated └── DomoTriggerCondition
DomoTrigger
dataclass
¶
DomoTrigger(
trigger_id: int,
title: str = None,
trigger_events: list[DomoTriggerEvent_Base] = list(),
trigger_conditions: list[DomoTriggerCondition] = list(),
raw: dict[str, Any] = dict(),
)
Bases: DomoBase
A single trigger configuration with events and conditions
export_as_dict ¶
export_as_dict(
override_fn: Callable | None = None,
) -> dict[str, Any]
Export trigger as unified dictionary format
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Optional function to override export logic |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, Any]
|
Unified trigger dictionary with readable format |
Source code in src/crew_dcs/classes/subentity/trigger.py
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> DomoTrigger
Create DomoTrigger from dictionary
Source code in src/crew_dcs/classes/subentity/trigger.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
get_dataset_events ¶
get_dataset_events() -> (
list[DomoTriggerEvent_DatasetUpdated]
)
Get all dataset update events from this trigger
Source code in src/crew_dcs/classes/subentity/trigger.py
452 453 454 455 456 457 458 | |
get_human_readable_description ¶
get_human_readable_description() -> str
Get human-readable description of the trigger
Source code in src/crew_dcs/classes/subentity/trigger.py
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | |
get_schedule_events ¶
get_schedule_events() -> list[DomoTriggerEvent_Schedule]
Get all schedule events from this trigger
Source code in src/crew_dcs/classes/subentity/trigger.py
444 445 446 447 448 449 450 | |
has_dataset_event ¶
has_dataset_event() -> bool
Check if this trigger has a dataset update event
Source code in src/crew_dcs/classes/subentity/trigger.py
437 438 439 440 441 442 | |
has_schedule_event ¶
has_schedule_event() -> bool
Check if this trigger has a schedule event
Source code in src/crew_dcs/classes/subentity/trigger.py
430 431 432 433 434 435 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary format
Source code in src/crew_dcs/classes/subentity/trigger.py
361 362 363 364 365 366 367 368 369 370 | |
DomoTriggerCondition
dataclass
¶
DomoTriggerCondition(
condition_type: str = None,
parameters: dict[str, Any] = dict(),
raw: dict[str, Any] = dict(),
)
Bases: DomoBase
Condition that must be met for trigger to fire
export_as_dict ¶
export_as_dict(
override_fn: Callable | None = None,
) -> dict[str, Any]
Export condition as unified dictionary format
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Optional function to override export logic |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, Any]
|
Unified condition dictionary with readable format |
Source code in src/crew_dcs/classes/subentity/trigger.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
get_human_readable_description ¶
get_human_readable_description() -> str
Get human-readable description of the condition
Source code in src/crew_dcs/classes/subentity/trigger.py
323 324 325 326 327 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary format
Source code in src/crew_dcs/classes/subentity/trigger.py
297 298 299 300 301 302 303 | |
DomoTriggerEvent_Base
dataclass
¶
DomoTriggerEvent_Base(
event_type: TriggerEventType,
raw: dict[str, Any] = dict(),
)
Bases: DomoBase, ABC
Base class for trigger events
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> DomoTriggerEvent_Base
Factory method to create appropriate trigger event subclass
Source code in src/crew_dcs/classes/subentity/trigger.py
62 63 64 65 66 67 68 69 70 71 72 | |
get_human_readable_description
abstractmethod
¶
get_human_readable_description() -> str
Get human-readable description of the trigger event
Source code in src/crew_dcs/classes/subentity/trigger.py
58 59 60 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary format
Source code in src/crew_dcs/classes/subentity/trigger.py
74 75 76 77 78 79 | |
DomoTriggerEvent_DatasetUpdated
dataclass
¶
DomoTriggerEvent_DatasetUpdated(
event_type: TriggerEventType,
raw: dict[str, Any] = dict(),
dataset_id: str = None,
trigger_on_data_changed: bool = False,
)
Bases: DomoTriggerEvent_Base
Trigger event for dataset updates
export_as_dict ¶
export_as_dict(
override_fn: Callable | None = None,
) -> dict[str, Any]
Export event as unified dictionary format
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Optional function to override export logic |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, Any]
|
Unified event dictionary with readable format |
Source code in src/crew_dcs/classes/subentity/trigger.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
get_human_readable_description ¶
get_human_readable_description() -> str
Get human-readable description
Source code in src/crew_dcs/classes/subentity/trigger.py
110 111 112 113 114 115 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary format
Source code in src/crew_dcs/classes/subentity/trigger.py
125 126 127 128 129 130 131 | |
DomoTriggerEvent_Generic
dataclass
¶
DomoTriggerEvent_Generic(
event_type: TriggerEventType,
raw: dict[str, Any] = dict(),
)
DomoTriggerEvent_Schedule
dataclass
¶
DomoTriggerEvent_Schedule(
event_type: TriggerEventType,
raw: dict[str, Any] = dict(),
schedule_id: str | None = None,
schedule: DomoSchedule_Base | None = None,
)
Bases: DomoTriggerEvent_Base
Trigger event for scheduled execution
Uses DomoSchedule factory to parse and interpret schedule configurations, ensuring consistency with Stream and other schedule implementations.
export_as_dict ¶
export_as_dict(
override_fn: Callable | None = None,
) -> dict[str, Any]
Export event as unified dictionary format
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Optional function to override export logic |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, Any]
|
Unified event dictionary with readable format |
Source code in src/crew_dcs/classes/subentity/trigger.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> DomoTriggerEvent_Schedule
Create schedule event from trigger event dict
Leverages DomoSchedule factory to determine the appropriate schedule type (Simple, Cron, or Advanced) based on the schedule data structure.
Source code in src/crew_dcs/classes/subentity/trigger.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
get_human_readable_description ¶
get_human_readable_description() -> str
Get human-readable description
For schedule triggers, returns the cron expression when available, otherwise returns a human-friendly description.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Human-readable description like "0 47 12 ? * MON *" or "Schedule: Daily at 12:00" |
Source code in src/crew_dcs/classes/subentity/trigger.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary format
Source code in src/crew_dcs/classes/subentity/trigger.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
DomoTriggerSettings
dataclass
¶
DomoTriggerSettings(
triggers: list[DomoTrigger] = list(),
zone_id: str = "UTC",
locale: str = "en_US",
raw: dict[str, Any] = dict(),
parent: Any = None,
)
Bases: DomoBase
Manager for trigger settings (collection of triggers)
export_as_dict ¶
export_as_dict(
override_fn: Callable | None = None,
) -> dict[str, Any]
Export trigger settings as unified dictionary format
Calls export_as_dict on each trigger to get detailed, readable format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Optional function to override export logic |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict[str, Any]
|
Unified trigger settings dictionary with readable format |
Source code in src/crew_dcs/classes/subentity/trigger.py
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | |
from_dict
classmethod
¶
from_dict(
obj: dict[str, Any], parent: Any = None
) -> DomoTriggerSettings
Create DomoTriggerSettings from dictionary
Source code in src/crew_dcs/classes/subentity/trigger.py
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |
from_parent
classmethod
¶
from_parent(
parent: Any, obj: dict[str, Any] | None = None
) -> DomoTriggerSettings
Create from parent entity
Source code in src/crew_dcs/classes/subentity/trigger.py
492 493 494 495 496 497 498 499 500 | |
get_dataset_triggers ¶
get_dataset_triggers() -> list[DomoTrigger]
Get all triggers that have dataset update events
Source code in src/crew_dcs/classes/subentity/trigger.py
547 548 549 | |
get_human_readable_summary ¶
get_human_readable_summary() -> str
Get human-readable summary of all triggers
Source code in src/crew_dcs/classes/subentity/trigger.py
559 560 561 562 563 564 565 566 567 568 | |
get_schedule_triggers ¶
get_schedule_triggers() -> list[DomoTrigger]
Get all triggers that have schedule events
Source code in src/crew_dcs/classes/subentity/trigger.py
543 544 545 | |
get_trigger_by_id ¶
get_trigger_by_id(trigger_id: int) -> DomoTrigger | None
Get a specific trigger by ID
Source code in src/crew_dcs/classes/subentity/trigger.py
536 537 538 539 540 541 | |
has_any_dataset_triggers ¶
has_any_dataset_triggers() -> bool
Check if any trigger has dataset update events
Source code in src/crew_dcs/classes/subentity/trigger.py
555 556 557 | |
has_any_schedules ¶
has_any_schedules() -> bool
Check if any trigger has a schedule event
Source code in src/crew_dcs/classes/subentity/trigger.py
551 552 553 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary format
Source code in src/crew_dcs/classes/subentity/trigger.py
502 503 504 505 506 507 508 | |