Cheshire3 Objects: Workflow |
A workflow is similar to the process chain concept of an index, but behaves at a more global level. It will allow the configuration of a workflow using Cheshire3 objects and simple code to be defined and executed for input objects. For example, one might define a common workflow pattern of PreParsers, a Parser and then indexing routines in the XML configuration, and then run each document in a documentGroup through it.
This allows users who are not familiar with Python, but who are familiar with XML and the Cheshire3 design to implement tasks as required by changing only configuration files. It thus also allows a user to configure personal workflows in a Cheshire3 system which they don't have permission to modify.
Workflows have the following capabilities:
A sample work flow to parse and index a document might be:
<workflow> <!-- input type: document --> <object type="workflow" ref="PreParserWorkflow"/> <try> <object type="parser" ref="SaxParser"/> </try> <except> <log>Unparsable Record</log> <raise/> </except> <object type="recordStore" function="create_record"/> <object type="database" function="addRecord"/> <object type="database" function="indexRecord"/> <log>Loaded Record</log> </workflow> |
Function | Parameters | Returns | Description |
---|---|---|---|
__init__ | domNode, parentObject | The constructer takes a DOM tree containing the configuration of the index and the object which the database should consider as its parent, normally a database. | |
process | session, object | object | Executes the code as constructed from the XML configuration on the given object. The return value is the last object to be produced by the execution. |