Introduction

Screen customization is a screen event designed to perform a set of actions when a host screen is recognized. It includes recognizing a screen and transforming it into a GUI for the user or playing a macro to skip the screen. The screen customization definition includes a set of screen recognition criteria and a list of actions to be taken when a host screen matches the recognition criteria.

A host screen is recognized by matching specific screen recognition. For the recognition, we need to identify some fields, global variables, colors, etc. which are unique to the screens.

Consider a scenario where there are two HOST screens with the same fields and data. The first screen displays the complete data but in the second screen we have few data which are hidden or protected. Such screens cannot be recognized by using the ‘String Criteria’ but can be recognized by using the ‘Custom criteria’ option.

Implementation of Custom Screen Recognition criteria

To create a new custom criteria logic, we need to follow the below steps:

  1. Open the Java™ perspective and create a ZIETrans project.
  2. Click File > New > Class.
  3. Browse to the Source directory of your ZIETrans project.
  4. Enter the names of your package and class.
  5. Click Finish.

It is a simple java class extending com.ibm.hats.common.customlogic.AbstractAdvancedCustomScreenRecoListener

Fig 1:

We need to add the logic to the ‘isRecognized’ method which returns a boolean value.

public boolean isRecognized(String arg0, IBusinessLogicInformation arg1, ECLPS arg2, ECLScreenDesc arg3)

In the customed event file, click on Screen Recognition Criteria tab then select Custom Criterion from the Add dropdown option.

Fig 2:

Fig 3:

In the Class name input field, specify the name of the java class containing the method we want to run, or click Browse to select the class name from the source directory and call the method ‘isRecognized’. (As shown in Fig 3).

Recognition based on hidden fields

When we select a screen capture for recognition criteria, there is a check box for the Highlighting field, once we click on the check box for Hidden/Protected we can identify all the hidden/protected fields in the host screen. This feature is helpful to view the hidden and protected fields on a screen.

For example, we have an 8-character field in (16, 2) which is visible on the first screen but hidden in the second.

Fig 4:

Below is an example of Custom criteria logic for hidden field recognition –

Recognition using protected fields

Here is an example of creating custom criteria based on a protected field. Consider an example where there are two similar screens but in one screen LOC text field is protected and another it is unprotected. Based on the start and end position of this protected field, we have implemented our business logic in custom criteria to recognize the screens.

Here is a sample for the logic implemented in ‘isRecognized’ method to understand the protected field –

References:

1.https://zietrans.hcldoc.com/help/index.jsp?topic=%2Fcom.hcl.eng.doc%2Fdoc%2Fprogguid%2Fproggd05.html

 

Comment wrap
Further Reading
article-img
Mainframes | December 7, 2021
Using ZIETrans EJB
Read the blog for more details about EJB (Enterprise java bean) server-side software that helps to summarize the business logic of a particular application.
article-img
Mainframes | December 7, 2021
Enabling CSRF and XSS protections in ZIETrans
Read the blog to know more about Cross-Site Request Forgery(CSRF) how we can protect against CSRF and XSS in ZIETrans.
article-img
Mainframes | November 19, 2021
Launching Z and I Emulator for Transformation in Japanese Language
To know more about how to install ZIETRans by using one or both Packaged Distribution/Plugin Repository, enabling the Japanese language.
Close
Filters result by
Sort:
|