Terminal Emulation & Transformation Community
  • Home
  • Blogs
  • FORUM
  • About
  • Contact
  • Resources

Host Access Class Library (HACL) API in IBM PCOMM. Part 1: Automation Objects

5/30/2018

2 Comments

 
Picture
In continuation with my previous blogs about Automation using PCSAPI and Automation using EHLLAPI API’s, this blog provides a brief about the strongest set of PCOMM API’s, the HACL (Host Access Class Library) API.

​Host Access Class Library (HACL) is a set of objects that allows application programmers to access host applications easily and quickly. IBM Personal Communications supports different HACL Layers:

Picture
Figure 1 HACL Layers
Automation Objects (Visual Basic, Word, Excel, etc):
The Host Access Class Library Automation Objects allow Personal Communications to support Microsoft COM-based automation technology (formerly known as OLE automation). The HACL Automation Objects are a series of automation servers that allow automation controllers, for example, Microsoft Visual Basic, to programmatically access Personal Communications’ data and features.
Note: Automation Objects provided by IBM Personal Communications are 32-bit in nature. These can be used only with 32-bit Microsoft Office programs.
At present, the following types of automation objects are supported.
•       C++ objects:
         This C++ class library presents a complete object-oriented abstraction of a host                             connection  that includes:
          •       reading and writing the host presentation space (screen),
          •       enumerating the fields on the screen,
          •       reading the Operator Indicator Area (OIA) for status information,
          •       accessing and updating information about the visual emulator window,
          •       transferring files, and
          •       performing asynchronous notification of significant events.
•       Java Objects:
         Java objects provides Java wrappers for all HACL functions. Details on HACL Java classes           will be covered in another blog in the near future.
•       LotusScript Extension:
        The Host Access Class Library LotusScript Extension (LSX) is a language extension module          for LotusScript (the scripting and macro language of Lotus Notes and all the Lotus                        SmartSuite® products). This LSX gives users of Lotus products access to the HACL                      functions through easy-to-use scripting functions.
 
ECL Concept - Connections, Handles and Names
In the context of the ECL, a Connection is a single, and is unique to a Personal Communications emulator window.

Connections are distinguished by their connection handle or connection name. Most HACL objects are associated with a specific connection. Typically, the object takes a connection handle or connection name as a parameter on the constructor of the object. For example, to create an ECLPS (Presentation Space) object associated with connection 'B', the following code would be used:
  • C++
          ECLPS *PSObject;
          PSObject = new ECLPS(’B’);
 
  • Visual Basic
          Dim PSObject as Object
          Set PSObject = CreateObject("PCOMM.autECLPS")
          PSObject.SetConnectionByHandle("B")
 
The HACL Automation Objects
Below is a graphical representation of most commonly used autECL Objects.

Picture
Figure 2 autECL Object representation
Several automation servers are implemented as real-world, intuitive objects with methods and properties that control Personal Communications operability. Each object begins with autECL, for automation Host Access Class Library. These objects and a brief description of each are as follows:
  • autECLConnList, Connection List contains a list of Personal Communications connections for a given system. This is contained by autECLConnMgr, but may be created independently of autECLConnMgr.
  • autECLConnMgr, Connection Manager provides methods and properties to manage Personal Communications connections for a given system. A connection in this context is a Personal Communications window.
  • autECLFieldList, Field List performs operations on fields in an emulator presentation space.
  • autECLOIA, Operator Information Area provides methods and properties to query and manipulate the Operator Information Area. This is contained by autECLSession, but may be created independently of autECLSession.
  • autECLPS, Presentation Space provides methods and properties to query and manipulate the presentation space for the related Personal Communications connection. This contains a list of all the fields in the presentation space. It is contained by autECLSession, but may be created independently of autECLSession.
  • autECLScreenDesc, Screen Description provides methods and properties to describe a screen. This may be used to wait for screens on the autECLPS object or the autECLScreenReco object.
  • autECLScreenReco, Screen Recognition provides the engine of the HACL screen recognition system.
  • autECLScreenReco, Screen Recognition provides the engine of the HACL screen recognition system.
  • autECLSession, Session provides general session-related functionality and information. For convenience, it contains the autECLPS, autECLOIA, autECLXfer, autECLWinMetrics, autECLPageSettings, and autECLPrinterSettings objects.
  • autECLWinMetrics, Window Metrics provides methods to query the window metrics of the Personal Communications session associated with this object. For example, use this object to minimize or maximize a Personal Communications window. This is contained by autECLSession, but may be created independently of autECLSession.
  • autECLXfer, File Transfer provides methods and properties to transfer files between the host and the workstation over the Personal Communications connection associated with this file transfer object. This is contained by autECLSession, but may be created independently of autECLsession.
  • autECLPageSettings, Page Settings provides methods and properties to query and manipulate commonly used settings such as CPI, LPI, and Face Name of the session Page Setup dialog. This is contained by autECLSession, but may be created independently of autECLSession.
  • autECLPrinterSettings, Printer Settings provides methods and properties to query and manipulate settings such as the Printer and PDT modes of the session Printer Setup dialog. This is contained by autECLSession, but may be created independently of autECLSession.
 
Essentially every class provides properties, methods and (optionally) Events with it. These can be used in conjunction or separately to interact with and control operations in PCOMM window.

More information about the mentioned Classes and sample code can be found in PCOMM online documentation.

​Sample code below demonstrates usage of most common ECL objects and methods.

1.       Object Declaration

    
2.       Initialize session object by Handle or by Name

    
3.       Sendkey (String, Row, Col)
          ' sends the text on mentioned row and col location
            autECLPSObj.SendKeys "PCOMM API’s are very Powerful", 3, 1
 
4.       Sendkey (KeyStroke)
         ' Send keystroke (Enter) on the green screen
          autECLPSObj.SendKeys “[Enter]”
 
5.       GetText (Row, Col, Length)
          ' Gets the text of 10 bytes from row and col
          PSText = GetText (1,1,10)
 
6.       SetCursorPos (Row, Col)
          ' sets the cursor position at row and col location
          autECLPSObj.SetCursorPos 2, 1
 
7.       StartMacro (MacroName)
          ' Executes the PCOMM recorded .mac macro
          autECLPSObj.StartMacro "MacroName"
 
8.       WaitforInputReady (time in millsec)
          ' waits for specified number of milliseconds
           autECLOIAObj.WaitForInputReady(10000)
 
9.       Properties
          ' Number of rows and cols properties in green screen autECLPS class Object
           Rows = autECLPSObj.NumRows
           Cols = autECLPSObj.NumCols
 
10.     GetCursorRow and GetCursorCol
           ' fetch rows and cols properties position
           CurPosRow = autECLPSObj.CursorPosRow
           CurPosCol = autECLPSObj.CursorPosCol
 
11.      RegisterPSEvent/ RegisterCommEvent, RegisterKeyEvent
            ‘Refer the attached example Excel application
Download the sample code:
pcomm_hacl_sample.zip
File Size: 39 kb
File Type: zip
Download File

Contact:
For further information on automation, and services offerings please email zServices@hcl.com  or HCL-HI-LabServices@hcl.com.

Avinash Sable
Lead - Lab Services, IBM HACP & HATS
avinash.sable@hcl.com

2 Comments
Linus
4/17/2019 06:27:46 am

Hey,

Nice articles. I have a question that I cant make sense of: is HACL deprecated in IBMs cross plattform approach, or does it still live through Java components?

I battled with ACS-migrations from the Windows autECL, and after a month of headache ended up building a xHLLAPI-integration that I currently use. Its the only thing I found that worked for ACS out of the box (well, sort of: with the IBM bridge libraries added).

I dont love the interface. Is there still a better solution through HACL?

Would really appreciate any answer at linus.joensson.ms@outlook.com

Thanks!

//Linus

Reply
Badal
6/19/2019 02:10:46 am

Hi Linus,

Based on your comments what I understand is that you or your organization had iAccess and have moved to iACS. Since iAccess is out-of-support effective from April 30 2019, I assume this is why you have moved to iACS; and now are having issues in running the EHLLAPI and HACL based Excel Automation to iACS. Please correct me if I am wrong?

To answer your question, No, HACL is not deprecated but has its own flavour available for different platforms and continue to support HACL using different programming languages (VBs, C/C++, Java, etc).

The iAccess tool supports EHLLAPI and HACL Automation using Excel however, iACS supports EHLLAPI excel automation only through the EHLLAPI bridge, it doesn’t supports Excel with HACL automation.

A brief background here: The code base of both IBM PCOMM and iAcess is same and have similar features, look-n-feel, automation API’s with minimal difference. Though IAccess is out of support, the IBM PCOMM is still in Production and we have recently released version 14 with true 64-bit support. EHLLAPI and HACL API’s are true 64bit and works with Excel 64bit on a x64 OS.
More details about Version 14 can be found at the link below:
https://www.ibm.com/support/knowledgecenter/SSEQ5Y_14.0.0/com.ibm.pcomm.doc/books/html/quick_beginnings04.htm

Now, there are two ways to go about solving the migration issue:
1. Tune xEHLLAPI solution you’ve been working on and try to make the Excel based EHLLAPI + HACL code somehow work on iACS with EHLLAPI bridge the iAccess team provides.
2. Migrate from IBM iAccess/iACS to IBM PCOMM. With this your iAccess Automation applications will execute it on PCOMM with minimal changes. These required changes could be configuration related like path to automation libraries, any environmental variable etc.
Also, If you have IBM HACP licences then you can test your iAccess Automation application right away in PCOMM!

Please let me know if this information helps.

Reply



Leave a Reply.

    Archives

    May 2020
    October 2019
    July 2019
    June 2019
    May 2019
    March 2019
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    October 2017
    September 2017

    Categories

    All
    HACP
    HACPEE
    HATS
    HOD
    PCOMM

    RSS Feed

Proudly powered by Weebly
  • Home
  • Blogs
  • FORUM
  • About
  • Contact
  • Resources