com.ibm.eNetwork.ECL Class ECLScreenReco

  PREV CLASS     NEXT CLASS FRAMES     NO FRAMES    
SUMMARY: NESTED |  FIELD |  CONSTR |  METHOD DETAIL:  FIELD |  CONSTR |  METHOD


java.lang.Object
  |
  +--
com.ibm.eNetwork.ECL.ECLScreenReco

      
public class ECLScreenReco
extends java.lang.Object

An ECLScreenReco object is the engine in the screen recognition system. It contains the methods for adding and removing descriptions of screens. It also contains the logic for recognizing those screens and for asynchronously calling back to your handler code for those screens.

Think of an object of the ECLScreenReco class as a unique "recognition set". The object can have multiple ECLPS objects that it watches for screens, multiple screens to look for, and multiple callback points to call when it sees a screen in any of the ECLPS objects.

All you need to do is set up your ECLScreenReco objects at the start of your application, and when any screen appears in any ECLPS that you want to monitor, your code will get called by ECLScreenReco.

ECLScreenReco uses the following logic for recognizing, or matching ECLScreenDesc objects, which contain ECLScreenDescriptor-derived objects, against the data in an ECLPS object:

The following is a code fragment showing a common use of ECLScreenReco and ECLScreenDesc:



    // Set up a screen description object. In this example, the
    // screen is identified by a cursor position, a key word, and
    // the number of fields.
    myScreenDesc = new ECLScreenDesc();
    myScreenDesc.AddCursorPos(23,1);
    myScreenDesc.AddString("LOGON");
    myScreenDesc.AddNumFields(15);
 

    // Set up screen reco object
    myScreenReco = new ECLScreenReco();
    // myECLPS is an instance of ECLPS obtained from an instance of ECLSession
    myScreenReco.AddPS(myECLPS);
    // myCallback is a class that implements ECLRecoNotify.
    // myCallback will be notified if the screen defined by our
    // screen description object is recognized.
    myScreenReco.RegisterScreen(myScreenDesc, myCallback);
 

ECLScreenReco operates in a single-step mode. The recognition engine is activated, reviews screen updates, fires a recognition event and then turns itself off. Each recognition cycle is a single step: the recognition engine is on and then it is off. Therefore the application must build complex behavior from a series of single steps (which is the methodology underlying the Macro facility).

We recommend following these points to code a step:

  • 1. Compose a set one or more ECLScreenDesc instances that describes the next likely screen to appear (the desired target) including transition screens.
  • 2. Add that set of descriptors to a Vector.
  • 3. Use RegisterScreen( Vector, ECLRecoNotify, boolean ) to activate the screenreco engine.
  • 4. When the application's ECLRecoNotify handler method NotifyEvent(ECLPS, ECLScreenDesc) is called, react by first calling the ECLScreenReco.UnregisterAllScreens() to remove the vector of screen descriptors. The screenreco engine is then inactive.
  • 5. Next take whatever action is appropriate to the specific combination of ECLScreenDesc and ECLPS instances that were passed to the handler.
  • 6. Loop back to step #1. The smallest set of screen descriptions that accurately describes the next possible "state transition" will increase the accuracy and efficiency of the screen recognition process. The set that was just "unplugged" may not be the most appropriate set to be "plugged in" next.

If you are using ECLScreenReco to manage screen traversals, avoid mixing in the ECLPS and ECLOIA families of WaitForXxxx() and WaitWhileXxxx() methods.

If you are using ECLScreenReco because your application is non-GUI, consider that Session in tandem with Macro is also non-GUI. The Macro facility is highly refined and supports recording and editing. Using it may considerably reduce the development effort for screen traversal logic and actions.

Field Summary
 java.lang.String oHostid            

 

Constructor Summary
ECLScreenReco ()           Creates an instance of ECLScreenReco.
ECLScreenReco (boolean active)           Creates an instance of ECLScreenReco with monitoring initially turned off or on.

 

Method Summary
 void AddECLRecoDebugListener ( ECLRecoDebugListener listener)           Adds the given ECLRecoDebugListener to list of listeners.
 void AddPS ( ECLPS ps)           Adds an ECLPS object (Presentation Space) to the screen recognition system.
 void AddPS ( ECLPS ps, int eventType)           Adds an ECLPS object (Presentation Space) to the screen recognition system.
 void dispose ()           Cleans up the object's internal environment.
 void DoReco ()           Performs a recognition analysis for all the currently registered screens.
 boolean IsActive ()           Returns the ECLScreenReco monitoring process state.
static boolean IsMatch ( ECLPS ps, ECLScreenDesc sd)           Compares the particular screen description to the current content of the indicated presentation space.
static boolean IsMatch (java.lang.String dHostid, ECLPS ps, ECLScreenDesc sd)           Compares the particular screen description to the current content of the indicated presentation space.
 void RegisterScreen ( ECLScreenDesc sd, ECLRecoNotify notify)           Register an ECLScreenDesc object with the screen recognition system.
 void RegisterScreen ( ECLScreenDesc sd, ECLRecoNotify notify, boolean initEvent)           Register an ECLScreenDesc object with the screen recognition system.
 void RegisterScreen (java.lang.String dHostid, ECLScreenDesc sd, ECLRecoNotify notify)           Register an ECLScreenDesc object with the screen recognition system.
 void RegisterScreen (java.lang.String dHostid, ECLScreenDesc sd, ECLRecoNotify notify, boolean initEvent)           Register an ECLScreenDesc object with the screen recognition system.
 void RegisterScreen (java.lang.String dHostid, java.util.Vector sds, ECLRecoNotify notify, boolean initEvent)           Registers a Vector ECLScreenDesc object with the screen recognition system.
 void RegisterScreen (java.util.Vector sds, ECLRecoNotify notify, boolean initEvent)           Registers a Vector ECLScreenDesc object with the screen recognition system.
 void RemoveECLRecoDebugListener ( ECLRecoDebugListener listener)           Removes the given ECLRecoDebugListener from list of listeners.
 void RemovePS ( ECLPS ps)           Removes an ECLPS object (Presentation Space) from the screen recognition system.
 void RemovePS ( ECLPS ps, int eventType)           Removes an ECLPS object (Presentation Space) from the screen recognition system.
 void SetActive (boolean active)           Starts or stops the ECLScreenReco monitoring process.
 void UnregisterAllScreens ()           Removes all registered screens from the screen recognition object.
 void UnregisterScreen ( ECLScreenDesc sd, ECLRecoNotify notify)           Remove an ECLScreenDesc object and its corresponding ECLRecoNotify object from the screen recognition system.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

oHostid



public java.lang.String 
oHostid

         

Constructor Detail

ECLScreenReco



public 
ECLScreenReco()

ECLScreenReco



public 
ECLScreenReco(boolean active)
Parameters:
active - If false, ECLScreenReco will not start monitoring until ECLScreenReco.SetActive is called. If true, monitoring will start with the first call to ECLScreenReco.RegisterScreen

Method Detail

dispose



public void 
dispose()

RegisterScreen



public void 
RegisterScreen(
ECLScreenDesc sd,
                           
ECLRecoNotify notify)

RegisterScreen



public void 
RegisterScreen(java.lang.String dHostid,
                           
ECLScreenDesc sd,
                           
ECLRecoNotify notify)

RegisterScreen



public void 
RegisterScreen(
ECLScreenDesc sd,
                           
ECLRecoNotify notify,
                           boolean initEvent)

RegisterScreen



public void 
RegisterScreen(java.lang.String dHostid,
                           
ECLScreenDesc sd,
                           
ECLRecoNotify notify,
                           boolean initEvent)

RegisterScreen



public void 
RegisterScreen(java.util.Vector sds,
                           
ECLRecoNotify notify,
                           boolean initEvent)

RegisterScreen



public void 
RegisterScreen(java.lang.String dHostid,
                           java.util.Vector sds,
                           
ECLRecoNotify notify,
                           boolean initEvent)

UnregisterScreen



public void 
UnregisterScreen(
ECLScreenDesc sd,
                             
ECLRecoNotify notify)

AddPS



public void 
AddPS(
ECLPS ps)

AddPS



public void 
AddPS(
ECLPS ps,
                  int eventType)

RemovePS



public void 
RemovePS(
ECLPS ps)

RemovePS



public void 
RemovePS(
ECLPS ps,
                     int eventType)

AddECLRecoDebugListener



public void 
AddECLRecoDebugListener(
ECLRecoDebugListener listener)

RemoveECLRecoDebugListener



public void 
RemoveECLRecoDebugListener(
ECLRecoDebugListener listener)

SetActive



public void 
SetActive(boolean active)

IsActive



public boolean 
IsActive()

DoReco



public void 
DoReco()

UnregisterAllScreens



public void 
UnregisterAllScreens()

IsMatch



public static boolean 
IsMatch(
ECLPS ps,
                              
ECLScreenDesc sd)
                       throws 
ECLErr

         

IsMatch



public static boolean 
IsMatch(java.lang.String dHostid,
                              
ECLPS ps,
                              
ECLScreenDesc sd)
                       throws 
ECLErr

         

  PREV CLASS     NEXT CLASS FRAMES     NO FRAMES    
SUMMARY: NESTED |  FIELD |  CONSTR |  METHOD DETAIL:  FIELD |  CONSTR |  METHOD