Workspace 7.0.2
Comparing two Workspace workflows

Introduction

The application workspace-diff is a differencing tool for comparing two Workspace workflows, presenting differences visually so that they are easy to find and comprehend. It is most valuable when used to compare a base file with a modified version of it. The underlying differencing framework operates directly on the file xml code, but the application also displays both workflows in the workspace format so that you can connect the differences to the operations in a familiar format.


Contents


Sample files used in this tutorial


Comparison tool layout

There are three main layout components to the tool:

  1. The file name entry widgets, where you the select the two workflows that you want to compare: WorkflowA and WorkflowB (or Base and Modified). Usually you will want to compare two workflows with a common ancestor, or where one is a modified version of the other.
  2. The Workflow Panels show the workflows graphically in tabs similar to those in the workflow editor (but with adjustments that highlight differences).
  3. The Difference List Panel highlights the differences found as a tree widget

These are described in more detail later in the tutorial when we look at the tool

Layout


Creating base and modified workflows to compare

For the purposes of this tutorial, we are going to create two workflows where one is a modified version of the other. We will then look at them with the workflow comparison tool. To create the base workflow:

  1. Drag a LogText operation onto the canvas
  2. Then create an input variable by
    • right-mouse-clicking on its Strings input and choosing Add input element.
    • right-mouse-clicking on the new element and choosing Create variable

  3. Create a Workspace output by right-mouse-clicking on the LogText operation’s Dependencies output

  4. Select the Strings Variable operation so that the Operation editor – Strings is visible and enter “Welcome to Workspace”

  5. Save the file as welcome to workspace.wsx

    Now we are going to make a small modification to the workflow

  6. Add another input element and Variable to the Log Text operation, and give it the text “ workflow tools”

  7. Rename the two Variable operations to Workspace and Tools by
    • Right-mouse-clicking on the operation and
    • selecting Properties and then
    • changing the label (to Workspace or Tools)

  8. Save this modified workflow as welcome to workspace tools.wsx

Using the Workflow Comparison Tool

  1. Open the workflow comparison tool workspace-diff (see Starting the application)
  2. Load the two workflows you have just created:
    • Load "welcome to workspace.wsx" as WorkflowA and
    • Load "welcome to workspace tools.wsx" as WorkflowB
The workflow comparison tool

The Workflow Panels

Each workflow is represented graphically in a tabbed widget similarly to that of the workspace editor. There are some colour differences designed to highlight differences between the two workflows. Items that exist only in Workflow A are highlighted in gold and items that exist only in Workflow B are highlighted in purple. Operations/connections that are part of both workflows are given a light -yellow outline if something has changed. If you want to see the highlighted outlines more clearly, you can toggle between greyscale and coloured operations by clicking on the “desaturate operations” tool button. You can also change the annotation colours used.

You can restore the natural colours of the operations so that they look like they do in the workspace editor

The Difference List Panel



The difference list panel presents the changes in a tree widget. In this example, three operations have changed, each corresponds to a top-level entry in the Difference List.

The changes detected are as follows:

  • 1 The Variable operation labelled “Tools” has been created. It only exists in Workflow2. It has a solid purple colour to show that it exists in Workflow2 (the purple workflow) but not Workflow Its value in the Workflow 1 column is greyed out as it doesn’t exist.
  • 1.1 A new connection has also been created, connections are always shown as children of the source operation.
  • 2 The LogText operation labelled “Log Text” exists in both workflows and is striped gold and purple to indicate this.
  • 2.1 The Strings input array has changed. You can expand the entry to get more detail about what has changed (the size has changed from 1 to 2)
  • 3 The other operation is a Variable operation that has changed. It has linked the Strings variable in WorkflowA to the Workspace variable in WorkflowB because they have the same id. Here the detail has been expanded so that you can see the that
  • 3.1 the attribute dataname and
  • 3.2 the attribute label have both been changed from Strings to Workspace.
  • 3.3 The input Strings has a (file) entry only in WorkflowA
  • 3.4 the input Workspace has a (file) entry only in WorkflowB
  • 3.5 the connection between it and the LogText operation has also changed, and
  • 3.5.1 the connection src_name attribute is different

Refer also to the entry Workflow comparison in developer's tips and tricks