Initializing help system before first use

# insightgetcontext

Purpose
Get information about the context in which the app is executing (e.g. information about Insight server and any DMP solution), including an authorization token for any DMP solution.
Synopsis
`function insightgetcontext(env:string):insightcontext`
`function insightgetcontext:insightcontext`
Argument

env | The DMP lifecycle environment for which to request an authorization token - one of "design", "staging" and "production". If not specified, the environment of the Insight component instance executing the app will be used. Has no effect when Insight is not running within DMP.

Return value
A record containing various context information
Example

    declarations
      ctx: insightcontext
    end-declarations
    ctx := insightgetcontext
    if ctx.dmp.ispopulated then
      writeln('The Insight app is executing in the DMP ', ctx.dmp.environment, ' lifecycle environment')
    else
      writeln('The Insight app is not executing in DMP.')
    end-if

Example of using insightgetiteminfo to obtain the DMP lifecycle in which the app is executing
Further information
1. When outside DMP, the fields of the insightcontext record that relate only to DMP will be populated with an appropriate default value for their type (e.g. empty string).
2. Each invocation of insightgetcontext will communicate with the Insight server to fetch current context information and solution token.
3. Where the DMP solution has been configured with lifecycle isolation, only a token for the current or a lower lifecycle can be requested.
4. Attempting to get context information when the model is not being run through Xpress Insight will cause the model to abort with an error, except when test mode has been activated by setting insight_testmode.
5. When called from test mode, the value returned can be set by insightsetcontext
Related topics
insightcontext insightsetcontext
Parent Topic Context

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.