Workflow Model
The workflow model has a set of core modules:
Workflow
Represents a single workflow. Workflow objects are created on EPrints startup by the Archive.pm module if use_workflow is set to true in ArchiveConfig?. It has two convenience methods: get_first_stage to get the initial Stage in a workflow, and get_stage to return a Stage given its id (Stages are stored in an array to preserve ordering).
Workflow::Processor
Used as the hook into the Workflow system from the various EPrints cgi scripts. Only requires one function, render, which takes an optional stage id. Displays either the specified page, or the first stage in the workflow. Todo: Allow multiple workflows and pass the workflow ID into the constructor.
Workflow::Stage
Represents a stage in the submission process. Each stage has a set of Components (defined in the configuration), a unique ID, a short name (for the progress control) and a long title. Also has a render method, which takes the current session and EPrint to ensure fields are rendered/completed correctly.
Workflow Configuration
The configuration for a workflow is defined in cfg/workflow.xml. At present only one workflow is defined per archive (for submission).
<wf:workflow>
<!-- The flow itself, going from top to bottom. ref refers to the wf:stage elements -->
<wf:flow>
<wf:stage ref="upload" />
<wf:stage ref="metadata" />
</wf:flow>
<!-- The stage declaration. name should be unique within the workflow -->
<wf:stage name="upload">
<wf:title>Document Upload</wf:title>
<wf:short-title>Upload</wf:short-title>
<!-- Components are ordered from top to bottom on the page, with type corresponding to the Component's type.
Parameters may be passed using <wf:value /> tags (arrays and hashes coming soon) -->
<wf:component type="component/default"><wf:value name="field">title</wf:value></wf:component>
</wf:stage>
</wf:workflow>
Conditionals
Possible uses of conditionals in workflows.
In flow:
<wf:flow>
<wf:if test="$eprint->type eq 'article'">
<wf:stage ref="pubdata" />
</wf:if>
</wf:flow>
In stage:
<wf:stage>
<wf:if test="$eprint->type eq 'patent'">
<wf:component type="component/applicant"><wf:value name="field">patent_applicant"</wf:value></wf:component>
</wf:if>
</wf:stage>
Components
FieldComponents
The FieldComponent module, replacing the Default module, acts as the base of any components which incorporate input fields. Methods are provided to render the 'shell' (i.e. the box around the component), the title, the help text, and the field itself. These may all be overridden. The base component uses the MetaField methods to render and validate the input field.
MultiComponent
Takes a list of fields as a parameter, and renders them as a tightly-packed list of fields. Useful for logical groups (e.g. publication or event details). Help text is concatenated (with headings separating fields).
PlaceHolder
Shown when a requested component could not be created. Could possibly show error messages in future.
Subjects
Displays a hierarchy of subjects and allows the user to select one or more. Has potential to be AJAX-enabled to allow for quick searching of subjects.
Others
Blister
Displays the user's progress through the workflow, with the option of moving to other stages directly. If stages are not completed sufficiently, that stage will be highlighted.
Phrase
A simple component to display a phrase. Takes 'phraseid' as a value.
Uploader
Allows for the addition of multiple files to an EPrint - preferably with as few clicks as possible. Will require hooks to conversion modules.
