Introduction

CA Gen enables application development on Windows workstations and supports application deployment to integrate multiple platforms on z/OS (CICS and IMS), UNIX, Linux, Windows, .NET and J2EE.

CA is Computer Associates. And CA Gen is one of their product.

24) GEN, CA GEN, CoolGen client procedure related best practice





The control to the client procedure comes from the following ways:
1.   From previous client
2.   From the server
3.   From the same client (for displaying an error)
4.   From the next client (on success or failure)
To know where the control comes is quite tricky.

Best Practice:
The usual way of communicating from client to client OR client to server is through the IEF variable command. But as explained above this alone is not sufficient to signify where the control comes from. Hence the following convention is followed:
·       Two variables curr_command and prev_command are maintained. curr_command is assigned to prev_command, command is assigned to curr_command in the beginning of the client procedure.
·       Command is set to "return" whenever the control transfers from the server
·       The convention is as follows:
Client procedure:
...
...
/* Execute client validations here */
CASE of Command
CASE…
CASE…
Otherwise…
End CASE

/* Execute client code after window has been displayed */
CASE of curr_command
CASE…
CASE…
Otherwise…
End CASE

/* Execute client code after return from server */
CASE of prev_command
CASE return
            /* Code to be added return from server */
            …
CASE…
Otherwise…
End CASE


Note: Client validations can also be executed as events.

No comments: