Skip to Main Content
Return to Navigation

Understanding Contexts

Contexts are a key component of how the PeopleSoft Active Analytics Framework works—their purpose is to describe the computing environment from which the decision engine is invoked and select the appropriate term implementation at runtime.

Online and Generic Contexts

Contexts can be online or generic. Online contexts must be associated with a PeopleSoft online page, whereas generic contexts can be used anywhere (including online pages).

The data elements within a context are called context variables. Online contexts have built-in context variables—they are the fields of the online page. However, the data elements in an online context are not limited to the online fields; both online and standalone contexts can have additional context variables defined.

Within a given context, all context variables must be assigned unique code names called aliases. Aliases are used to associate data with the input binds required by term implementations. For example, a field representing the customer ID may be named CUSTOMER_ID in the application page, but may have an alias of CUST_ID. Using aliases enables terms to be used in the largest possible set of contexts. Page variables exist on a one-to-one basis with their underlying fields; that is, two or more context variables may point to the same page field as long as the aliases of these context variables are distinct. This enables the context user to have aliases named both CUSTOMER_ID and CUST_ID, thereby facilitating term reuse. Context variables are exposed to the user by corresponding term definitions.

At runtime, applications can request the data library engine to automatically populate the online context in memory, provided that the request is made from the component from which the online context can be constructed. In case of generic contexts, applications can either construct the context explicitly by populating values for these context variables, or request the data library to automatically copy values from level 0 context variables of an online context to similar context variables of a generic context.

Context variables can be:

  • Page variables that correspond to fields within PeopleSoft application pages.

    Page variables are also referred to as native context variables, because they are native to the pages from which their values come.

    Note: Use caution when altering the component structure after generating page variables for an online context (using the Generate Context component). Changes made to existing fields on the application page might invalidate the corresponding context variables and the terms from which they are resolved.

  • Constants.

    Generic contexts usually consist of named constants. Constant-type context variables may not have specific values associated with them when the context is registered; some of these variables may get values at runtime.

  • Term variables.

    These context variables are data library terms that have been inserted into the context. A context may have any number of terms included within it. However, if a term's implementations require binds, then the context must provide them from its page variables and constants. Term variables can be used to add extended data elements for implementation binds and actions without your having to customize the application.