Remote Operation Default Value Precedence

Understand runtime precedence of default values during remote operation execution. Set default values in SAP Mobile WorkSpace, from Properties view > Input > Default Values for a given operation.

  • Structure/complex operation arguments – if the parent's structure value is empty and not mapped to MBO attributes, the parent's default value is used and all child default values are ignored. If a child element of a parent default value is empty and not mapped to MBO attributes, the child’s default value or personalization key value is used.
  • Structure/complex load arguments – where the parent's structure default value is not empty and at least one child element has a default value, if the parent's structure value is empty, the parent's default value is used. If the default value of the parent's sub-element is null, the corresponding child's default value is used.
    The parent's default value is ignored and the child's default is used in cases where the child element's value is empty.
    Note: Map structure load arguments to personalization keys of the same structure type.
  • Non-nullable operation arguments – where a simple datatype or a simple datatype contained in a structure type and mapped to an attribute or a client parameter, if the client does not set any value to server, the real processed value is the default value of the type, for example: empty string for string type, 0 for int type.

Default value precedence examples

The default value precedence can be summed up as:
  1. Within a complex input argument, the first node found with a default value is applied.
  2. If MBO attributes are bound into a node of a complex input argument, any default values defined for the node are ignored.
This example focuses on the “items” input argument:
  • If a default value is defined for “items” it is used to invoke the remote operation.
  • If no default value is defined for “items” and a default value for “item” is defined, then the “item” default value is used.
  • If a default value for both “items” and “item” is defined, the default value for “items” is used:

default value precedence 1
The “item” input argument is mapped to the “Item” MBO:
  • If the modeler defines a default value for “items” or “item” the default value is ignored if the modeler has mapped the input argument node "item" to MBO attributes.
  • If the client does send “Item” MBO data, but some attributes are empty or not mapped (for example “item.discount”), then a defined attribute level default is used .
  • If a default value has been defined for “itemNotes” or “itemNote” and the client does send “Item” MBO data, then the default value for “itemNotes” or “itemNote” is used:

default value precedence 2
The “item” input argument is mapped to the “Item” MBO and the “itemNote” subnode is mapped to the “ItemNote” MBO:
  • If the modeler has defined default values for “itemNotes” or “itemNote” the default values are ignored :

input mapping subnode

Personalization key example

Personalization keys behave similarly to default values.

In this example the “item” input argument is mapped to the “Item” MBO, and the “itemNote” subnode is mapped to a personalization key:
  • If the client sends “Item” data and has set a value for “PersonalizationKey1” then the values for “PersonalizationKey1” are used for “ItemNote”.
    Note: If a default value for “itemNotes” is defined then the default value takes precedence over the personalization key and will be used even if the personalization key contains data.
  • If a default value for “itemNote” is defined and “PersonalizationKey1” is empty then the default value on “itemNote” will be used.

personalization key default value