How to send additional session context information along with appserver calls
 
Forums / SmartComponent Library - Developer Forum / How to send additional session context information along with appserver calls

How to send additional session context information along with appserver calls

2 posts, 0 answered
  1. Gerry Holderbeke
    Gerry Holderbeke avatar
    4 posts
    Registered:
    08 Nov 2018
    10 Feb 2020
    Link to this post
    Using the sessionmanager properties we are able to send some predefined context information along with appserver calls. However the available fields in eSessionContext.i do not fully match the fields we would like to pass to the appserver.
    Anyone with experience in adding additional fields to send somewhat more custom fields to the appserver? Is it a question of extending the eSessionContext.i framework source (what we would like to avoid) or are there more flexible ways to handle this?
  2. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    10 Feb 2020 in reply to Gerry Holderbeke
    Link to this post
    The ContextWrapper has methods to add additional temp-tables to the context dataset. This is however intended for temporary extension of the context dataset.

    For permanent extension to the context dataset, you should leverage the fact that the structure of the context dataset is also loosely coupled. The only class knowing that dataset is the ContextDatasetFactory. Our standard implementation of the IContextDatasetFactory interface.

    So I suggest you implement your own CceContextDatasetFactory class. This should include our temp-table used in "our" ContextDataset and add your own table(s):

    { Consultingwerk/OERA/Context/eContextProperties.i &NO-BEFORE=YES }
    { Consultingwerk/OERA/Context/eSessionContext.i &NO-BEFORE=YES }

    DEFINE {&ACCESS} DATASET dsOsivContext{&SUFFIX} {&REFERENCE-ONLY} FOR   
        eContextProperties{&SUFFIX},
        eSessionContext{&SUFFIX},
        < your own additional tables >    .

    When implementing the CreateContextDataset method, please ensure you include "our" code:

        METHOD PUBLIC HANDLE CreateContextDataset ():
            
            IF NOT SESSION:REMOTE THEN DO:
                CREATE eSessionContext . 
                ASSIGN eSessionContext.ClientProVersion = PROVERSION 
                       eSessionContext.ClientType       = SESSION:CLIENT-TYPE . 
            END.
            
            RETURN DATASET dsContext:HANDLE .

        END METHOD.
2 posts, 0 answered