Module: Cadence::Workflow::Decision

Defined in:
lib/cadence/workflow/decision.rb

Defined Under Namespace

Classes: CancelTimer, CompleteWorkflow, FailWorkflow, RecordMarker, RequestActivityCancellation, ScheduleActivity, StartChildWorkflow, StartTimer

Constant Summary collapse

SCHEDULE_ACTIVITY_TYPE =

only these decisions are supported right now

:schedule_activity
START_CHILD_WORKFLOW_TYPE =
:start_child_workflow
RECORD_MARKER_TYPE =
:record_marker
START_TIMER_TYPE =
:start_timer
CANCEL_TIMER_TYPE =
:cancel_timer
COMPLETE_WORKFLOW_TYPE =
:complete_workflow
FAIL_WORKFLOW_TYPE =
:fail_workflow
DECISION_CLASS_MAP =
{
  SCHEDULE_ACTIVITY_TYPE => ScheduleActivity,
  START_CHILD_WORKFLOW_TYPE => StartChildWorkflow,
  RECORD_MARKER_TYPE => RecordMarker,
  START_TIMER_TYPE => StartTimer,
  CANCEL_TIMER_TYPE => CancelTimer,
  COMPLETE_WORKFLOW_TYPE => CompleteWorkflow,
  FAIL_WORKFLOW_TYPE => FailWorkflow
}.freeze

Class Method Summary collapse

Class Method Details

.generate(type, **args) ⇒ Object



33
34
35
36
# File 'lib/cadence/workflow/decision.rb', line 33

def self.generate(type, **args)
  decision_class = DECISION_CLASS_MAP[type]
  decision_class.new(**args)
end