making rational hats a strategic investment

58
© 2014 IBM Corporation Making HATS a Strategic Investment Integration with Relational Systems and Web Services Matthew Hardin Principal Consultant, Strongback Consulting [email protected] Kenny Smith Principal Consultant, Strongback Consulting [email protected]

Upload: strongback-consulting

Post on 13-Dec-2014

187 views

Category:

Technology


4 download

DESCRIPTION

IBM Rational Host Access Transformation Services (HATS) is a tool for modernizing IBM i 5250 and mainframe 3270 telnet applications. This presentation, given at IBM Innovate 2014, demonstrates how HATS can turn those green screen applications into JAX-WS or RESTful JSON web services, how to consume Program Call Markup Language (PCML) enabled IBM i Programs, and how to to integrate with databases using SQL, JDBC, and the Java Persistence API (JPA) 2.0 features of Rational Application Developer. Finally we describe using servlet filters to further enhance the abilities of the Rational HATS entry servlet.

TRANSCRIPT

Page 1: Making Rational HATS a Strategic Investment

© 2014 IBM Corporation

Making HATS a Strategic Investment Integration with Relational Systems and Web Services

Matthew Hardin

Principal Consultant, Strongback Consulting

[email protected]

Kenny Smith

Principal Consultant, Strongback Consulting

[email protected]

Page 2: Making Rational HATS a Strategic Investment

About Us: Strongback Consulting

• IBM Advanced Business Partner – Rational, WebSphere, Lotus, Information Management SVP certified

– Strongly focused on Enterprise Modernization and application lifecycle management

– Key Industries Served: Finance, Insurance, Travel, Logistics, Healthcare,

Manufacturing, Government

– Rational Design Partner for HATS and other Rational enterprise modernization

technologies

Discover us at:

http://www.strongback.us

Subscribe to us at

http://blog.strongbackconsulting.com

Socialize with us on Facebook & LinkedIn

http://www.facebook.com/StrongbackConsulting

http://www.linkedin.com/company/290754

Page 3: Making Rational HATS a Strategic Investment

About HATS

• IBM® Rational® Host Access Transformation Services (HATS)

transforms traditional text-based interfaces into web, portlet, rich

client or mobile device interfaces.

• Supports 3270, 5250 and virtual terminal (VT) applications

• Allows for extending these applications as standard web services.

• Rules based engine to transform your existing, proven applications

to a modern UI.

• Extend 3270, 5250, and VT green screens as standard Web

services.

• Broadens the reach of IBM i applications with support for mobile

web access from devices such as smartphones, tablets, and

handheld computers.

• Provides standard JSR 286 and JSR 168 portlet support, including

built-in inter-portlet communication.

2

Page 4: Making Rational HATS a Strategic Investment

About HATS

• With Rational HATS you can easily convert traditional text-based

host application screens to user-friendly GUIs.

3

Page 5: Making Rational HATS a Strategic Investment

HATS Toolkit • Rational IDE environment

• Wizard driven service accelerators

• Visual page designers

• Visual macro editors

4

Page 6: Making Rational HATS a Strategic Investment

HATS: The Tactical Advantage

• Rational HATS allows you to reuse and repurpose your existing

assets.

– Out of the box

– Additional ROI on your existing applications

– Low cost and low risk: No need to rewrite or refactor existing

applications

• Cuts training costs.

– Increase productivity and reduce training costs and data entry errors

with workflow and navigation improvements

• Extend your reach.

– Extend host application to new users who do not directly have

access to the host system.

• Very Fast Time To Market

– A large financial company went from start to production in 39 days

– Smaller companies could have an application ready in an afternoon

5

Page 7: Making Rational HATS a Strategic Investment

HATS: The Strategic Advantage

• Extend your existing applications and assets

• Find new streams of revenue for your legacy applications

– Applicable to ISV’s, service providers

• Use to abstract your systems into web services short term to

protect long term architectures

– Easy to create web services

– Web services “hide” the underlying technology

• Integrate with external resources

– Any resource!

• Portalization

– Integrate at the glass with other enterprise systems

6

Page 8: Making Rational HATS a Strategic Investment

Extending with Web Services • The W3C defines web services as:

“a software system designed to support interoperable machine-to-

machine interaction over a network. It has an interface described in a

machine-processable format (specifically WSDL). Other systems interact

with the Web service in a manner prescribed by its description

using SOAP messages, typically conveyed using HTTP with

an XML serialization in conjunction with other Web-related standards.”

• The W3C also states:

– REST-compliant Web services, in which the primary purpose of the

service is to manipulate XML representations of Web

resources using a uniform set of "stateless" operations; and

– arbitrary Web services, in which the service may expose an arbitrary

set of operations.

• Provides a way to communicate between applications running on different

operating systems, with different technologies and programming

languages.

• SOAP…. REST…. XML… JSON… HATS does it all. 7

Page 9: Making Rational HATS a Strategic Investment

SOAP Web Services

• SOAP: Simple Object Access Protocol

• XML-based protocol to let applications exchange information over

HTTP or JMS (or really ANY transport).

• Often described by a WSDL: Web Services Description Language

– WSDL is an XML-based language for describing Web services and

how to access them.

– Makes services easier for clients to consume.

• SOAP is highly extensible, but you only use the pieces you need

for a particular task.

8

Page 10: Making Rational HATS a Strategic Investment

RESTful

• Use HTTP methods explicitly.

• Are stateless.

– Clients send complete, independent requests.

• Expose directory structure-like URIs.

• Transfer XML, JavaScript Object Notation (JSON), or both.

9

Page 11: Making Rational HATS a Strategic Investment

Creating a web service using HATS

• Create a standard HATS

project

• Create macros

• Create Integration Objects

• Create Web Services (REST

or SOAP)

• Deploy to WebSphere

Page 12: Making Rational HATS a Strategic Investment

Key Function in Macros

• Skip-screen

• Skip-screen macros are navigational macros that move the user from one

screen to another screen without displaying intervening screens.

• Prompt

• Prompt macros contain events to request input from users during the host

session.

• They can also set prompts from a user list.

• For example, you can use a prompt macro to ask a user for their user ID

and password before logging them into a host application.

• Extract

• Extract macros contain events to extract host screen information as a

string, data as a table or even a global variable.

• You can use an extract macro to connect to a directory-type host

application and extract the results of doing a search in the directory.

Page 13: Making Rational HATS a Strategic Investment

Create a Macro

• Utilize the Host Terminal Emulator to record your macro.

• Utilize the Visual Macro Editor (VME) to edit your macro.

– Add prompts (the inputs of your web service)

– Add extracts (the outputs of your web service)

12

Page 14: Making Rational HATS a Strategic Investment

Host Terminal

13

Page 15: Making Rational HATS a Strategic Investment

Host Terminal

• Used for Host Navigation to create:

– Screen Customizations

– Screen Captures

– Transformations

– Macros

• Allows Macro Recording and Editing

• Allows Macro Playback and Testing

Open Play Record Stop Save

Resume

Prompt

Extract

Record

Loop

Prompt

All

Fields Extract

All

Fields

Step

Into Step

Over

Step

Return

Step

Over

Page 16: Making Rational HATS a Strategic Investment

Visual Macro Editor

15

• Allows you to visually see your macro flow

• Easiest way to update existing macros

• Drag / drop functionality

Page 17: Making Rational HATS a Strategic Investment

Visual Macro Editor

16

• Wizard driven for easy

editing of:

– Screen Recognition

Criteria

– Extracts

– Prompts

Page 18: Making Rational HATS a Strategic Investment

VME – Adding Actions

Page 19: Making Rational HATS a Strategic Investment

Macro Editing

• Tabbed Editor – description, timing, name

• Advanced Editor

• Create/edit macro variables

• SQL calls

• Macro Navigator (in Host Terminal)

• Recording macros

• Appending to macros (less preferred method)

• Debugging / testing macros

• Visual Macro Editor – Most of your editing

• Editing Actions

• Rename screens

• Re-ordering screen flow

• Drag/drop screens onto the editors

Page 20: Making Rational HATS a Strategic Investment

Integration Objects

• Reusable, JEE, Java Beans that encapsulate interaction with a

host system.

• Can be created from Macros

19

Integration

Object Java

Beans

Page 21: Making Rational HATS a Strategic Investment

Integration Objects

• Created automagically!

• Select the macro, right click and

select Create Integration Object

• Once created, the Integration

Object will appear in the HATS

Project View in the Source ->

IntegrationObject folder

20

Page 22: Making Rational HATS a Strategic Investment

From Integration Objects to Web Service Support Files

• Utilize wizard from context

menu

Right click on the

Integration Object and

select Create Web Service

Support Files

21

Page 23: Making Rational HATS a Strategic Investment

Create Web Service Support Files

This is a web service,

which may contain a

collection of operations.

Choose the name of

your service to reflect

this.

22

Page 24: Making Rational HATS a Strategic Investment

More

Select the Integration Objects

you wish to include in this

service.

Each Integration Object will

reflect one operation of your

service.

Click the properties button to

alter the input and outputs

selected for each operation.

23

Page 25: Making Rational HATS a Strategic Investment

Selecting Properties

The selected properties will

determine the inputs and

outputs of your service.

See the hPub properties?

These are used internally by

HATS and can be safely

excluded.

24

Page 26: Making Rational HATS a Strategic Investment

Web Service Support Files

25

The artifacts created will reside in the Source -> webserviceclasses folder.

Page 27: Making Rational HATS a Strategic Investment

Create a SOAP Web Service

26

From the project explorer, right

click on the web service support

file you created. Select Web

Services -> Create Web Service

from the context menu.

This will launch the Web Service

wizard. This wizard allows you to

generate a WSDL file and also

lets you deploy the service to an

application server.

Optionally, it also allows you to

create a sample client for the

service.

Page 28: Making Rational HATS a Strategic Investment

More

Construct your web service

as a Bottom up Java Bean

Web Service. A bottom up

service is built using your

existing Java bean and this

wizard will generate the

WSDL and other Java

classes to facilitate the

service.

Other options available:

- Generate a client

- Select a server runtime

- Change the EAR for

deployment 27

Page 29: Making Rational HATS a Strategic Investment

Service Endpoint Interface

The service endpoint

is the client’s view of

the service, hiding the

session bean from

the client.

Here you can modify

the interface to use,

the deployment

scope, the

soapAction field for

the generated WSDL

and whether to map

to WSDL 1.1 MIME

types.

28

Page 30: Making Rational HATS a Strategic Investment

Web Service Java Bean Identity

Here you can modify

the WSDL file name

and select which

methods to expose

via your service.

In our example, the

getNestedBeanName

s method is not a

method we want to

expose.

Once complete, click

Finish to create your

WSDL and service

interfaces.

29

Page 31: Making Rational HATS a Strategic Investment

WSDL Example

30

Page 32: Making Rational HATS a Strategic Investment

RESTful

Like the SOAP services before,

you can begin creating REST

based services from an

Integration Object.

Right clicking on the Integration

Object in the projects view

allows us to select Create

RESTful Service Files from the

context menu. This will launch

the wizard to create our

interfaces.

31

Page 33: Making Rational HATS a Strategic Investment

Producing REST Web Services with HATS

Specify the class and

package names.

32

Page 34: Making Rational HATS a Strategic Investment

Producing REST Web Services with HATS

Choose the Integration Object and

the HTTP method type.

Then select the input and output

parameters.

33

Page 35: Making Rational HATS a Strategic Investment

Configuring the JAX-RS Resource Method

Here we can define a great

many properties of our service

interface:

- Method Name

- URI suffix

- Mime type that is produced

- Add, edit or remove

parameters

Below you see the JAX-RS

annotation signature for the

method the wizard will produce. 34

Page 36: Making Rational HATS a Strategic Investment

Producing REST Web Services with HATS

Here we could add

additional methods.

Click Finish to complete

the wizard and generate

the JAX-RS resource.

35

Page 37: Making Rational HATS a Strategic Investment

REST Example

36

Page 38: Making Rational HATS a Strategic Investment

The HATS Lifecycle

37

Business Logic

Macros

HATS Runtime

Servlet

Filter

Servlet

Listener

Servlet Context

Servlet Request

JEE

Web server

HTTP

Page 39: Making Rational HATS a Strategic Investment

HATS Business Logic

• Business Logic:

– Java code that can be invoked when ANY HATS event occurs.

– Include and manipulate HATS global variables

• HATS Events:

– Application startup

– Screen recognition

– Error

38

Page 40: Making Rational HATS a Strategic Investment

HATS Business Logic

39

Page 41: Making Rational HATS a Strategic Investment

Introducing The IBM Toolbox for Java

A set of Java classes that allow you to use Java programs to access

data on your IBM I servers via their host servers as access points.

With these you can utilize:

• Database -- JDBC (SQL) and record-level access (DDM)

• Integrated File System

• Program calls (RPG, COBOL, service programs, etc)

• Commands

• Data queues

• Data areas

• Print/spool resources

• Jobs and job logs

• Messages, message queues, message files

40

Page 42: Making Rational HATS a Strategic Investment

Obtaining the Toolbox

41

• The IBM Toolbox for Java Jar files are installed in the integrated

file system of IBM i, under

directory /QIBM/ProdData/OS400/jt400/

• IBM Toolbox for Java is also available in an open source version.

You can download the code and get more information from the JT

Open Web site.

Page 43: Making Rational HATS a Strategic Investment

Example of Using the Toolbox

42

Page 44: Making Rational HATS a Strategic Investment

Where and How could I use the toolbox in HATS?

44

Terminal

Connection

Page 45: Making Rational HATS a Strategic Investment

Program Call Markup Language

• A tag language that allows one to call IBM I server programs.

• XML based syntax that fully describes the input and output

parameters for the program.

• Extensible Program Call Markup Language (XPCML). XPCML

enhances the functionality and usability of PCML by offering

support for XML schemas.

• Allows you to write less code; your calls to the server, utilizing the

IBM Toolbox for Java, handles the interaction and provides the

interface.

• Also available to be consumed from within the server environment

by other host programs.

• Available since IBM I v5r3

45

Page 46: Making Rational HATS a Strategic Investment

Consuming PCML with HATS

• PCML: Program Call Markup Language

46

Page 47: Making Rational HATS a Strategic Investment

Consuming PCML with HATS

47

Page 48: Making Rational HATS a Strategic Investment

PCML calling code example

48

Page 49: Making Rational HATS a Strategic Investment

Consuming PCML with HATS

• Utilize within Business Logic to call out to other host programs.

– Retrieve other records

– Lookup data that could be inserted into your host application

• Use within Screen Customizations

– Retrieve result sets for a search

– Get a list of values a user could select to auto populate other fields

49

Page 50: Making Rational HATS a Strategic Investment

SQL Integration with IBM i

• The IBM Toolbox for Java JDBC driver allows you to use JDBC

API interfaces to issue structured query language (SQL)

statements to and process results from databases on the IBM i.

– JDBC is an API that enables Java programs to connect to a wide

range of databases.

50

Hats Application

JDBC

Driver IBM i

Page 51: Making Rational HATS a Strategic Investment

SQL: Structured Query Language

• A programming language designed for managing data held in

relational database management systems.

51

SELECT Book.title AS Title, COUNT(*)

AS Authors FROM Book JOIN Book_author

ON Book.isbn = Book_author.isbn GROUP

BY Book.title;

Title Authors

---------------------- -------

SQL Examples and Guide 4

The Joy of SQL 1

An Introduction to SQL 2

Pitfalls of SQL 1

Page 52: Making Rational HATS a Strategic Investment

Utilize SQL within Business Logic

Problem: Your host applications often have short, cryptic record

identifiers and often the description is not included with them on the

current screen.

Solution: Use HATS Business Logic and JDBC to query the

database for the full description that you store in a global variable.

Then utilize that variable within the Screen Customization.

52

Page 53: Making Rational HATS a Strategic Investment

53

JPA tooling

• JPA Faceted projects

wizard

• JPA Entity wizard

• Persistence XML Editor

Page 54: Making Rational HATS a Strategic Investment

Calling RDBMS From Macros

• Use the Advanced

Editor

• Insert raw SQL

• Save result set to

macro variable

• Macro variable only

exists for the lifecycle

of the macro

• Use result set to enter

data on to later

subsequent screens

54

Page 55: Making Rational HATS a Strategic Investment

Using servlet filters

• For security

• For further integration

• Intercept inbound request or outbound response

• Authentication to an external LDAP registry

• Single Sign On

– Could be used in conjunction with Enterprise Identity Manager (EIM)

55

Page 56: Making Rational HATS a Strategic Investment

Have we mentioned that HATS is a JEE Application?

56

Page 57: Making Rational HATS a Strategic Investment

Resources

• Check out all our links for our presentations, including this one

– https://delicious.com/strongback/tag_bundle/Innovate2013

– “one link to rule them all”

57

Page 58: Making Rational HATS a Strategic Investment

About Us: Strongback Consulting

• IBM Advanced Business Partner – SVP certified

– Strongly focused on DevOps, enterprise modernization and application lifecycle

management

– Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government

– Rational Design Partner

Discover us at:

http://www.strongback.us

Subscribe to us at

http://blog.strongbackconsulting.com

Socialize with us on Facebook & LinkedIn

http://www.facebook.com/StrongbackConsulting

http://www.linkedin.com/company/290754