EPI sample

The EPI Sample consists of a stateful session bean, a client application, a custom record which demonstrates the use of the Screenable interface, and a custom LogonLogoff class.The following files are part of the EPI Sample:
EPIPlayScript.java
Enterprise bean remote interface
EPIPlayScriptHome.java
Enterprise bean home interface
EPIPlayScriptBean.java
Enterprise bean implementation
EPIPlayScriptClient.java
Enterprise bean client program
CICSCESNLogon.java
A LogonLogoff class
Ejb-jar-epi-1.1.xml
Example of a deployment descriptor

The deployment descriptor is an example of an EJB 1.1-compliant deployment descriptor for this Enterprise Bean. If you wish to package it up into a jar file, rename it to Ejb-jar.xml and store it in the META-INF directory of the jar file. It may require further entries if it is to be deployed into an EJB 2.0-compliant environment.

Your J2EE Server documentation describes how to compile and deploy the bean within your environment. However, you need to ensure that the following jar files are also available on the CLASSPATH:

The Enterprise Bean looks for an EPI connection factory named java:comp/env/EPI. See your J2EE Server's documentation for details of how deploy the resource adapter under this reference in the JNDI. When deploying the bean into your environment you need to supply this reference for the bean to find the resource. The client program looks for the EPIPlayScript bean with a name of EPIPlayScript1. Refer to your J2EE Server documentation for details of how to setup the bean with this name in the JNDI namespace. The bean can be deployed as a bean-managed transaction.

The bean is designed to take a series of commands and drive a 3270 interaction. Once the commands are complete, the field text is returned as a string array based on fields requested to be returned by the script. The client can then look at these field texts and send more commands to drive that interaction if necessary. The commands that drive the 3270 screen are as follows:
S(txn)
Start transaction “txn”
F(x)=“Text”
Set field number x to “Text”. Field numbers start at 1.
P(aid)
Press key 'aid'
C(row, col)
place cursor at row, col (row and col start at 1)
R(x)
Adds the text of the field at the given field number to the string array that will be returned. Field numbers start at 1.
So an example of a script might be:
S(CESN)F(7)="myuser"F(10)="mypass"P(enter)R(1)

The EPIPlayScriptClient program takes no parameters; it has a default command sequence coded into it. Experiment by changing this command sequence or enhancing the sample.

The CICSCESNLogon.java sample contains example code on how to logon to a CICS® Transaction Server for z/OS® system. The code is designed to work for English systems and might have to be tailored for other versions of CICS and languages. In order to use this class, deploy it as part of the sample bean and reference it when you deploy the EPI resource adapter. For more information about how to deploy the EPI resource adapter see J2EE setup and configuration, in the CICS Transaction Gateway: Administration book for your operating system.