Class: Legion::Gaia::Workflow::Checkpoint

Inherits:
Data
  • Object
show all
Defined in:
lib/legion/gaia/workflow/checkpoint.rb

Overview

Represents a named checkpoint attached to a state. A checkpoint pauses progression until its condition is satisfied. Unlike a guard (which is evaluated on the outgoing transition), a checkpoint is evaluated when attempting to ENTER or LEAVE a state —the workflow sits in a :waiting sub-status until the condition passes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition

Returns:

  • (Object)

    the current value of condition



11
12
13
# File 'lib/legion/gaia/workflow/checkpoint.rb', line 11

def condition
  @condition
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



11
12
13
# File 'lib/legion/gaia/workflow/checkpoint.rb', line 11

def name
  @name
end

#stateObject (readonly)

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



11
12
13
# File 'lib/legion/gaia/workflow/checkpoint.rb', line 11

def state
  @state
end

Instance Method Details

#satisfied?(ctx = {}) ⇒ Boolean

Parameters:

  • ctx (Hash) (defaults to: {})

    arbitrary context provided by the caller

Returns:

  • (Boolean)


14
15
16
# File 'lib/legion/gaia/workflow/checkpoint.rb', line 14

def satisfied?(ctx = {})
  condition.nil? || condition.call(ctx)
end