Use Context Parameters in Extensions

In addition to built-in system variables that can be used within a dynamic component (for example, device size or user role), the Unified Application's developer at Oracle or a dependency's developer can define context parameters that might otherwise be inaccessible to a dynamic component.

Dependency developers and Unified Application's developers at Oracle may choose to define context parameters for:

  • values produced by your application that come from outside the component, such as page variables,
  • details from other parts of the application,
  • other values that might be useful when extending the application.

You might see parameters in these three contexts in your extension:

Context Description
$componentContext

Parameters in the $componentContext can be accessed in a dynamic component's Expression Editor and in the rule set condition builder.

You might also see $componentContext parameters in business rule conditions when no $ObjectContext parameters have been defined.

$baseComponentContext

Parameters in the $baseComponentContext can be accessed in a dynamic component's Expression Editor and in the rule set condition builder.

They can also be used to pass information to service definitions, for example, to add parameters to the query used to call your Cloud Application service.

$objectContext

Parameters in the $objectContext can be used in the condition builder for business rules and validation messages.

Parameters can also be used when creating conditions in the advanced expression builder, and in expressions setting the default values in business rules.

For example, there might be some preferences defined by the app that could be useful when creating a condition in a rule set. When you create the condition, you can select the parameters in the $componentContext in the condition builder's Attributes dropdown list. As you can see in this image of the Attributes dropdown list, $componentContext is prepended before the parameter names.



You can see the list of valid $componentContext parameters in the Parameters tab in the Properties panes of a rule set:



The Parameters tab shows the name and type of each parameter. To see a parameter's description and the valid values, move your cursor over the tooltip icon which is displayed when you hover over the parameter name.

Note:

If you enter an invalid parameter value in the Expression editor or condition builder, a warning will be displayed in the layout's JSON file. To write efficient expressions that handle situations where a referenced field might not be available or the field's value could be null, see How To Write Expressions If a Referenced Field Might Not Be Available Or Its Value Could Be Null.

If you don't see any parameters in the Parameters tab, this means that the Unified Application has not defined any $componentContext parameters for the component:



The $baseComponentContext parameters are listed in the Parameters pane of a Layout's Fields tab when no field is selected:



When creating conditions for business rules, you can select $objectContext parameters in the condition builder's criteria dropdown list. As you can see in this image, the parameters are grouped under Object Context in the dropdown list:



The $objectContext parameters and their properties are listed in the Context tab: