Join wMUsers | Blog at wMUsers | User Control Panel | Site Map | webMethods Jobs |For Employers

Dan Green -- webMethods Ezine Columnist

Using HTML to submit data to Flow



By Dan Green

 

Introduction

For Web-based input, a webMethods developer can use HTML forms to submit data directly to a webMethods Flow. This webMethods Ezine article will demonstrate using HTML to introduce non-binary data into a webMethods Flow.

Don't worry if you don't know HTML -- we'll show you what you need to know to get it done.


When to use Web-based form input

The most simple case of using Web-based input is for a simple request-and-reply scenario. Our example will use a single input and return a single output.

Let's assume any one of the following business problems:

User inputs a foreign currency and its exchange rate relative to the U.S. Dollar is returned

User inputs an invoice number and its order status is returned

User inputs a DUNS number and its associated company name is returned

User inputs a SKU and its associated product name is returned

 

There are literally hundreds of simple scenarios and, in each, the data processing and Flow logic follows the same pattern:

  1. User provides data in the form text field
  2. User clicks "Submit" button to send the data to the webMethods Flow
  3. The Flow accepts the form data and assigns it to an input variable
  4. The Flow executes and generates an output value
  5. The Flow uses a DSP template to format the output for the user
  6. The User's browser displays the DSP as an HTML document containing the output value

We'll build our sample in four steps:

  1. Build the webMethods Flow
  2. Build the HTML form
  3. Build the output DSP
  4. Add the output DSP to the Flow

So, let's get started and learn how to submit Web-based input to webMethods Flow.


Designing the webMethods Flow

To prepare for Web-based input, we'll need to create a Flow that performs a few tasks:

  1. Accepts an input variable
  2. Performs some action
  3. Assigns an output variable
  4. Generates a HTML document from a DSP

Let's create a Flow in the wMUsers package in the following namespace:

wMUsers:htmlReply

From the Input/Output tab, let's first assign the proper values. For input, create a String variable named "htmlInput" and for the Output, create a String variable named "outputValue".

Your Flow's Input/Output should resemble the example below:


Flow Input/Output tab

 

Just to make sure that everything is proper, select the "Flow" tab, add your and confirm that both the Pipeline In and Pipeline Out variables are displayed as below:

Build the Flow to invoke the business logic service(s) on the input variable htmlInput and then map the results to the output variable outputValue. This is the value that will be returned to the user.

Your completed Flow will resemble the following:


View of the Pipeline In and Pipeline Out Maps

 

Before taking anymore steps, test your Flow using CTRL-R. Developer will prompt you for an input value; provide one in the input box. After thorough unit testing, we know that our output value will always be correct.

Later in this article, we will build and assign a DSP to our webMethods Flow. For now, we know that we have a working piece of software ready for user input.

So, let's move ahead and build our HTML input form for the user.



[1]  2  Next>>

Go Deeper on the Subject: The wMUsers Discussion Forums


Dan Green is the Founder and Director of the wMUsers. He can be reached via email at .


Advertise at wMUsers






  Home | Join wMUsers | Discussion Forums | Knowledge Center | Jobs | Shareware | User Groups | Links |
Contact Us | Terms of Service | Privacy Policy

wMUsers is an independent organization and is not sponsored in any manner by Software AG.


© All Rights Reserved, 2001-2008.