Class: Dor::Workflow::Client
- Inherits:
-
Object
- Object
- Dor::Workflow::Client
show all
- Defined in:
- lib/dor/workflow/client.rb,
lib/dor/workflow/client/queues.rb,
lib/dor/workflow/client/status.rb,
lib/dor/workflow/client/version.rb,
lib/dor/workflow/client/requestor.rb,
lib/dor/workflow/client/version_routes.rb,
lib/dor/workflow/client/workflow_routes.rb,
lib/dor/workflow/client/lifecycle_routes.rb,
lib/dor/workflow/client/workflow_template.rb,
lib/dor/workflow/client/connection_factory.rb
Overview
TODO: VALID_STATUS should be just another attribute w/ default
Create and update workflows
Defined Under Namespace
Classes: ConnectionFactory, LifecycleRoutes, Queues, Requestor, Status, VersionRoutes, WorkflowRoutes, WorkflowTemplate
Constant Summary
collapse
- VALID_STATUS =
From Workflow Service's admin/Process.java
%w[waiting completed error queued skipped started].freeze
- VERSION =
'5.0.0'
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(url: nil, logger: default_logger, timeout: nil, connection: nil) ⇒ Client
Configure the workflow service
37
38
39
40
41
|
# File 'lib/dor/workflow/client.rb', line 37
def initialize(url: nil, logger: default_logger, timeout: nil, connection: nil)
raise ArgumentError, 'You must provide either a connection or a url' if !url && !connection
@requestor = Requestor.new(connection: connection || ConnectionFactory.build_connection(url, timeout: timeout, logger: logger))
end
|
Instance Attribute Details
#requestor ⇒ Object
Returns the value of attribute requestor.
30
31
32
|
# File 'lib/dor/workflow/client.rb', line 30
def requestor
@requestor
end
|
Instance Method Details
#lifecycle_routes ⇒ Object
64
65
66
|
# File 'lib/dor/workflow/client.rb', line 64
def lifecycle_routes
@lifecycle_routes ||= LifecycleRoutes.new(requestor: requestor)
end
|
#queues ⇒ Object
56
57
58
|
# File 'lib/dor/workflow/client.rb', line 56
def queues
@queues ||= Queues.new(requestor: requestor)
end
|
#status(druid:, version:) ⇒ Object
84
85
86
|
# File 'lib/dor/workflow/client.rb', line 84
def status(druid:, version:)
Status.new(druid: druid, version: version, lifecycle_routes: lifecycle_routes)
end
|
#templates ⇒ Object
80
81
82
|
# File 'lib/dor/workflow/client.rb', line 80
def templates
WorkflowTemplate.new(requestor: requestor)
end
|
#version_routes ⇒ Object
68
69
70
|
# File 'lib/dor/workflow/client.rb', line 68
def version_routes
@version_routes ||= VersionRoutes.new(requestor: requestor)
end
|
#workflow_routes ⇒ Object
60
61
62
|
# File 'lib/dor/workflow/client.rb', line 60
def workflow_routes
@workflow_routes ||= WorkflowRoutes.new(requestor: requestor)
end
|
#workflow_template(name) ⇒ Object
72
73
74
|
# File 'lib/dor/workflow/client.rb', line 72
def workflow_template(name)
templates.retrieve(name)
end
|
#workflow_templates ⇒ Object
76
77
78
|
# File 'lib/dor/workflow/client.rb', line 76
def workflow_templates
templates.all
end
|