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/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
Constant Summary collapse
- VALID_STATUS =
From Workflow Service's admin/Process.java
%w[waiting completed error queued skipped hold].freeze
- VERSION =
'3.3.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
Constructor Details
#initialize(url: nil, logger: default_logger, timeout: nil, connection: nil) ⇒ Client
Configure the workflow service
34 35 36 37 38 |
# File 'lib/dor/workflow/client.rb', line 34 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.
27 28 29 |
# File 'lib/dor/workflow/client.rb', line 27 def requestor @requestor end |
Instance Method Details
#lifecycle_routes ⇒ Object
61 62 63 |
# File 'lib/dor/workflow/client.rb', line 61 def lifecycle_routes @lifecycle_routes ||= LifecycleRoutes.new(requestor: requestor) end |
#queues ⇒ Object
53 54 55 |
# File 'lib/dor/workflow/client.rb', line 53 def queues @queues ||= Queues.new(requestor: requestor) end |
#version_routes ⇒ Object
65 66 67 |
# File 'lib/dor/workflow/client.rb', line 65 def version_routes @version_routes ||= VersionRoutes.new(requestor: requestor) end |
#workflow_routes ⇒ Object
57 58 59 |
# File 'lib/dor/workflow/client.rb', line 57 def workflow_routes @workflow_routes ||= WorkflowRoutes.new(requestor: requestor) end |