No release in over 3 years
Enables Ruby manipulation of the DOR Workflow Service via its REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.5, >= 0.5.1
>= 0
~> 3.3
~> 0.63.1
>= 0

Runtime

>= 3.2.1, < 6
>= 0.2.7, < 2
~> 0.9, >= 0.9.2
>= 2.9.4, < 4.a
~> 1.6
 Project Readme

CircleCI Test Coverage Maintainability

Gem Version

dor-workflow-client gem

A Ruby client to work with the DOR Workflow REST Service. The REST API is defined here: https://consul.stanford.edu/display/DOR/DOR+services#DORservices-initializeworkflow

Usage

Initialize a Dor::Workflow::Client object in your application configuration, i.e. in a bootup or startup method like:

client = Dor::Workflow::Client.new(url: 'https://test-server.edu/workflow/')

Consumers of recent versions of the dor-services gem can access the configured Dor::Workflow::Client object via Dor::Config.

API

Rubydoc

Example usage

Create a workflow

client.create_workflow_by_name('druid:bc123df4567', 'etdSubmitWF', version: '1')

Update a workflow step's status

client.update_status(druid: 'druid:bc123df4567',
                     workflow: 'etdSubmitWF',
                     process: 'registrar-approval',
                     status: 'completed')

Show "milestones" for an object

client.milestones(druid: 'druid:gv054hp4128')
#=> [{version: '1', milestone: 'published'}]

List workflow templates

client.workflow_templates

Show a workflow template

client.workflow_template('etdSubmitWF')

Get the status of an object

client.status(druid: 'druid:gv054hp4128', version: '3').display
#=> "v3 Accessioned"

Underlying Clients

This gem currently uses the Faraday HTTP client to access the back-end service. The clients be accessed directly from your Dor::Workflow::Client object:

wfs.connection # the Faraday object

Or for advanced configurations, ONE of them (not both) can be passed to the constructor instead of the raw URL string:

conn = Faraday.new(:url => 'http://sushi.com') do |faraday|
  faraday.request  :url_encoded             # form-encode POST params
  faraday.response :logger                  # log requests to STDOUT
  faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP
end
wfs = Dor::Workflow::Client.new(connection: conn)