Kbase P116950: ADM2. How to override the context using obtainContextForServer or obtainContextForClient
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/11/2006 |
|
Status: Unverified
GOAL:
How to override the context using obtainContextForServer or obtainContextForClient
GOAL:
How to add a custom override for 'ServerFirstCall' using obtainContextForServer
FACT(s) (Environment):
OpenEdge 10.1x
FIX:
Overriding the context has been very difficult in the past.
Since OE10.1A is possible to override this in an SDO and make it works also when the SDO is in an SBO or an AppServer aware container.
This is done by overriding obtainContextForServer or obtainContextForClient directly. It is very similar to how it would be done in genContextList, but you don't need to use CHR(3), but CHR(4) for all.
Please note the following example:
FUNCTION obtainContextForServer RETURNS CHARACTER
( /* parameter-definitions */ ) :
/*------------------------------------------------------------------------------
Purpose: Super Override
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cPropertiesForServer AS CHARACTER NO-UNDO.
/* Code placed here will execute PRIOR to standard behavior. */
DEF VAR wshGlobHdl AS HANDLE NO-UNDO.
{get GlobalHandle wshGlobHdl}.
/*'wshGlobHdl' is handle to a persistent procedure that contain all our user defined properties Alternatively you can use a shared variables*/
ASSIGN cPropertiesForServer = SUPER( ).
ASSIGN cPropertiesForServer = cPropertiesForServer
+ (IF cPropertiesForServer <> "":U THEN CHR(3) ELSE "":U)
+ "ServerComId" + CHR(4) + {fn getComIdwshGlobHdl}
+ CHR(3)
+ "ServerOAComNum" + CHR(4) + {fn getOAComNum wshGlobHdl}
+ CHR(3)
+ "ServerBraId" + CHR(4) + {fn getBraIdwshGlobHdl}.
RETURN cPropertiesForServer.
END FUNCTION.