Class: Dor::Workflow::Client
- Inherits:
-
Object
- Object
- Dor::Workflow::Client
- Defined in:
- lib/dor/workflow/client.rb,
lib/dor/workflow/client/queues.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, VersionRoutes, WorkflowRoutes, WorkflowTemplate
Constant Summary collapse
- VALID_STATUS =
From Workflow Service's admin/Process.java
%w[waiting completed error queued skipped].freeze
- VERSION =
'3.7.0'
Instance Attribute Summary collapse
-
#requestor ⇒ Object
Returns the value of attribute requestor.
Instance Method Summary collapse
-
#initialize(url: nil, logger: default_logger, timeout: nil, connection: nil) ⇒ Client
constructor
Configure the workflow service.
- #lifecycle_routes ⇒ Object
- #queues ⇒ Object
- #version_routes ⇒ Object
- #workflow_routes ⇒ Object
- #workflow_template(name) ⇒ Object
Constructor Details
#initialize(url: nil, logger: default_logger, timeout: nil, connection: nil) ⇒ Client
Configure the workflow service
36 37 38 39 40 |
# File 'lib/dor/workflow/client.rb', line 36 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.
29 30 31 |
# File 'lib/dor/workflow/client.rb', line 29 def requestor @requestor end |
Instance Method Details
#lifecycle_routes ⇒ Object
63 64 65 |
# File 'lib/dor/workflow/client.rb', line 63 def lifecycle_routes @lifecycle_routes ||= LifecycleRoutes.new(requestor: requestor) end |
#queues ⇒ Object
55 56 57 |
# File 'lib/dor/workflow/client.rb', line 55 def queues @queues ||= Queues.new(requestor: requestor) end |
#version_routes ⇒ Object
67 68 69 |
# File 'lib/dor/workflow/client.rb', line 67 def version_routes @version_routes ||= VersionRoutes.new(requestor: requestor) end |
#workflow_routes ⇒ Object
59 60 61 |
# File 'lib/dor/workflow/client.rb', line 59 def workflow_routes @workflow_routes ||= WorkflowRoutes.new(requestor: requestor) end |
#workflow_template(name) ⇒ Object
71 72 73 |
# File 'lib/dor/workflow/client.rb', line 71 def workflow_template(name) WorkflowTemplate.new(requestor: requestor).retrieve(name) end |