Skip to main content

skip to main content

developerWorks  >  WebSphere | SOA and Web services  >

Using Service Flow Modeler V6 to create Web services for CICS screen-based applications

developerWorks
Document options
PDF format - A4

PDF - A4
4 KB

PDF format - letter

PDF - Letter
4 KB

Get Adobe® Reader®

Document options requiring JavaScript are not displayed

Sample code


Rate this page

Help us improve this content


Level: Intermediate

Freddy Lu (lupl@tw.ibm.com), Staff Software Engineer, IBM
Rick Hwang (rickhw@tw.ibm.com), Software Engineer, IBM
Natalius Huang (klhuang@tw.ibm.com), Software Engineer, IBM
Dave Lin (davelin@tw.ibm.com), Staff Software Engineer, IBM

31 Jan 2007

Service Flow Modeler (SFM) is a component of WebSphere® Developer for zSeries V6. SFM provides a development environment for host application developers to create Web services on CICS, especially for screen-based application. SFM creates Web services by extracting screen-based host application business logic without source code. This article introduces SFM and explains how to develop a CICS Web service for screen-based applications without modifying source code.

Introduction

Many corporations today face the problem that many of the applications that are fundamental to their business, applications running on large transaction processing systems for example, were developed many years ago. These applications in their current state do not lend themselves to a service-oriented architecture (SOA). Corporations continue to rely on them mainly because they have been tried and tested over time and represent a substantial investment.

Corporations do not want to commit the IT development resources to redesign or recreate the business functions already present in their existing enterprise information systems (EIS). Instead, corporations want access to tools that integrate the business functions in existing applications and systems with the technology that supports on-demand business goals and objectives. Figure 1 illustrates this transformation.


Figure 1: Enterprise Information Systems
Enterprise Information Systems

By implementing a service-oriented architecture, a corporation can unite employees, partners, and suppliers with the systems and information that enable them to do business more effectively.

In the following sections we’ll look at each of the key components needed for this transformation: the Service Flow Modeler, XML Services for the Enterprise, and the CICS Service Flow Runtime.

Service Flow Modeler overview

The Service Flow Modeler (SFM), a component of WebSphere Developer for zSeries (hereafter called WebSphere Developer), is a multi-functional tool supporting modern application architectures, and the transformation and reuse of existing application processes. It helps leverage your investment and the quality of service (QoS) of existing enterprise information systems and the CICS runtime. At the same time, SFM enables the move towards a service-oriented architecture. Figure 2 shows the major components that comprise SFM.


Figure 2: Service Flow Modeler
Service Flow Modeler

You can use SFM to perform the following tasks:

  • Model a newly composed business service -- or flow -- using processes or services and their interfaces.
  • Capture existing EIS (screen or communication area) interfaces or generate new SOA-suitable interfaces.
  • Generate adapters to and from interfaces that support both the accumulation of information -- used in requests and response processing -- and data transformation activities between the flow and the interface.
  • Expose business flows as a service or Web service.

XML Services for the Enterprise overview

XML Services for the Enterprise (XSE) is another component of WebSphere Developer that helps you generate Web service components for enterprise services.

The Web service components include:

  • XML schema
  • WSDL
  • Bind file
  • COBOL converters (or correlators)

XSE features an easy-to-use set of wizards for creating a Web service from a single COBOL data structure (COMMAREA).

You should consider using XSE if you can map your Web service directly to a single CICS COMMAREA transaction, or if creation of the Web service needs to be integrated with an automated build process.

CICS Service Flow Runtime overview

CICS Service Flow Runtime 3.1 is the server runtime environment for the adapter services that you model, generate and deploy using SFM. An adapter service is a reusable, composed business function that exposes a programmatic interface to a service requestor in an EIS.

The CICS Service Flow Runtime environment supports four types of adapters:

  • Distributed Program Link (DPL) adapters
  • Link3270 Bridge adapters
  • Front End Programming Interface (FEPI) adapters
  • WebSphere MQ adapters

Depending on how you model the adapter service, it can contain a wide variety of functionality, such as:

  • Control flow
  • Data flow
  • Sequential navigation
  • Conditional branching including decision and iteration
  • Data typing
  • Storing data context
  • Transformation of data elements
  • Logical operations
  • Custom code.

Overview of creating a service flow for a CICS screen application

In an EIS, CICS screen-based applications with terminal interfaces are widely used and are one of most important application types. The CICS screen-based application is usually composed of the following source components:

  • Application process: Where you define the application process and business logic. Usually written in COBOL or other languages.
  • Screen definition: Where you define the layout and field attributes in the application screens. The screens are usually defined as Basic Mapping Support (BMS) maps.
  • CICS resource definition: Where you define the program, screen, transaction and other resources in the CICS region.

With SFM, you can create service flows for CICS screen-based applications to extract business logic without modifying any source components. To achieve this goal, in SFM we need to define:

  • Screen recognition: Specify screen recognition criteria to recognize each screen of the screen-based application
  • Screen operation: Record screen operating actions, specify the fields to be inserted or extracted and action keys for each screen.
  • Flow execution: Specify a CICS SFR-supported adapter to execute the service flow. The adapters that support the CICS screen-based flow are the Link3270 Bridge adapter and the FEPI adapter.

Prerequisites

To prepare your environment for this tutorial, make sure the following products are installed on your host system:

  • z/OS V1.4
  • COBOL compiler
  • CICS Transaction Server 3.1
    • Ensure that SFR is ready
    • Ensure that Web services and TCPIPSERVICE on CICS are well configured
  • MVS/TSO/USS System
  • Remote System Explorer (RSE)

For more details, such as the required components and program temporary fixes (PTFs) for the programs listed above, please refer to WebSphere Developer for zSeries

Creating the CICS Web service

To create a CICS Web service, you need to complete the following development tasks, which are covered in detail in the following sections:

  1. Install the host application
  2. Install Rational Application Developer and WebSphere Developer for zSeries
  3. Create a terminal-based application in an SFM project
  4. Record an SFM flow
  5. Create and configure generation properties
  6. Deploy the runtime code to CICS
  7. Test the CICS Web service via the Web Service Explorer

This article was developed and tested on a Windows 2000 Professional workstation connected to a z/OS system called NKAP. Parts of the article require that you have established connectivity to a z/OS system that contains a running CICS Transaction Server Version 3.1 region.

1. Install the host application

The NKAP host application is a CICS screen-based application used in this tutorial as the target application. NKAP includes the two screens below: The first screen (Figure 3) allows you to input an account number. In our example, account 1000 is created.


Figure 3: First screen of the application
First screen of the application

The second screen (Figure 4) returns detailed information about the account.


Figure 4: Second screen of the application
Second screen of the application

The COBOL source files and BMS map are attached in the Download section in this article. Please download the file, transfer it to the host, compile and deploy it to your CICS TS 3.1 region.



Back to top


2. Install Rational Application Developer and WebSphere Developer for zSeries

In this section you’ll install Rational Application Developer and WebSphere Developer for zSeries (which sits on top of Application Developer), and apply any fixes:

  1. Rational Application Developer (RAD) V6 must be installed prior to installing WebSphere Developer. From disk 1 of RAD V6, launch launchpad.exe to bring up the Launchpad shown on Figure 5. For detailed information on installation procedures, see the installation guide.

    Figure 5: Rational Application Developer Launchpad
    Rational Application Developer Launchpad

  2. Next install WebSphere Developer V6 by launching launchpad.exe on disk 1 of WebSphere Developer, as shown in Figure 6. Follow the instruction to install the product.

    Figure 6: WebSphere Developer for zSeries Launchpad
    WebSphere Developer for zSeries Launchpad

  3. The next step is to apply the update for the installed products. Rational Product Updater helps you find and update your installed product as shown in Figure 7. Please remember to install the J2EE connection tools. For more detailed information, see the Rational Product Updater online help.

    Figure 7. Rational Product Updater for installed products
    Rational Product Updater for installed products



Back to top


2. Create a Service Flow Modeler project

Before creating a new SFM project, ensure all steps in the previous step have been completed:

  1. In WebSphere Developer, open theService Flow Modeler perspective. Select Window -Open Perspective -Other. In the Select Perspective dialog box, check Show all, as shown in Figure 8. Click OK.

    Figure 8: List of all perspectives
    List of all perspectives

    If you can’t find the Service Flow Modeler perspective in the Select Perspective dialog box, check that WebSphere Developer installed successfully.

    When the Service Flow Modeler perspective opens, the SFM Project Explorer displays, as shown in Figure 9:



    Figure 9. SFM Project Explorer
    SFM Project Explorer

  2. To create a new SFM project, selectNew - Project - Service Flow Modeler - Service Flow Project. In the Choose a project name and location dialog box, specify the project name (we used SFMProject), and check the I will specify the service flow later box as Figure 10 shows. Click Finish.

    Figure 10. Create a new SFM Project
    Create a new SFM Project

  3. Download the NKMAP01.bms file from the Downloads section. To keep the screen for later, you need to import the BMS file NKMAP01.bms into the SFM. Right-click on SFMProject.Terminal and select Import - BMS as shown in Figure 11. In the Import wizard, specify the BMS file to import and click Finish.

    Figure 11. Import the BMS file
    Import the BMS file

After the BMS file imports successfully, you see two screens (Nkmap01.Nkmap11.mxsd and Nkmap01.Nkmap12.mxsd) in the SFMProject.Terminal. To increase the recognition performance, we’ll modify recognition criteria for the two screens, which entails deleting the old descriptors and adding new ones. Let’s start with the screen Nkmap01.Nkmap11.mxsd:

  1. Delete the default screen descriptor by selecting Nkmap01.Nkmap11.mxsd and opening the Screen Description tab. Delete the default screen descriptors Fields, InputFields and Fields Checksum as shown in Figure 12:

    Figure 12. Screen descriptions
    Screen descriptions

  2. To add the new screen descriptor, right-click on the screen description Nkmap11 and select Add Descriptor - Add Num Input Fields Descriptor as shown in Figure 13 and Figure 14. Save the modified file.

    Figure 13. Add descriptor
    Add descriptor



    Figure 14. Descriptor input fields
    Descriptor input fields

  3. Now we’ll modify recognition criteria for the second screen Nkmap01.Nkmap12.mxsd in the same way. To delete the default screen descriptor, select Nkmap01.Nkmap12.mxsd and open the Screen Description tab. Delete the default screen descriptors Fields, InputFields and Fields Checksum.
  4. To add a new screen descriptor, right-click on the screen description Nkmap12 and select Add Descriptor - Add Field Pattern Descriptor - Select ACCNMF field as the pattern descriptor as shown in Figure 15 and Figure 16. Save the modified file.

    Figure 15. Add descriptor
    Add descriptor



    Figure 16. Pattern descriptor
    Pattern descriptor



Back to top


3. Record an SFM flow

In this section you create a host connection and then record the SFM flow:

  1. A host connection is required for recording an SFM flow. To create a new host connection, right-click SFMProject.Terminal and select New - Host Connection as shown in Figure 17. In the New Host Connection wizard, enter the file name (we use mvs040) and click Next. Specify your Host name, Port, Type, Code Page and Screen Size, and click Finish.

    Figure 17. Create a new connection
    Create a new connection

  2. When the new host file mvs040.host gets created, it establishes a connection to the host system. Logon to CICS V3.1 and execute NKAP. Verify that it recognizes the first screen Nkmap01.Nkmap11.mxsd as shown in Figure 18. Enter 1000 to test the next screen, Nkmap01.Nkmap12.mxsd. Verify that it recognizes the second screen as well.

    Figure 18. Screen Nkmap01.Nkmap11.mxse is recognized
    Screen Nkmap01.Nkmap11.mxse is recognized

  3. To start recording the SFM flow, click Start Recording Flow in mvs040’s tool bar. In the New Flow Recording dialog box, input a flow name (we used NKFlow) or keep the default value in Record a terminal flow, as Figure 19 shows. Click Next.

    Figure 19.Record a terminal flow
    Record a terminal flow

  4. In Associate operation, ensure that theAssociate interface operation with flow box is checked. Click Create New to create a new Input/Output Message, as in Figure 20:

    Figure 20. Associate operation
    Associate operation

  5. Now input the Interface Operations file and Operation names (we used the default values intf_NKFlow.wsdl and intf_NKFlow). Click Create New for both Input Message and Output Message as Figure 21 shows:

    Figure 21.Create Operations File
    Create Operations File

  6. In the Create Message File dialog, use the default message file name ( o_NKFlow.mxsd) and message name (o_NKFlow) as Figure 22 shows. Click OK to return to the Operations Filedialog. Click OK to return to the Associate operation dialog and click Next.

    Figure 22.Create Message File
    Create Message File

  7. In Select a variable message, click Create New to create an output message file for the message variable. As in the previous step, we use the default message file name ( v_NKFlow.mxsd) and message name (v_NKFlow), as Figure 23 shows. Click OK to return to the Select a variable message dialog. Click Finish.

    Figure 23. Select a variable message
    Select a variable message

  8. Next you need to insert data into the screen. Click Insert Data into Screen in the terminal’s tool bar (see Figure 24) to open the Select Variable dialog box, as Figure 25 shows.

    Figure 24. Insert Data into Screen
    Insert Data into Screen



    Figure 25. Select Variable
    Select Variable

  9. In the Select Variable dialog, click Add new variable and input a variable name (we use input_account), as Figure 26 shows. Click OK to return to the Select Variable dialog. The variable name should be append to the list view as Figure 27 shows. Click OK to close the Select Variable dialog and return to the terminal.

    Figure 26. Add New Variable
    Add New Variable



    Figure 27. Add input_account to Select Variable list
    Add input_account to Select Variable list

  10. Click the ACCUMT field. A blue underline appears in the field as shown in Figure 28. Enter 1000 in the ACCUMT field and click Enter.

    Figure 28. Insert data into screen
    Insert data into screen

  11. Next you extract the data from the screen. Click Extract Data from Screen to open the Select Variable dialog box, as Figure 29 shows:

    Figure 29. Extract Data from Screen
    Extract Data from Screen

  12. In the Select Variable dialog, click Add new variable, and input a variable name (we used output_name) in New Variable as Figure 30 shows. Close the Add New Variable and Select Variable dialogs to return to terminal.

    Figure 30. Add output_name variable in Select Variable dialog
    Add output_name variable in Select Variable dialog

  13. Place the cursor on the LAST NAME field, which displays red brackets, as Figure 31 shows.

    Figure 31. Extract data from screen
    Extract data from screen

  14. Press Enter to submit the change and to return to the first screen of NKAP.
  15. Click Stop Recording Flow to stop recording, and click Save Flow to save the flow.
  16. (Optional) To test and playback the flow, load the flow by clicking Load Flow and select the flow to load. Click Play Screen Interaction and select the screen interaction to test.


Back to top


4. Create and configure generation properties

In this section you’ll create a generation properties file, and set some properties.

To create a new generation properties file:

  1. Right-click the flow NKFlow.seqflow and select New Generation Properties File, as shown in Figure 32.

    Figure 32. Create a new generation properties file
    Create a new generation properties file

  2. In the New Generation Properties dialog box, input the file name (we used the default name new_generation_props.wsdl) in Generation Properties, and select New File and Next.
  3. In Generation Properties – Runtime selection, select CICS Service Flow Runtime and click Finish.
  4. Specify the values for Flow Type, Request Name, Program Name, Transaction ID, Generate Web Service Files, Initial PFKey, Startup Transaction Data, End Point URI, WSBIND File Name, WSDL File Name and WSDL HFS File Path as shown in Figure 33, Figure 34, and Figure 35:

    Figure 33. Specify the generation properties
    Specify the generation properties



    Figure 34. Specify the link3270 bridge flow properties
    Specify the link3270 bridge flow properties



    Figure 35. Specify the Web services generation properties
    Specify the Web services generation properties



Back to top


5. Deploy the Generated Code to CICS

In this section we establish a remote z/OS system connection and generate the runtime code. We then deploy the code to the host and compile the runtime program.

  1. Use the RSE facilities to create a remote z/OS system connection. Ensure that you successfully connected to the host system. For more information, refer to the Remote System Explorer Overview.
  2. To generate the runtime code, right-click on the new_generation_props.wsdl generation properties file and select Generate Runtime Code as shown in Figure 36:

    Figure 36. Generate runtime code
    Generate runtime code

  3. In the Generate run time code dialog box, ensure that the Deploy to remote target location box is checked, input the appropriate values in Job Control information, and select Next as shown in Figure 37:

    Figure 37. Specify the value in Job Control information
    Specify the value in Job Control information

  4. In Deployment Properties – Remote deployment selection, select Deploy to remote location, input the appropriate values in MVS Deployment information and in USS Deployment information as Figure 38 shows. Click Finish.

    Figure 38. Specify the value in MVS Development information and USS Development information
    Specify the value in MVS Development information and USS Development information

After deploying the generated code to the host system, you should be able to find:

  • CVNKMAPD.CBL ,NKFLPROG.CBL in data set USER50.SFM.COBOL.
  • INKMAP01.CPY ,ONKMAP01.CPY ,VNKMAP01.CPY ,NKMAP11.CPY ,NKMAP12.CPY in data set USER50.SFM.COPY.
  • @NKFLREQ.JCL ,CVNKMAPD.JCL ,RDOJOB.JCL and NKFLPROG.JCL in data set USER50.SFM.JCL.
  • nkflow.wsbind and nkflow.wsdl in the directory /u/dbcs .

Now it’s almost time to compile the runtime program, but first review your runtime program. You might have to modify arguments in the JCLs to match with your host system. (Contact your host administrator)

To compile the runtime program:

  1. Submit the JCL files sequentially: CVNKMAPD.JCL, NKFLPROG.JCL, @NKFLREQ.JCL and RDOJOB.JCL.
  2. Go to CICS region, install the group (the group in RDOJOB.JCL) and load the programs.
  3. Scan the service provider pipeline. For more information, see the CICS Web Services Guide Version 3 Release 1(SC34-6458-02).


Back to top


6. Test the CICS Application via the Web Service Explorer

You’re now ready to test your CICS Web service

  1. Right-click the nkflow.wsdl file and select Web Service - Test with Web Services Explorer, as shown in Figure 39.

    Tip: If you couldn’t find Web service in the popup menu, enable the Web Service Developer in the Workbench Preferences by selecting Window - Preferences… - Workbench - Capabilities. Ensure that Web Service Developer is checked.



    Figure 39. Test the Web service with Web Services Explorer
    Test the Web service with the Web Services Explorer

  2. In the Web Services Explorer, input appropriate values to SERVICEINPUTAREA. For detailed information, see CICS Service Flow Runtime User Guide (SC34-5899-06).
  3. Specify the input_account as 1000, and click GO. You should see the result shown in Figure 40.

    Figure 40. Result
    Result



Back to top


Conclusion

You now should be able to use SFM to quickly and easilty convert your CICS screen-based applications to Web services to integrate your modern commercial environment. SFM also supports advanced features like while loop, switch node, error and exception handling and more for screen-based applications.




Back to top


Downloads

DescriptionNameSizeDownload method
The BMS file for the target applicationnkmap01.zip2 KBFTP|HTTP
The source code for NKAPnkpgm01.zip2 KBFTP|HTTP
The sample SFM projectsfmproject.zip46 KBFTP|HTTP
Information about download methods


Resources

Learn

Get products and technologies

Discuss


About the authors

Freddy Lu is a Staff Software Engineer with the IBM China Software Development Lab (CSDL). Currently he is working on HACP as the DBCS development lead. Freddy is familiar with C++, Java and J2EE technologies. You can reach Freddy at lupl@tw.ibm.com.


Rick Hwang is a Software Engineer on the SFM project team at the IBM China Software Development Lab (CSDL). His expertise includes Java related technology, Web services, and IBM Host integration. You can reach Rick at rickhw@tw.ibm.com.


Natalius is a Software Engineer with the IBM China Software Development Lab (CSDL). He works on the SFM project team. He is implementing DBCS for the enterprise solution. His expertise includes J2EE technology, Web services, Eclipse plug-ins, and WebSphere Host Transformation. You can reach Natalius at klhuang@tw.ibm.com.


Dave Lin is a Staff Software Engineer with the IBM China Software Development Lab (CSDL). Currently he is working on SFM as the DBCS project lead. Dave is familiar with Java and J2EE technologies, Web applications, Eclipse plug-ins, Web services and WebSphere Host Transformation. You can reach Dave at davelin@tw.ibm.com.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top