Cheshire3 Configuration - Workflows

Introduction

Workflow can be configured to define a series of processing steps that are common to several Cheshire3 Database or Server, as an alternative to writing customized code for each.

Workflow Configuration Elements

<workflow>

Base wrapping tags for workflows; analagous to <process> and <preprocess> in Index configurations.

Contains an ordered list of <object>s. The results of the first object is given to the second and so on down the chain. It should be apparent that subsequent objects must be able to accept as input, the result of the previous.

<object>

A call to an object within the system. <object> s define the following attributes:

type [ mandatory ]

Specifies the type of the object within the Cheshire3 framework. Broadly speaking this may be a:

  • preParser
  • parser
  • database
  • recordStore
  • index
  • logger
  • transformer
  • workflow
ref
A reference to a configured object within the system. If unspecified, the current Session is used to determine which Server, Database, RecordStore and so forth should be used.
function
The name of the method to call on the object. If unspecified, the default function for the particular type of object is called.

For existing processing objects that can be used in these fields, see the object documentation.

<log>

Log text to a Logger object. A reference to a configured Logger may be provided using the ref attribute. If no ref attribute is present, the Database ‘s default logger is used.

<assign>

Assign a specified value to a variable with a given name. Requires both of the following attributes:

from [ mandatory ]
the value to assign
to [ mandatory ]
a name to refer to the variable

<fork>

Feed the current input into each processing fork. [ more details to follow in v1.1]

<for-each>

Iterate/loop through the items in the input object. Like <workflow> contains an ordered list of <object>s . Each of the items in the input is run through the chain of processing objects.

<try>

Allows for error catching. Any errors that occur within this element will not cause the Workflow to exit with a failure. Must be followed by one <except> elements, which may in turn also be followed by one <else> element.

<except>

Enables error handling. This element may only follow a <try> element. Specifies action to take in the event of an error occurring during the work executed within the preceding <try>.

<else>

Success handling. This element may follow a <try> / <except> pair.

Specifies the action to take in the event that no errors occur within the preceding <try>.

<continue/>

Skip remaining processing steps, and move on to next iteration while inside a <for-each> loop element. May not contain any further elements or attributes. This can be useful in the error handling <except> element, e.g. if a document cannot be parsed, it cannot be indexed, so skip to next Document in the DocumentFactory.

<break/>

Break out of a <for-each> loop element, skipping all subsequent processing steps, and all remaining iterations. May not contain any further elements or attributes.

<raise/>

Raise an error occurring within the preceding <try> to the calling script or Workflow. May only be used within an <except> element. May not contain any further elements or attributes.

<return/>

Return the result of the previous step to the calling script or Workflow. May not contain any further elements or attributes.