Training

WASKB020 - Working With Simple Data Types from a Process in WebSphere Integration Developer 6 Tutorial

Popular Courses

Browse Our Free Resources

  • whitepapers
  • whitepapers
  • webinars
  • blogs

Our Locations

Training Centres

Vancouver, BC
Calgary, AB
Edmonton, AB
Toronto, ON
Ottawa, ON
Montreal, QC
Hunt Valley
Columbia

locations map

Calgary

550 6th Av SW
Suite 475
Calgary, AB
T2P 0S2

Toronto

821A Bloor Street West
Toronto, ON
M6G 1M1

Vancouver

409 Granville St
Suite 902
Vancouver, BC
V6C 1T2

U.S. Office

436 York Road
Suite 1
Jenkintown, PA
19046

Other Locations

Dallas, TX
Miami, FL

Web Age Solutions Inc.

Introduction

A BPEL business process can receive input data and send output data to the invoker of the process. In WebSphere Integration Developer (WID), the type of the input or output data must be a valid XML element or a predefined XML data type (such as xsd:double or xsd:string).

Prerequisite

This tutorial builds on WASKB019 Creating a Basic Business Process in WebSphere Integration Developer 6. You must complete that tutorial first.

The Business Problem

At this point, the HelloWorld process simply prints out a message in the console. We will change the process to accept the name of a person as input and reply a greeting as the output. In both cases, we will work with the string data type.

Create New Variables

Launch WID if it is not already started. Start the WebSphere Process Server v6.0.

In the Business Integration view, expand SimpleModule->Business Logic->Processes. Double click on HelloWorld to open the process in the process editor.

In the right hand side palette, locate the Input1 variable.

Select the variable. Click on the X icon to remove the variable.

Click on the + icon to add a new variable. Change its name to fullName. At the bottom of the screen activate the Properties view. Click on the Details tab. Next to Data Type click on Browse. Select string and click on OK.

Similarly, add another variable called greeting and set the data type to string.

Save changes (Control+S). System will begin building the workspace. There will be an error message since, parts of the process are still referring to the deleted variable Input1. Ignore this message.

Configure the Input and Output of the Process

Select the Receive activity in the process editor. In the Properties view, click on the Details tab.

At the right end of the Input(s) row, click on the ... button as shown above. Choose the fullName variable and click on OK. This will cause the system to save the input data in the fullName variable.

Similarly, select the Reply activity and from the details property page, set the greeting variable as the output.

Change the Snippet

Select the Say Hello snippet activity. In the Properties view, select the Details tab. Change the snippet code to as follows.

greeting = "Hello " + fullName;

Save changes. Use the Problems view to make sure that there are no compilation error.

Test the Process

We made a few changes to the process. It is safe to restart the application before testing the process. In the Servers view, right click on the server and select Restart Project->SimpleModuleApp. Watch the botton right hand corner for the progress of the publishing process. Wait for it to complete.

Open the assembly editor by double clicking on SimpleModule->SimpleModule. Right click anywhere in the diagram and select Test Module.

In the Initial request parameters table, set the input1 data to John Doe as shown above. Click on Continue.

Select the Return node in the Events tree view area as shown above. Make sure that the output1 field of the reply data shows "Hello John Doe".

To run the test using another input data, click on the Invoke toolbar button in the top right hand corner of the test script editor window.

Enter a new value for the the input1 filed of the input data and click on Continue.

Summary

In this tutorial, you learned how to:

  1. Declare new process variables.
  2. Setup a process variable to recieve the input to the process.
  3. Setup a process variable from where the output data of the process is constructed.
  4. Enter input data during unit test.
  5. Review the output data during test.

Later, we will learn how to work with more complex data structure. The basic steps will be same as what we have learned here.


Feedback


Email Address: *


Very useful Somewhat useful Not bad Needs many corrections


Comments:
*


( * ) = mandatory field