Class: WorkflowRb::Db::WorkflowInstance

Inherits:
WorkflowRecord
  • Object
show all
Defined in:
lib/workflow_rb/db/entities.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.abstract_class?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/workflow_rb/db/entities.rb', line 14

def self.abstract_class?
  false
end

Instance Method Details

#pack(workflow) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/workflow_rb/db/entities.rb', line 18

def pack(workflow)
  # self.id = workflow.id

  self.definition_id = workflow.definition_id
  self.version = workflow.version
  self.description = workflow.description
  self.next_execution = workflow.next_execution
  self.status = workflow.status
  self.create_time = workflow.create_time
  self.complete_time = workflow.complete_time
  self.data = YAML.dump(workflow.data)
  self.execution_pointers = YAML.dump(workflow.execution_pointers)
end

#unpackObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/workflow_rb/db/entities.rb', line 31

def unpack
  result = WorkflowRb::WorkflowInstance.new
  result.id = self.id
  result.definition_id = self.definition_id
  result.version = self.version
  result.description = self.description
  result.next_execution = self.next_execution
  result.status = self.status
  result.create_time = self.create_time
  result.complete_time = self.complete_time
  result.data = YAML.load(self.data)
  result.execution_pointers = YAML.load(self.execution_pointers)

  result
end