The features of the classes generated by using the BMS Conversion Utility, and using the generated Map class.
try {
EPIGateway epi = new EPIGateway("jgate", 2006 );
// Connect to CICS server
Terminal terminal = new Terminal( epi, "CICS1234", null, null );
// Start transaction on CICS server
terminal.send( null, "EPIC", null );
MAPINQ1Map map = new MAPINQ1Map( terminal.getScreen() );
Field field;
// Output text from "PRODNAM" field
field = map.field(MAPINQ1Map.PRODNAM);
System.out.println( "Product Name: " + field.getText() );
// Output text from "APPLID" field
field = map.field(MAPINQ1Map.APPLID);
System.out.println( "Applid : " + field.getText() );
} catch (Exception exception) {
exception.printStackTrace();
}
In this example the server program uses a BMS map for its first panel, for which a map class "MAPINQ1Map" has been generated. When the map object is created, the constructor validates the screen contents with the fields defined in the map. If validation is successful, fields can then be accessed using their BMS field names instead of by index or position from the Screen object:
BMS Map objects can also be used within the Session handleReply method.
For validation to succeed, the entire BMS map must be available on the current screen. A map class cannot therefore be used when some or all of the BMS map has been overlaid by another map or by individual 3270 fields.