--- title: "Original entity" slug: "core-original-entity-resolver" updated: 2026-04-23T13:32:42Z published: 2026-04-23T13:32:42Z canonical: "docs.lobstersoftware.com/core-original-entity-resolver" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Original entity *See also:* [Value changed](/v1/docs/en/core-has-changed-matcher) (Compare type) > [!NOTE] > **Value resolver – Abstract** > > **Purpose:** Returns the server-side (persisted) data state of the entity in the input value, if it exists. > > > [!TIP] > > Tooltip > > > > - **Usage**: The value resolver returns the server-side data state of an entity present as an *input* *value*, if it exists. This *original entity* can be used, for example, for comparisons with a deviating volatile entity state. > > - **NOTE:** > > - If the *input value* is not entity data, the *input value* is returned. > > - If the entity in the *input value* does not exist because it has not been saved yet, then the return value is `$null`. > > - **WARNING:** Although the [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver can be selected in a [Client Workflow](/v1/docs/en/frebehav-client-workflow), it is effectively useless because it always returns only the volatile state of the entity in the *input value* and not the "original" value that is only available on the server side. ![images/download/attachments/78256067/image2022-8-30_17-1-35-version-1-modificationdate-1661871695159-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-8-30_17-1-35-version-1-modificationdate-1661871695159-api-v2.png) The [Original entity](/v1/docs/en/core-original-entity-resolver) resolver returns the server-side (persisted) data state of the entity in the *input value*, if it exists. - If the *input value* is data of an entity according to its type, but the entity is not yet created, then "no value" (`$null`) is returned. - If the *input value* is not an entity according to its type, then the *input value* is returned. Access to the *original entity* enables matching between server-stored data of an entity and a volatile, "edited" state. **NOTE:** In principle, the [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver can also be used for "non independent" entities such as attributes. However, in practice it is usually more useful to compare attributes starting from the *attribute owner* (and its *original entity*). This is demonstrated by the second example below ("More complex use case:"). **WARNING:** Although the [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver can be selected in a [Client Workflow](/v1/docs/en/frebehav-client-workflow), it is effectively useless because it always returns only the volatile state of the entity in the *input value* and not the "original" value that is only available on the server side. > [!NOTE] > **IMPORTANT:** Effect of lazy loading on entity and original object. > > --- > > In general, the *lazy loading* principle applies in the server context (e.g. when processing [Association criteria](/v1/docs/en/core-association-criteria) or [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration)) for data that has a (1:n) relationship to an entity and is therefore handled in the entity"s data object via list fields. > > What is *lazy loading*? > > - Regardless of whether an entity is present as an *input value* or is included in the execution context through an [Input object (type safe)](/v1/docs/en/core-root-entity-resolver) resolver, the existing inventory for data stored in list fields will only be retrieved from the **Lobster Data Platform/Orchestration** database if needed. > - Changes to the "list data" of an entity that are caused outside the given execution context and persisted before the lazily executed retrieval may potentially be applied "retroactively" to the execution context. > - The data state in the execution context may therefore contain combinations of header and detail data that have never been or will never be persisted in the database in this form. > - In this context, a "need" refers to any access to the respective list field for the entity or the associated [Original entity](/v1/docs/en/core-original-entity-resolver), provided that the data has not already been retrieved. > - The data retrieval basically concerns all entries of the list. > - Retrieved list data always applies to both the entity and the [Original entity](/v1/docs/en/core-original-entity-resolver) immediately after retrieval. > - The following specific examples illustrate the principle: > - A read access to the number of entries in the list of all attributes (`attributes.length`) of the entity leads to the retrieval of all attributes of the entity from the database, if they are not already present in the execution context. > - Any direct or indirect access to line item list field entries – e.g. via [Modify list](/v1/docs/en/core-modify-collection-actor) event action, the [List item](/v1/docs/en/core-list-item-resolver) value resolver, or the [Direct line items](/v1/docs/en/base-get-line-items-resolver) value resolver – triggers retrieval of the entity’s entire line item hierarchy. > > **NOTE:** When retrieving line items for an entity, its attributes (`attributes`) are automatically "supplied" as an exception. Therefore, no *lazy loading* takes place at this level. > > What does *lazy loading* mean for the [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver? > > - For "list data" (e.g. attributes or line items) of an entity, the [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver returns the data state that the database provided via *lazy loading* at the time of the first demand in the execution context. > - If the "list" in question has not been loaded before in the execution context, a list access for the [Original entity](/v1/docs/en/core-original-entity-resolver) may also trigger joint *lazy loading* for the entity’s list and the [Original entity](/v1/docs/en/core-original-entity-resolver). > - As long as list data is not modified during execution, a read access to list data for the [Original entity](/v1/docs/en/core-original-entity-resolver) always returns the same data as a direct access to the entity"s data in the execution context cache. > > --- > > **CAUTION****:** Under certain circumstances, the [Original entity](/v1/docs/en/core-original-entity-resolver) for *lazy* loaded list data does not necessarily reflect the database state that existed when the execution was started or the entity was added to the execution context as an [Input object (type safe)](/v1/docs/en/core-root-entity-resolver), but possibly a different state stored outside the execution context at the time of *lazy loading.* > > The following specific runtime scenario illustrates the relationship: > > 1. Event handling (see [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration)) "fetches" an entity of the "Order" type (see [Orders](/v1/docs/en/ord-order)) from an ID (`id`) given as a `Long` value via the [Input object (type safe)](/v1/docs/en/core-root-entity-resolver) value resolver into the execution context. > 2. Immediately afterwards, a [User callback](/v1/docs/en/core-user-callback-actor) event action requests a yes/no decision from the user to execute an optional process step (*here*: step 4). > 3. While the user is still considering, another user changes an attribute of the order in question via an input form – e.g. by setting the value of a user-defined indicator attribute (see [Flag type](/v1/docs/en/base-flag-types)) "Priority" – and saves the order. > 4. In the process step requiring approval, some indicator attributes of the purchase order (including the "Priority" indicator) must be evaluated in the context of a case differentiation per [If then else](/v1/docs/en/core-if-then-else-actor) event action. > 1. The first read access to any attribute retrieves all attributes of the order from the database. > 2. In this example, the "Priority" flag is considered to be set, even if it would have been "not set" (or not present) at the start of event handling. > 3. If other attributes were changed in the "foreign" session, these are also "attributed" to the entity *on-the-fly* in the execution context. > > **NOTE:** > > - If the evaluation logic checks whether the value of the "Priority" indicator has been changed compared to the [Original entity](/v1/docs/en/core-original-entity-resolver) via an [Entity property rule](/v1/docs/en/core-entity-property-rule), this will not display any changes in the scenario described. The data status for the attributes retrieved after the [User callback](/v1/docs/en/core-user-callback-actor) is mapped directly after the retrieval to the order and the associated [Original entity](/v1/docs/en/core-original-entity-resolver), so that only subsequent changes to this status are detected for attributes. > - If, on the other hand, a read access to any attribute of the order or even number of attributes (`attributes.length`) would be executed at the beginning of the event handling, the retrieval of the attribute data from the database already takes place at this time. Then the "priority" flag for order and [Original entity](/v1/docs/en/core-original-entity-resolver) is considered "not set" (or not present) and a change in a "foreign" session (see step 3) is not considered in the execution context because the attributes of an entity are retrieved only once. > - Saving the order within the event handling (e.g. [Save changes later](/v1/docs/en/core-merge-later-once-actor)) becomes impossible in any case due to the write conflict with the update persisted in step 3. ## Configuration The value resolver expects an entity as *input value* and does not use any parameters. ## Examples ### Simple use case: Check a specific value change for a field An association criterion (see [Association criteria](/v1/docs/en/core-association-criteria)) determines whether the volatile data in the context of a shipment (see [Shipments](/v1/docs/en/shp-shipment)) contains a lower "Number of packages" (`numberOfPackages`) for this entity than the number (last) stored on the server. Configuration: | The association criteria first determines whether the data context provides a shipment as an *input* *value* via [Check type](/v1/docs/en/core-check-type-rule). If this is the case, the AND conjunction [Entity property rule](/v1/docs/en/core-entity-property-rule) is evaluated: - On the left side of the comparison (see [Compare with (Form designer)](/v1/docs/en/frebehav-compare-with)) the value for the "Number of packages" (`numberOfPackages`) field is read in the volatile data of the shipment. - On the right side, the server-side state of the shipment is first obtained via the [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver. The "Number of packages" (`numberOfPackages`) field is then accessed via concatenation (as on the left). The "< (smaller)" comparison causes "Rule passed" to apply to the association criteria as a whole if the "Number of packages" for the volatile state of the shipment is less than stored on the server side. | ![images/download/attachments/78256067/image2022-8-30_17-3-50-version-1-modificationdate-1661871830889-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-8-30_17-3-50-version-1-modificationdate-1661871830889-api-v2.png) | | --- | --- | **NOTE:** The evaluation of this association criteria only makes sense in a context in which a volatile state of the respective shipment can exist. It could be evaluated e.g. as a [Sub criterion rule](/v1/docs/en/core-association-sub-criteria-rule) in the validating rule of an event handling which reacts to the "Update" event (see [Common action event](/v1/docs/en/core-common-action-event)) and contains actions which are only relevant if the "Number of packages" of a shipment was reduced in the course of an update of the shipment data triggered via the interface or interactively. ### More complex use case: Checking whether (singular) reference attributes differ An association criterion (see [Association criteria](/v1/docs/en/core-association-criteria)) is intended to determine in the context of a shipment (see [Shipments](/v1/docs/en/shp-shipment)) whether the reference values specified in reference attributes have changed from the server-side state. Configuration: The task requires pairwise checking of reference values in reference attributes with the same [Reference type](/v1/docs/en/base-reference-type) between the volatile data state and the associated *original entity* representing the server-side state. For convenience purposes, the following configuration makes the following simplifying assumptions: - All reference attributes used in the context of [Shipments](/v1/docs/en/shp-shipment) are defined as non-plural (="singular") in the [Reference type](/v1/docs/en/base-reference-type). For each [Reference type](/v1/docs/en/base-reference-type) there is exactly one or no reference attribute in the shipment data. - In the volatile state of the shipment, no reference attributes have been removed compared to the server-side state, so that every [Reference type](/v1/docs/en/base-reference-type) represented by a reference attribute on the server side is also present in the volatile state (with an empty reference value, if applicable). Under these conditions, the criterion in the sense of the task can be formulated as follows: The rule in the association criteria is passed if the volatile state of the shipment contains at least one reference attribute whose value differs from the value of the reference attribute corresponding to the [Reference type](/v1/docs/en/base-reference-type) in the state stored on the server side. The following configuration implements this logic: | - The [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver stores a reference to the volatile state of the shipment in the `shipment` variable so that it can be accessed within the criterion in the [Rule list resolver](/v1/docs/en/core-list-rule-resolver) below. - The concatenated [All attributes of one type](/v1/docs/en/core-attributes-resolver) value resolver provides the list of all reference attributes in the volatile shipment data, i.e. the basis for pairwise matching of reference values. - The concatenated [Rule list resolver](/v1/docs/en/core-list-rule-resolver) uses an [Entity property rule](/v1/docs/en/core-entity-property-rule), for pairwise matching of reference values: - On the left side of the comparison, a [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver is first used to store a reference to the currently relevant reference attribute in the `attribute` variable. This is needed so that the "inner" [Rule list resolver](/v1/docs/en/core-list-rule-resolver), which determines the comparison value on the right side, can refer to the [Reference type](/v1/docs/en/base-reference-type) of this attribute. The "reference" (`reference`) field of this attribute is then accessed, providing the "volatile" level for the reference value to be checked. - On the right side, the `shipment` variable is accessed at the beginning so that the concatenated [Original entity](/v1/docs/en/core-original-entity-resolver) value resolver can obtain the *original entity*, i.e. the server-side state of the shipment. - Below, an [All attributes of one type](/v1/docs/en/core-attributes-resolver) first resolves all reference attributes in the server-side state of the shipment. - The concatenated [Rule list resolver](/v1/docs/en/core-list-rule-resolver) returns the reference attribute from this list that "matches" the left page and corresponds to the [Reference type](/v1/docs/en/base-reference-type) (if available). Details about this are shown below. - The concatenated [Object property](/v1/docs/en/core-property-resolver) value resolver accesses the "reference" (`reference`) field in the reference attribute assigned for pairwise comparison from the *original entity*. - The negated [Equals](/v1/docs/en/core-equals-matcher) matcher in the [Rule list resolver](/v1/docs/en/core-list-rule-resolver), in conjunction with the unchecked **Resolve all as list** option, defines that the search returns the first match "with any difference" or "no value" (if no differences were found). - The negated [Is empty](/v1/docs/en/core-is-empty-matcher) matcher of the outer [Entity property rule](/v1/docs/en/core-entity-property-rule) defines that the rule is considered passed if the [Rule list resolver](/v1/docs/en/core-list-rule-resolver) found any difference in the reference values during pairwise matching. | ![images/download/attachments/78256067/image2022-8-30_17-5-38-version-1-modificationdate-1661871938345-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-8-30_17-5-38-version-1-modificationdate-1661871938345-api-v2.png) | | --- | --- | | The image on the right shows the right side from the [Entity property rule](/v1/docs/en/core-entity-property-rule) in the outer [Rule list resolver](/v1/docs/en/core-list-rule-resolver) from the previous view. Here, the configuration for the inner [Rule list resolver](/v1/docs/en/core-list-rule-resolver) is expanded to reveal details of the contained [Entity property rule](/v1/docs/en/core-entity-property-rule): - On the left side of the [Entity property rule](/v1/docs/en/core-entity-property-rule), the "Type" (`referenceType`) field is accessed, which specifies the [Reference type](/v1/docs/en/base-reference-type) of the server-side reference attribute to be matched with the [Reference type](/v1/docs/en/base-reference-type) from the outer [Rule list resolver](/v1/docs/en/core-list-rule-resolver). - On the right side of the [Entity property rule](/v1/docs/en/core-entity-property-rule), the `attribute` variable is used to access the "current" reference attribute in the outer [Rule list resolver](/v1/docs/en/core-list-rule-resolver) and – via concatenation – its "Type" field. - Since the **Resolve all as list** option is unchecked, the [Rule list resolver](/v1/docs/en/core-list-rule-resolver) returns the first match for a server-side reference attribute whose [Reference type](/v1/docs/en/base-reference-type) matches the type of the reference attribute referenced in the `attribute` variable from the volatile shipment data – if this [Reference type](/v1/docs/en/base-reference-type) is already known on the server side. **NOTE:** Provided that shipments can use at least one *plural* [Reference type](/v1/docs/en/base-reference-type) , this has the potential to significantly complicate the matching process. In the context of an AND conjunction, in addition to the "Type", the "Index" field could also be matched, which defines the ranking of the attribute instances for *plural* reference attributes. However, it may not be appropriate for a pairwise comparison to include an index position. The reference values for a *plural* reference attribute may have to be matched without regard to the order of the attribute instances.. This would require a special evaluation for each relevant *plural* reference attribute. Its instances would then have to be excluded from the pairwise comparison via additional [Rule list resolver](/v1/docs/en/core-list-rule-resolver) (for the return value of the [All attributes of one type](/v1/docs/en/core-attributes-resolver) resolver), for example by requiring that the `index` field be empty. | ![images/download/attachments/78256067/image2022-8-30_17-7-4-version-1-modificationdate-1661872024315-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-8-30_17-7-4-version-1-modificationdate-1661872024315-api-v2.png) |