Creating a simple Assemble flow

This article provides a brief introduction to starting with simple Assemble flow.

Before you begin

This tutorial is for new Assemble flow users and introduces creating a simple flow. This tutorial assumes that you have basic knowledge of the IBM® WebSphere® sMash programming model, and XML basic knowledge.

Over the course of this tutorial, you will learn how to use WebSphere sMash Assemble flow to create a simple hello world flow.

Creating a hello world flow

Use the following steps, detailed in the following sections, to create the hello world flow:

  1. Creating the hello world WebSphere sMash application
  2. Adding project dependencies
  3. Creating a flow in a declarative approach
  4. Running and seeing the result of the flow

Creating the hello world WebSphere sMash application

Create a new WebSphere sMash application, as shown in the following example:

Creating a new WebSphere sMash application

Enter helloworld for the project name, as shown in the following example:

Naming the project helloworld

Adding project dependencies

From the config directory, open the ivy.xml file. The Zero Package Information page is shown. Add the dependency with zero:zero.assemble.flow([1.1.0.0, 1.2.0.0[) from the list, as shown in the following example.

Adding a dependecy

If it is not resolved automatically, then resolve the dependency manually, as shown in the following example.

Resolving the dependency

For more information, see the resolving dependencies information.

Creating a flow in a declarative approach

From the new helloworld folder under the /public folder, create the index.flow file, as shown in the following example:

Creating the index.flow file

Add the flow definition, as shown in the following example, to the /public/helloworld/index.flow:

<process name="echoProcess">
  <receiveGET name="echoRcv"/>
  <replyGET name="echoReply">
    <input value="Hello,${echoRcv.q[0]}" content-type="text/plain"/>
  </replyGET>
</process>

Running and seeing the result of the flow

Run the helloworld flow, as shown in the following example:

Running the helloworld flow

After successfully running the project, access the flow with the following URL: http://localhost:8080/helloworld?q=world. The result is similar to the following example:

Result of the hello world flow

Version 1.1.31300