IBM Innovate 2013: Making Rational HATS a Strategic Investment


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Integration Objects are JavaBeans that encapsulate interactions with a host application. If your HATS application will transform a single host application, with no secondary connections, you do not need to use Integration Objects. You may need to use Integration Objects if any of these statements are true:Your application connects to more than one host application. You want to encapsulate your host interactions into Enterprise JavaBeans (EJBs) or Web services. These processes are described in the HATS Programmer's Guide. You want to build Web pages based on the inputs and outputs of a macro.
  • Service Endpoint Interface Selection page:- You can select to use an existing service endpoint interface (SEI) rather than letting the wizard generate one.- Set the service deploy scope. This indicates how to deploy the server implementation. Application uses one instance of the implementation class for all requests. Request creates a new instance of the implementation class for each request. Session creates a new instance of the implementation class for each session.- Set the SOAP action. This option is used to set the soapAction field in the generated WSDL. Default sets the soapAction field according to the deployment information. None sets the soapAction field to double quotes (""). Operation sets the soapAction field to the operation name.- You can also choose to exclusively map MIME types using WSDL 1.1 standards. If the MIME type cannot map to WSDL 1.1 standards (for example, if the attachment is an array or a Java bean property), the command fails.
  • Web Service Java Bean Identity page:- Change the WSDL port name or WSDL file name.- Select the methods to expose.- Set the void return - this field is for a Web service method with return type of void that describes whether a response is expected from the Web service. Oneway: this argument is the default for a JMS transport. Twoway: this argument is the default for an HTTP transport.- Select the encoding style. This specifies which style and use combinations are generated into the WSDL file. The combinations are RPC/encoded, RPC/literal, or document/literal. Only document/literal is WS-I compliant.- Select your security options. Security is not WS-I compliant.- Select if you want to customize the package to namespace mappings.- Specify extra and stop classes. Extra specifies other classes that are represented in the WSDL file. You can use the -stopClasses argument to define additional classes that cause the search to stop.
  • This slide will describe the lifecycle of the HTTP request moving through the layers of the JEE architecture, passing over to the HATS runtime, then the event handling within the HATS runtime. It will be used to illustrate the different points where one could intercept the request and write Java code to manipulate it.
  • IBM Innovate 2013: Making Rational HATS a Strategic Investment

    1. 1. Making HATS a Strategic Investment:Integration with Relational Systems andWeb ServicesMatthew HardinSr. Consultant, Strongback Consultingmatthew.hardin@strongback.usKenny SmithPrincipal Consultant, Strongback Consultingkenny.smith@strongback.usPWR-1212© 2013 IBM Corporation
    2. 2. 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, Healthcare, Manufacturing, Government– Rational Design Partner for HATS and other Rational enterprise modernization technologiesDiscover us at:http://www.strongback.usSubscribe to us athttp://blog.strongbackconsulting.comSocialize with us on Facebook & LinkedIn
    3. 3. 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 devicessuch as smartphones, tablets, and handheld computers. Provides standard JSR 286 and JSR 168 portlet support, including built-in inter-portletcommunication.3
    4. 4. About HATS With Rational HATS you can easily convert traditional text-based host application screens touser-friendly GUIs.4
    5. 5. HATS Toolkit Rational IDE environment Wizard driven service accelerators Visual page designers Visual macro editors5
    6. 6. 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 navigationimprovements 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 afternoon6
    7. 7. 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 systems7
    8. 8. Extending with Web Services The W3C defines web services as:“a software system designed to support interoperable machine-to-machine interaction overa network. It has an interface described in a machine-processable format(specifically WSDL). Other systems interact with the Web service in a manner prescribed byits description using SOAP messages, typically conveyed using HTTP withan 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 XMLrepresentations 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 operatingsystems, with different technologies and programming languages. SOAP…. REST…. XML… JSON… HATS does it all.8
    9. 9. SOAP Web Services SOAP: Simple Object Access Protocol XML-based protocol to let applications exchange information over HTTP or JMS (or reallyANY 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.9
    10. 10. 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.10
    11. 11. 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
    12. 12. Key Function in Macros• Skip-screen• Skip-screen macros are navigational macros that move the user from onescreen to another screen without displaying intervening screens.• Prompt• Prompt macros contain events to request input from users during the hostsession.• They can also set prompts from a user list.• For example, you can use a prompt macro to ask a user for their user IDand password before logging them into a host application.• Extract• Extract macros contain events to extract host screen information as astring, data as a table or even a global variable.• You can use an extract macro to connect to a directory-type hostapplication and extract the results of doing a search in the directory.
    13. 13. 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)13
    14. 14. Host Terminal14
    15. 15. Host Terminal Used for Host Navigation to create:– Screen Customizations– Screen Captures– Transformations– Macros Allows Macro Recording and Editing Allows Macro Playback and TestingOpen Play Record Stop SaveResumePromptExtractRecordLoopPromptAllFieldsExtractAllFieldsStepIntoStepOverStepReturnStepOver
    16. 16. Visual Macro Editor16• Allows you tovisually see yourmacro flow• Easiest way toupdate existingmacros• Drag / dropfunctionality
    17. 17. Visual Macro Editor17 Wizard driven for easy editing of:– Screen Recognition Criteria– Extracts– Prompts
    18. 18. VME – Adding Actions
    19. 19. 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
    20. 20. Integration Objects Reusable, JEE, Java Beans that encapsulate interaction with a host system. Can be created from Macros20IntegrationObject JavaBeans
    21. 21. Integration Objects Created automagically! Select the macro, right click and select CreateIntegration Object Once created, the Integration Object will appearin the HATS Project View in the Source ->IntegrationObject folder21
    22. 22. From Integration Objects to Web Service Support Files Utilize wizard from context menuRight click on the Integration Objectand select Create Web ServiceSupport Files22
    23. 23. Create Web Service Support FilesThis is a web service, which maycontain a collection of operations.Choose the name of your serviceto reflect this.23
    24. 24. MoreSelect the Integration Objects you wish toinclude in this service.Each Integration Object will reflect oneoperation of your service.Click the properties button to alter the inputand outputs selected for each operation.24
    25. 25. Selecting PropertiesThe selected properties will determinethe inputs and outputs of your service.See the hPub properties? These areused internally by HATS and can besafely excluded.25
    26. 26. Web Service Support Files26The artifacts created will reside in the Source -> webserviceclasses folder.
    27. 27. Create a SOAP Web Service27From the project explorer, right click on theweb service support file you created. SelectWeb Services -> Create Web Service fromthe context menu.This will launch the Web Service wizard. Thiswizard allows you to generate a WSDL fileand also lets you deploy the service to anapplication server.Optionally, it also allows you to create asample client for the service.
    28. 28. MoreConstruct your web service as a Bottomup Java Bean Web Service. A bottom upservice is built using your existing Javabean and this wizard will generate theWSDL and other Java classes tofacilitate the service.Other options available:- Generate a client- Select a server runtime- Change the EAR for deployment28
    29. 29. Service Endpoint InterfaceThe service endpoint is theclient’s view of the service,hiding the session bean fromthe client.Here you can modify theinterface to use, thedeployment scope, thesoapAction field for thegenerated WSDL and whetherto map to WSDL 1.1 MIMEtypes.29
    30. 30. Web Service Java Bean IdentityHere you can modify theWSDL file name and selectwhich methods to expose viayour service.In our example, thegetNestedBeanNamesmethod is not a method wewant to expose.Once complete, click Finish tocreate your WSDL andservice interfaces.30
    31. 31. WSDL Example31
    32. 32. RESTfulLike the SOAP services before, you canbegin creating REST based services froman Integration Object.Right clicking on the Integration Object inthe projects view allows us to select CreateRESTful Service Files from the contextmenu. This will launch the wizard to createour interfaces.32
    33. 33. Producing REST Web Services with HATSSpecify the class and packagenames.33
    34. 34. Producing REST Web Services with HATSChoose the Integration Object and the HTTPmethod type.Then select the input and output parameters.34
    35. 35. Configuring the JAX-RS Resource MethodHere we can define a great many propertiesof our service interface:- Method Name- URI suffix- Mime type that is produced- Add, edit or remove parametersBelow you see the JAX-RS annotationsignature for the method the wizard willproduce.35
    36. 36. Producing REST Web Services with HATSHere we could add additionalmethods.Click Finish to complete the wizardand generate the JAX-RS resource.36
    37. 37. REST Example37
    38. 38. 38
    39. 39. The HATS Lifecycle39BusinessLogicMacrosHATS RuntimeServletFilterServletListenerServletContextServletRequestJEEWeb serverHTTP
    40. 40. 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– Error40
    41. 41. HATS Business Logic41
    42. 42. Introducing The IBM Toolbox for JavaA set of Java classes that allow you to use Java programs to access data on your IBM Iservers 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 files42
    43. 43. Obtaining the Toolbox43 The IBM Toolbox for Java Jar files are installed in the integrated file system of IBM i, underdirectory /QIBM/ProdData/OS400/jt400/ IBM Toolbox for Java is also available in an open source version. You can download thecode and get more information from the JT Open Web site.
    44. 44. Example of Using the Toolbox44
    45. 45. Where and How could I use the toolbox in HATS?46TerminalConnection
    46. 46. 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 functionalityand 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 v5r347
    47. 47. Consuming PCML with HATS PCML: Program Call Markup Language48
    48. 48. Consuming PCML with HATS49
    49. 49. PCML calling code example50
    50. 50. 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 fields51
    51. 51. SQL Integration with IBM i The IBM Toolbox for Java JDBC driver allows you to use JDBC API interfaces to issuestructured query language (SQL) statements to and process results from databases on theIBM i.– JDBC is an API that enables Java programs to connect to a wide range of databases.52HatsApplicationJDBCDriverIBM i
    52. 52. SQL: Structured Query Language A programming language designed for managing data held in relational databasemanagement systems.53SELECT Book.title AS Title, COUNT(*)AS Authors FROM Book JOIN Book_authorON Book.isbn = Book_author.isbn GROUPBY Book.title;Title Authors---------------------- -------SQL Examples and Guide 4The Joy of SQL 1An Introduction to SQL 2Pitfalls of SQL 1
    53. 53. Utilize SQL within Business LogicProblem: Your host applications often have short, cryptic record identifiers and often thedescription is not included with them on the current screen.Solution: Use HATS Business Logic and JDBC to query the database for the full descriptionthat you store in a global variable. Then utilize that variable within the Screen Customization.54
    54. 54. 55JPA tooling• JPA Faceted projects wizard• JPA Entity wizard• Persistence XML Editor
    55. 55. Calling RDBMS From Macros Use the Advanced Editor Insert raw SQL Save result set to macrovariable Macro variable only exists forthe lifecycle of the macro Use result set to enter data on tolater subsequent screens56
    56. 56. 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)57
    57. 57. Have we mentioned that HATS is a JEE Application?58
    58. 58. Resources Check out all our links for our presentations, including this one––“one link to rule them all”59
    59. 59. 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, Healthcare, Manufacturing, Government– Rational Design Partner for HATS and other Rational enterprise modernization technologiesDiscover us at:http://www.strongback.usSubscribe to us athttp://blog.strongbackconsulting.comSocialize with us on Facebook & LinkedIn
    60. 60. 61© Copyright IBM Corporation 2013. All rights reserved. The informationcontained in these materials is provided for informational purposes only, and isprovided AS IS without warranty of any kind, express or implied. IBM shall not beresponsible for any damages arising out of the use of, or otherwise related to,these materials. Nothing contained in these materials is intended to, nor shallhave the effect of, creating any warranties or representations from IBM or itssuppliers or licensors, or altering the terms and conditions of the applicable licenseagreement governing the use of IBM software. References in these materials toIBM products, programs, or services do not imply that they will be available in allcountries in which IBM operates. Product release dates and/or capabilitiesreferenced in these materials may change at any time at IBM’s sole discretionbased on market opportunities or other factors, and are not intended to be acommitment to future product or feature availability in any way. IBM, the IBM logo,Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM productsand services are trademarks of the International Business Machines Corporation,in the United States, other countries or both. Other company, product, or servicenames may be trademarks or service marks of others.