bea.com | products | dev2dev | support | askBEA
 Download Docs 
 Search 

Programming Guide

 Previous Next Contents Index View as PDF  

Understanding Programming Flows

This section illustrates the interaction between WebLogic Server and mainframe programs. The following topics are discussed:

 


Distributed Program Link Programming Flows

The following examples of DPL programming flows are discussed:

Java Client Request/Response to CICS DPL

Figure  5-1 illustrates a Java Client Request/Response to CICS DPL programming flow.

Figure 5-1 Java Client Request/Response to CICS DPL


 

The following steps describe the Java Client Request/Response to CICS DPL programming flow.

  1. A Java client class (such as a stand-alone client, EJB, etc.) makes a call to the BaseClient.toupper method with a Chardata DataView as the parameter.

  2. In the toupper method, a call is made to the EgenClient.callService method.

    Note: The BaseClient extends EgenClient, so the BaseClient inherits the callService method from EgenClient.

    The value of the first parameter is TOUPPER. TOUPPER is the name of the DPL Service that is mapped to the CICS DPL program TOUPCICS in the WebLogic Administrative Console.


     

  3. The host mirror transaction starts the TOUPCICS program and passes the contents of the inputBuffer byte array as the commarea.

  4. The TOUPCICS program processes the data.

  5. The CICS server returns the commarea. The data is returned from the EgenClient.callService method as the byte array rawResult.

CICS Request/Response DPL to WebLogic Server EJB

Figure  5-2 illustrates a CICS request/response DPL to WebLogic Server EJB programming flow.

Figure 5-2 CICS Request/Response DPL to WebLogic Server EJB


 

The following steps describe the CICS request/response DPL to WebLogic Server EJB programming flow.

  1. The user-entered transaction TRCL invokes the TRADCLNT program.

    The EXEC CICS LINK command causes the advertised service TRADSERV to execute. The SYSID value is set to the name of the connection associated with the CRM Logical Unit. The SYNCONTRETURN parameter indicates that the WebLogic Server EJB will not be involved in the CICS transaction.

  2. In the WebLogic Administration Console, the TRADSERV service is mapped to the JNDI name jam.TradeServer for the TradeServer EJB. This causes the dispatch method of TradeServerBean to be invoked.


     

  3. The buy method is invoked from the dispatch method.

  4. The business logic is performed, and the result is returned to the dispatch method.

  5. The data is returned from the dispatch method into the COMMAREA.

CICS DPL Asynchronous No Reply to WebLogic Server Application

Figure  5-3 illustrates a CICS DPL asynchronous no reply to Java server programming flow.

Figure 5-3 CICS DPL asynchronous no reply to Java server


 

The following steps describe the CICS DPL asynchronous no reply to Java server programming flow.

  1. The user-entered transaction CTOJ invokes the JMSCLNT program.

  2. The EXEC CICS LINK command causes the advertised service CTOJMSSV to execute. The SYSID value is set to the name of the connection associated with the CRM Logical Unit. The SYNCONTRETURN parameter indicates that the WebLogic Server EJB will not be involved in the CICS transaction.

  3. The Gateway sends the message to the JMS Event CTOJMSSV. In the WebLogic Administration Console, the CTOJMSSV service name is mapped to the JMS topic Jam.examples.CICS.EventTopic.


     

  4. Data that is identical to the request data is returned in the COMMAREA to JMSCLNT.

Transactional Java Client Request/Response to CICS DPL

Figure  5-4 illustrates a transactional Java client request/response to CICS DPL programming flow.

Figure 5-4 Transactional Java Client Request/Response to CICS DPL


 

The following steps describe the transactional Java client request/response to CICS DPL programming flow.

  1. A Java client class calls the begin method of a UserTransaction object to start a transaction.

  2. Within the boundaries of that transaction, the Java client class makes a call to the BaseClient.toupper method with a Chardata DataView as the parameter.

  3. In the toupper method, a call is made to the EgenClient.callService method.

    Note: The BaseClient extends EgenClient, so the BaseClient inherits the callService method from EgenClient.

    The value of the first parameter is TOUPPER. TOUPPER is the name of the DPL Service that is mapped to the CICS DPL program TOUPCICS in the WebLogic Administration Console.


     

  4. The host mirror transaction starts the TOUPCICS program and passes the contents of the inputBuffer byte array as the commarea.

  5. The TOUPCICS program processes the data.

  6. The CICS server returns the commarea. The data is returned from the EgenClient.callService method as the byte array rawResult.

  7. The Java client class calls the commit method of the UserTransaction object to indicate the successful completion of the transaction. This causes the commit of the WebLogic managed resources, as well as the resources held by the Host Mirror Transaction.

Transactional CICS Request/Response DPL to WebLogic Server EJB

Figure  5-5 illustrates a transactional CICS request/response DPL to WebLogic Server EJB programming flow.

Figure 5-5 Transactional CICS Request/Response DPL to WebLogic Server EJB


 

The following steps describe the transactional CICS request/response DPL to WebLogic Server EJB programming flow.

  1. The user-entered transaction TRCL invokes the TRADCLNT program.

  2. The EXEC CICS LINK command causes the advertised service TRADSERV to execute. The SYSID value is set to the name of the connection associated with the CRM Logical Unit. When the SYNCONRETURN command is not included in the EXEC CICS LINK, this indicates that the WebLogic Server is involved in the CICS transaction.

    In the WebLogic Administration Console, the TRADSERV service is mapped to the JNDI name jam.TradeServer for the TradeServer EJB. This causes the dispatch method of TradeServerBean to be invoked.


     

  3. The buy method is invoked from the dispatch method.

  4. The business logic is performed, and the result is returned to the dispatch method.

  5. The data is returned from the dispatch method into the COMMAREA.

  6. If necessary, further processing can be done in TRADCLNT before the EXEC CICS SYNCPOINT that ends the transaction.

 


IMS Implicit APPC Programming Flows

The following examples of IMS implicit APPC programming flows are discussed:

Java Client Request/Response to IMS Transaction Program

Figure  5-6 illustrates a Java Client Request/Response to IMS programming flow.

Figure 5-6 Java Client Request/Response to IMS Transaction Program


 

The following steps describe the Java Client Request/Response to IMS programming flow.

  1. A Java client class (such as a stand-alone client, EJB, etc.) makes a call to the BaseClient.toupper method with a Chardata DataView as the parameter.

  2. In the toupper method, a call is made to the EgenClient.callService method.

    Note: The BaseClient extends EgenClient, so the BaseClient inherits the callService method from EgenClient.

    The value of the first parameter is TOUPPER. TOUPPER is the name of the APPC Service that is mapped to the IMS transaction TOUPIMS in the WebLogic Administrative Console.


     

  3. IMS starts the TOUPIMS transaction. This transaction executes the associated program TOUPIMS. The contents of the inputBuffer byte array are placed on an IOPCB as request data.

  4. The TOUPIMS program accesses the request data by performing a get unique on the IOPCB.

  5. The TOUPIMS program processes the data and creates a response message.

  6. The TOUPIMS program inserts the response data to the IOPCB.

  7. IMS returns the response data back to the requester. The data is returned from the EgenClient.callService method as the byte array rawResult.

IMS Asynchronous No Reply Transaction Program to Java Server

Figure  5-7 illustrates an IMS asynchronous no reply transaction program to a Java server programming flow.

Figure 5-7 IMS Asynchronous No Reply Transaction Program to Java Server


 

The following steps describe the IMS transaction program to asynchronous no reply Java Server programming flow.

  1. IMS starts the IMSTOJMS transaction. This transaction executes the associated program IMSTOJMS.

  2. The IMSTOJMS program accesses the input data by doing a get unique on the IOPCB.

  3. The IMSTOJMS program composes the request message.

  4. The IMSTOJMS program issues a call with the CHNG function code to store the appropriate logical terminal name in a modifiable alternate PCB.

    Note: To use an alternate PCB, you must include a PCB statement in your PSB (see Listing  5-1).

Listing 5-1 IMS PSBGEN for a Modifiable Alternate PCB for the IMS Client

PCB   TYPE=TP,MODIFY=YES
PSBGEN PSBNAME=IMSTOJMS,CMPAT=YES,LANG=COBOL

Note: The logical terminal name, in this case JAMIMS01, must be mapped to an LU name and a transaction name in a LU 6.2 Descriptor. In Listing  5-2, JAMIMS01 is mapped to the LU CRMLU and the transaction ITOJMSSV.

Listing 5-2 LU 6.2 Descriptor

A JAMIMS01 LUNAME=CRMLU TPNAME=ITOJMSSV SYNCLEVEL=N

  1. The IMSTOJMS program issues an insert call with the request message to the alternate PCB, ALTPCB.

  2. The IMSTOJMS program issues a PURG call to the alternate PCB, ALTPCB, to tell IMS to send the request message.

  3. IMS sends the request message to the indicated LU, the LU configured for the CRM. The request message is forwarded to the Gateway.

  4. The gateway sends the message to the JMS Event ITOJMSSV. ITOJMSSV is the transaction name in the LU 6.2 descriptor in Listing  5-2. In the WebLogic Administration Console, the ITOJMSSV service name is mapped to the JMS topic JAM.examples.IMS.EventTopic.


     

Transactional Java Client Request/Response to IMS Transaction Program

Figure  5-8 illustrates a transactional Java client request/response to an IMS transaction programming flow.

Figure 5-8 Transactional Java Client Request/Response to an IMS Transaction Program


 

The following steps describe the transactional Java client request/response to IMS transaction programming flow.

  1. A Java client class calls the begin method of a UserTransaction object to start a transaction.

  2. Within the boundaries of that transaction, the Java client class makes a call to the BaseClient.toupper method with a Chardata DataView as the parameter.

  3. In the toupper method, a call is made to the EgenClient.callService method.

    Note: The BaseClient extends EgenClient, so the BaseClient inherits the callService method from EgenClient.

    The value of the first parameter is TOUPPER. TOUPPER is the name of the APPC Service that is mapped to the IMS transaction TOUPIMS in the WebLogic Administration Console.


     

  4. IMS starts the TOUPIMS transaction that executes the associated program TOUPIMS. The contents of the inputBuffer byte array are placed on an IOPCB as request data.

  5. The TOUPIMS program accesses the request data by doing a get unique on the IOPCB.

  6. The TOUPIMS program processes the data and creates a response message.

  7. The TOUPIMS program inserts the response data to the IOPCB.

  8. IMS returns the response data back to the requester. The data is returned from the EgenClient.callService method as the byte array rawResult.

  9. The Java client class calls the commit method of the UserTransaction object to indicate the successful completion of the transaction. This causes the commit of the WebLogic managed resources, as well as the resources managed by IMS.

 


Common Programming Interface for Communications Programming Flows

The following examples of CPI-C programming flows are discussed:

Java Client Request/Response to Host CPI-C

Figure  5-9 illustrates a Java client request/response to a host CPI-C programming flow.

Figure 5-9 Java Client Request/Response to Host CPI-C


 

The following steps describe the Java client request/response to host CPI-C programming flow.

  1. A Java client class (such as a stand-alone client, EJB, etc.) makes a call to the BaseClient.toupper method with a Chardata dataview as the parameter.

  2. In the toupper method, a call is made to the EgenClient.callService method.

    Note: The BaseClient extends EgenClient, so the BaseClient inherits the callService method from EgenClient.

    The value of the first parameter is SIMPCPIC. SIMPCPIC is the name of the APPC Service that is mapped to the CPI-C Transaction Program ID TPNCPIC in the WebLogic Administration Console.


     

  3. The transaction program TPNCPIC invokes the TOUPCPIC program.

  4. TOUPCPIC accepts the conversation with the cmaccp call. The conversation ID returned in convid is used for all other requests on this conversation.

  5. The cmrcv request receives the inputBuffer buffer contents for processing.

  6. The TOUPCPIC program processes that data.

  7. The cmsst request prepares for the send request by setting the send type to CM_SEND_AND_DEALLOCATE.

  8. The cmsend request returns the obuffer contents. The data is returned from the EgenClient.callService method as the byte array rawResult.

Host CPI-C Request/Response to WebLogic Server EJB

Figure  5-10 illustrates a host CPI-C request/response to WebLogic Server EJB programming flow.

Figure 5-10 Host CPI-C Request/Response to WebLogic Server EJB


 

The following steps describe the host CPI-C request/response to WebLogic Server EJB programming flow.

  1. The CPI-C application program TRADCPIC is invoked using the environment start-up specifications.

  2. The TRADCPIC client requests cminit to establish conversation attributes and receive a conversation ID that will be used on all other requests on this conversation. The remote server and service are named in the CPI-C side information entry TRADSIDE.

  3. The cmallc request initiates the advertised service TRADSERV. In the WebLogic Administration Console, the TRADSERV service is mapped to the JNDI name jam.TradeServer for the TradeServer EJB.


     

  4. The cmsst request prepares the next send request by setting the send type to CM_SEND_AND_PREP_TO_RECEIVE.

  5. The cmsend request immediately sends the contents of the obuffer to the dispatch method of TradeServerBean in the commarea byte array and relinquishes control.

  6. The buy method is messaged from the dispatch method.

  7. The business logic is performed, and the result is returned to the dispatch method.

  8. The cmrcv request receives the contents of the byte array returned from the dispatch method in the ibuffer buffer, and notification that the conversation has ended with the return code value of CM_DEALLOCATED_NORMAL.

Host CPI-C Asynchronous No Reply to Java Server

Figure  5-11 illustrates a Host CPI-C asynchronous no reply to Java server programming flow.

Figure 5-11 Host CPI-C Asynchronous No Reply to Java Server


 

The following steps describe the Host CPI-C asynchronous no reply to Java server programming flow.

  1. The CPI-C application program JMSCPIC is invoked using the environment start-up specifications.

  2. The JMSCPIC client requests cminit to establish conversation attributes and receive a conversation ID that will be used on all other requests on this conversation. The remote server and service are named in the CPI-C side information entry JMSSIDE.

  3. The cmallc request initiates the advertised service CTOJMSSV.

  4. The cmsend request sends the contents of the obuffer to the CTOJMSSV service.

  5. The cmdeal request flushes the data and indicates the conversation is finished. The request message is forwarded to the Gateway.

  6. The Gateway sends the message to the JMS Event CTOJMSSV. In the WebLogic Administration Console, the CTOJMSSV service name is mapped to the JMS topic JAM.examples.CPIC.EventTopic.


     

Transactional Java Client Request/Response to Host CPI-C

Figure  5-12 illustrates a transactional Java client request/response to a Host CPI-C programming flow.

Figure 5-12 Transactional Java Client Request/Response to a Host CPI-C


 

The following steps describe the transactional Java client request/response to a host CPI-C programming flow.

  1. A Java client class calls the begin method of a UserTransaction object to start a transaction.

  2. Within the boundaries of that transaction, the Java client class (stand-alone client, EJB, etc.) makes a call to the BaseClient.toupper method with a Chardata DataView as the parameter.

  3. In the toupper method, a call is made to the EgenClient.callService method.

    Note: The BaseClient extends EgenClient, so the BaseClient inherits the callService method from EgenClient.

    The value of the first parameter is SIMPCPIC. SIMPCPIC is the name of the APPC Service that is mapped to the CPI-C transaction program ID TPNCPIC in the WebLogic Administration Console.


     

  4. The transaction program with the tpname TPNCPIC invokes the TOUPCPIC program.

  5. TOUPCPIC accepts the conversation with the cmaccp call. The conversation ID returned in convid is used for all other requests on this conversation.

  6. The cmrcv request receives the inputBuffer buffer contents for processing.

  7. The TOUPCPIC program processes that data.

  8. The cmsst and cmsptr prepare the next send request by setting the send type to CM_SEND_AND_PREP_TO_RECEIVE and by setting the prepare-to-receive type to CM_PREP_TO_RECEIVE_CONFIRM. The CONFIRM indicates that the service has completed successfully.

  9. The cmsend request returns the obuffer contents. The data is returned from the EgenClient.callService method as the byte array rawResult.

  10. The Java client class calls the commit method of the UserTransaction object to indicate the successful completion of the transaction and request the commit of all updated resources. The cmrcv request receives the commit request, and responds explicitly to the request with the SAA Resource/Recovery commit call srrcmit. The conversation is ended after the successful commit exchange.

Transactional Host CPI-C Request/Response to WebLogic Server EJB

Figure  5-13 illustrates a transactional host CPI-C request/response to WebLogic Server EJB programming flow.

Figure 5-13 Transactional Host CPI-C Request/Response to WebLogic Server EJB


 

The following steps describe the transactional host CPI-C request/response to WebLogic Server EJB programming flow.

  1. The CPI-C application program TRADCPIC is invoked using the environment start-up specifications.

  2. The TRADCPIC client requests cminit to establish conversation attributes and receive a conversation ID that will be used on all other requests on this conversation. The remote server and service are named in the CPI-C side information entry TRADSIDE.

  3. The cmssl sets the conversation attribute to sync-level 2 with CM_SYNCPOINT. This allows the WebLogic EJB to participate in the transaction.

  4. The cmallc request initiates the advertised service TRADSERV. In the WebLogic Administration Console the TRADSERV service is mapped to the JNDI name jam.TradeServer for the TradeServer EJB.


     

  5. The cmsst request prepares the next send request by setting the send type to CM_SEND_AND_PREP_TO_RECEIVE.

  6. The cmsend request immediately sends the contents of the obuffer to the dispatch method of TradeServerBean in the commarea byte array and relinquishes control.

  7. The buy method is messaged from the dispatch method.

  8. The business logic is performed, and the result is returned to the dispatch method.

  9. The cmrcv request receives the contents of the byte array returned from the dispatch method in the ibuffer buffer. The cmrcv receives a confirm request indicating the conversation should terminate.

  10. The client replies positively to the confirm request with cmcfmd.

  11. The TRADCPIC client prepares to free the conversation with the cmdeal request. The conversation in CM_DEALLOCATE_SYNC_LEVEL commits all updated resources in the transaction and waits for the SAA resource recovery verb, srrcmit. After the commit sequence has completed, the conversation terminates.

 

Back to Top Previous Next