Table of Contents

Context on Methods

The Ometa Framework fetches data from various sources to enrich the method execution context. This way, a lot of data is automatically set on the method:

  • Request context like originating url, ip, referer, user-agent, ... (if the request is passing through our REST service)
  • Identity information like email, claims, ... (if the request is authenticated)
  • Case context like current state, roles, properties, ... (if the request originates from a known case)
  • Context fields specified in the object configuration.
  • Page Context from context managers, url parameters, ...
  • Form context such as a create view, ...

All this context data together with the values explicitly set by the user/request or the method itself (defaults) can be used in a variety of places:

  • Interface script
  • Validation scripts
  • Conversion scripts
  • Custom code in DLL's

Behavior of Output Fields

If an output field don't get its data set by the interface or through a data extension, it will inherit the context data or the default value if no context was found. If an output field inherits data from an input field with a configured conversion script, that script is ignored.

The following examples show you how an output field named 'Company' behaves in different scenario's.

Input Context Script Output Field Result
None SELECT '1' AS ID Company = 'Default value'
Company = 'Ometa' SELECT '1' AS ID Company = 'Ometa'
Company = 'Ometa' SELECT '1' AS ID, 'Silmar' AS Name Company = 'Ometa'
Company = 'Ometa' SELECT '1' AS ID, 'Silmar' AS Company Company = 'Silmar'
Company = 'Ometa' SELECT '1' AS ID, '{$Company}' AS Company Company = 'Ometa'
Company = 'Ometa'
Converted value = 'Converted Ometa'
SELECT '1' AS ID Company = 'Ometa'
Company = 'Ometa'
Converted value = 'Converted Ometa'
SELECT '1' AS ID, 'Silmar' AS Name Company = 'Ometa'
Company = 'Ometa'
Converted value = 'Converted Ometa'
SELECT '1' AS ID, 'Silmar' AS Company Company = 'Silmar'
Company = 'Ometa'
Converted value = 'Converted Ometa'
SELECT '1' AS ID, '{$Company}' AS Company Company = 'Converted Ometa'
Note

Default value means the output field will contain the configured default input value of the field. If the field is not defined, the default value will be an empty string, 0 for numbers, false for Yes/No, ...

Collection Values

Some fields are able to hold a collection of values. Most of the time, these are auto generated fields like identity.emails, identity.groups, case.roles, ...

You can safely use these collection fields in condition sets. Each value in the collection will be interpreted by the condition.

However if you use this field in places where collections are not supported out of the box (e.g.: interface scripts, conversion scripts, validation scripts, custom dll code, ...), only the last value of the collection will be present in that field.

A solution for this issue is to add the name of that collection field in the configuration table under the key Allowed Collection Fieldnames To Csv. If you do this, a new field with the same name suffixed by .csv will be created with all the collection values separated by a comma. See Configuration Table for more information.

Context Prioritization

When the same context is passed onto the framework multiple times, the framework has to prioritize one value to use and pass along to conversion scripts, interface scripts and such.

In short, it will follow this order:

  • Static Context Field Configuration: context configured on the method settings in the configuration.
  • Case Property (if force system context): value from the case.
  • Form context: values entered or selected in the current form.
  • Configured View Context: view context configured in advanced tab.
  • Page Context: context from context managers and then url parameters.
  • Case Property: value from the case.
  • Field default value: default value of the method input field.

See the table below for a full reference:

Case Property Static Configuration Context Configured View Context Field Default Value Force System Context Page Context Form Context Prioritzed Context Source
Static Configuration Context
Static Configuration Context
{$case.properties.field} Case Property
{$case.properties.field} Case Property
{$case.properties.field} Empty (from Case Property)
Case Property
{$Field} Form Context
Form Context
Case Property
Configured View Context
{$case.properties.field} Case Property
Case Property
Page Context
Field Default Value
Empty