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:
- Creating the hello world WebSphere sMash application
- Adding project dependencies
- Creating a flow in a declarative approach
- 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:
Enter helloworld for the project name, as shown in the following example:
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.
If it is not resolved automatically, then resolve the dependency manually, as shown in the following example.
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:
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:
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: