Products Downloads


French version


 

 

      

      

      

WADELIA

      

 

 

 

(I/B) (C)

 

 

Section for use

All

 

Syntax

GET_CTX ContextKey ContextLevel SeriesVariables

 

ContextKey

AlphanumConstant | AlphanumVariable

 

 

 

ContextLevel

'REQUEST' | 'SESSION' | 'GLOBAL_SESSION' | 'APPLICATION'

 

 

 

SeriesVariables

SeriesVariables Variable | Variable

 

Description

This instruction lets you get, from the variables (or memory lists) defined in the SeriesVariables variables, the values saved in the ContextKey key, in the implicit Request, Session or Application object (according to the ContextLevel context level).

 

In protected mode, the 'SESSION' context level applies to the Web pseudo-session and the 'GLOBAL_SESSION' context level applies to the Web session that "hosts" all the pseudo-sessions. Values stored at 'GLOBAL_SESSION' level are accessible from all the Web pseudo-sessions, whereas values stored at 'SESSION' level are not.

 

The SeriesVariables variables must correspond to the variable type and order specified in SET_CTX. However, it is possible to omit the end variables.

 

Important: You must match the case for the value of the ContextKey.

 

This instruction updates the reserved word *RETURN_CODE:

0 (*NORMAL)

Operation completed successfully.

-1

Operation not completed successfully (key not found for the context level indicated, or the type of one of the variables does not match that of the saved variable).

 

Note: If the information you retrieve from the context has been saved outside a WADELIA program (in a JSP or Servlet not developed using Adelia Web Studio), restrict yourself to a single variable corresponding to a simple Adelia type. In this way, the value of a simple Java type will be retrievable as the corresponding simple Adelia type. Additionally, in protected mode, the 'GLOBAL_SESSION' context level must be used, not the 'SESSION' level.

 

Click here for more information on equivalencies between Adelia types and 3GL types.

 

Example

* Program 1 calling

SET_CTX  'CustomerVal'  'Request'  ZCUST_CODE  ZCUST_NAME - ZCUST_ADD

PROCESS_PGM CUST_ORDER

*

* In the CUST_ORDER program

GET_CTX  'CustomerVal'  'Request'  ZCUST_CODE  ZCUST_NAME - ZCUST_ADD

IF  *RETURN_CODE = *NORMAL

...

 

See also the list of 4GL instructions by topic

↑ Top of page


  • Aucune étiquette