Skip to content

Workflow Viewer_138773144

nxi edited this page Apr 9, 2015 · 1 revision
Created by Tony Lam, last modified on Feb 07, 2010

Introduction

Workflow viewer is the visual representation of a workflow. It can display a workflow as a sequence of tasks in a single page, or in multi pages wizard dialog. The viewer can be served as a read-only workflow display, or a dynamic editor for composing tasks for a workflow. Image:attachments/138773144/139001876.png

Programming with Workflow Viewer

The workflow viewer is a normal SWT component which can be attached to any SWT composite object. Before the viewer is activated (by calling afterParametersSet()), users can inject a workflow object as the model of this viewer. Without the object injection, a default empty workflow will be used.
// Create a new viewer instance
IWorkflowViewer viewer = new WorkflowViewer(parent, SWT.NONE);
// Inject a workflow (optional)
viewer.setWorkflow(workflow);
// Activate the viewer
viewer.afterParametersSet();
You can use the SWT style bit to configure the appearance of the viewer, for example, the following can be used to hide the tool bar:
// Do not render tool bar on the left hand side
IWorkflowViewer viewer = new WorkflowViewer(parent, IWorkflowViewer.NO_TOOL);
After the viewer is activated, further setting of workflow will trigger a refresh of the viewer. This means at runtime you can swap the workflow without recreating a new viewer.

Workflow Viewer Component

The workflow viewer is designed to extensible, so that it can be used for different context. One example is that we use this workflow viewer as a composer for the visual SICS batch system. The extensibility of the viewer is achieved by the composition pattern. Each viewer is composed by two components (known as the workflow viewer component). On the left hand side there is a tool component, and on the right hand side there is a main component. Each component can be composed by other workflow viewer components.

Attachments:

Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally