Composing Workflows



This tutorial describes how to compose a workflow using a simple math example. For how to install/start the XBaya, please go to Running the XBaya.


The main window consists of several panels. The "Composer" panel is the place where you can compose a workflow graphically. The "Component List" panel shows the list of components that we can select add to the composing workflow. The "Component Information" panel shows the information of a component selected either in the Component List panel or in the Compose panel. The "Port Information" panel shows the information of ports (input/output of a component).

Initial view

Creating a simple math workflow

First, we make a very simple workflow that consists of one Adder component. The adder component takes two input parameters, adds them, and outputs the result.

Adding an Adder component

First we add an Adder component to the workflow. To add a component, you need to find a component from the Component List panel. The Adder component registered under the local directory (shown as

or something similar). (The XBaya supports several different types of component registries as described in
Web Service registries, but the resource catalog is the one that LEAD related components are registered.) When you select a service, the information of the service is displayed in the Component Information panel.

Selecting the Adder component

To add the Adder component to the workflow, you can simply drag-and-drop the component from the Component List panel to the place where you want to add the component in the Composer panel. Alternatively, you can use "Add Node" button to add the selected component.

To adjust the position of the component, you can drag the top part of the component. To remove a component from a workflow, you can type "Delete" key of your keyboard, click "Remove Node" button, or right click on the top part of the component and select "Delete" from the pop-up menu.

The blue triangle(s) on left side of a component indicate the input ports and the green triangle(s) on the right side indicate the output ports. Here, the Adder component has two inputs and one output.

Adding the Adder component

Adding input parameters

The next step is to add special components to indicate the input parameters of the workflow.

As before, select the Input component from the Component List panel. The Input component is under "System Components".

Selecting the Input component

Then, drag and drop the Input component to the Composer panel.

Adding the Input component

Next, you need to connect the Input component to one of the input ports of the Adder component. To connect two ports, you can push a mouse button on one port (triangle at the side of a component), drag the mouse to other port, and release the mouse.

Connecting the adder component

The information of the ports are displayed in the Port Information panel. When you connect the Input component to other component, the name of the Input component is changed to the name of the input port.

Alternatively, you can select both ports by clicking the triangles, and click "Connect / Disconnect" button.

To remove the connection, you can right click on the circle in the middle of the connection, then either push "Delete" key on your keyboard or click "Connect / Disconnect" button. You can also remove the connection from the pop-up menu by right-click on the circle.

Connecting the adder component

Optionally, you can set the default value of the input by clicking the part of the Input component that is labeled as "Set Value". If you omit to give the input parameter when launching the workflow script, the value set here will be used. (Currently, the default value set here is not used when you launch the workflow from the LEAD portal. Also, the input parameters to the Adder component should be numbers, but currently the service generated by Generic Factory Toolkit can have only string type.)

Setting the default value of the
Input component

In the same way, you can add one more Input component and connect it to the second input port of the Adder component.

Connecting the adder component

Adding an output parameter

Now, you need to add an Output component to the workflow. Output parameters are actually not required to compose a workflow, but there are some merit of specifying output parameters explicitly. For example, when you run the workflow script, the script displays the output you are interested in more suitable format. (Future work: Also, it becomes possible to include the workflow as a component into another workflow.) To add an Output component the workflow, drag-and-drop the Output component from the Component List panel to the Composer panel. Then, connect it to the output port (the triangle on the right side) of the Adder component.

Connecting the adder component

Saving the workflow

You can save the workflow so that you can modify in the later. To save it as a local file, select "Save Workflow" from "Workflow" menu. You can always open the locally-saved workflows by selecting "Open Workflow".

Connecting the adder component

When you complete your workflow, you can save it to myLead. If you launch the XWF Composer from the LEAD portal, your information to connect to myLead, such as user ID, project name, etc. is configured properly, you just need to select "Save Workflow to MyLead" under "MyLead" menu.

Connecting the adder component

Then, you need to add the name and description of the workflow, and click "OK".

Connecting the adder component

Exporting the workflow as a Jython script

You can export the workflow as a Jython script. To do that, select "Workflow" from the menu, and "Export WS Jython Script".

Exporting the workflow as a Jython script

Creating a complicated math workflow

Now, we create a more complicated workflow. As before, add components and connect them as shown below.

Creating a complicated math workflow

Unlike the previous example, outputs of Adder components are the input of the Multiplier component. As before, save the workflow and export it as a Jython script from the menu.

To understand how the worlflow Jython script work, go to Interpreting workflow scripts. To learn how to run the workflow script, go to Running workflows.

Satoshi Shirasuna