--- title: "Create instance" slug: "core-create-instance-resolver" updated: 2026-04-23T08:50:06Z published: 2026-04-23T08:50:06Z canonical: "docs.lobstersoftware.com/core-create-instance-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. # Create instance > [!NOTE] > **Value resolver – Abstract** > > **Purpose:** Creates a new instance, i.e. a "volatile" data object, for the specific **Type** statically selected in the configuration. > > > [!TIP] > > Tooltip > > > > - **Usage**: The [Create instance](/v1/docs/en/core-create-instance-resolver) value resolver is needed whenever a required data object does not yet exist in a context and cannot be implicitly created by other functionality (e.g. a [List item](/v1/docs/en/core-list-item-resolver) value resolver). If the return value is not `$null`, the value resolver returns a volatile data object for the type specified statically in the configuration. > > - **Parameter**: The single **Type** parameter defines the class to be instanced as a static selection. Classes can be searched and selected or entered as free text. > > - **NOTE:** The return value is `$null` if no **Type** is specified or the specified **Type** is non-specific (e.g. "entity") or unknown in **Lobster Data Platform/Orchestration**. > > - **WARNING:** If a class for static or dynamic enumeration values is selected as **Type**, an error (`Failed to create Instance`) occurs at runtime. *See also:* [Create instance with values](/v1/docs/en/core-create-instance-with-values-resolver)*,* [Copy instance](/v1/docs/en/core-copy-instance-resolver) ![images/download/attachments/201680268/image-2025-3-17_7-30-20-version-1-modificationdate-1748321480292-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_7-30-20-version-1-modificationdate-1748321480292-api-v2.png) The [Create instance](/v1/docs/en/core-create-instance-resolver) value resolver creates a new instance, i.e. a "volatile" data object, for the specific **Type** statically selected in the configuration. The *input value* is ignored. If the creation of the data object is successful, it will be returned. If the creation fails, "no value" (`$null`) is returned in the following cases: - No **Type** was specified. - The selected **Type** is *non-specific*, e.g. the overarching class for all entities: "Entity". (`de.lobster.scm.entity.Entity`). - The selected **Type** is not known in the context of the **Lobster Data Platform/Orchestration** installation, because it concerns a module that is not installed. - The selected **Type** is not known in the context of the **Lobster Data Platform/Orchestration** installation because an incorrect class name was entered as free text instead of a selection (e.g. `cutsom.myTypo` instead of `custom.myType`). **CAUTION****:** If a class for static or dynamic enumeration values (e.g. [Salutation](/v1/docs/en/base-salutation)/`de.lobster.scm.base.address.Salutation`) is selected as the **Type**, an error (`Failed to create Instance`) occurs at runtime. **NOTE:** - If a separate *entity type* is selected as the **Type**, then *creating* the instance for a new entity is equivalent to clicking "New" in an interactive context (see [Input forms](/v1/docs/en/base-entity-form) or [Custom overviews](/v1/docs/en/administration-designer-client-preferences-overview)) and not to *creating* it by clicking "Save". However, the "New" event (see [Common action event](/v1/docs/en/core-common-action-event)) is not triggered. - In [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration), a *volatile entity* can be marked for saving when the transaction is completed using the [Execute with](/v1/docs/en/core-with-actor) and [Save changes later](/v1/docs/en/core-merge-later-once-actor) event actions. If required, the [Fill primary key](/v1/docs/en/core-fill-primary-key-actor) event action can also be executed in advance to obtain an ID for the entity from the server. - A [Client Workflow](/v1/docs/en/frebehav-client-workflow) can create a *volatile entity*, e.g. to assign its data to a form element or embedded form via [Populate element data](/v1/docs/en/freaction-populate-data). Even then, the *volatile entity* is persisted only if it is explicitly saved afterwards. ## Configuration ![images/download/attachments/201680268/image-2025-3-17_7-31-36-version-1-modificationdate-1748321480290-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_7-31-36-version-1-modificationdate-1748321480290-api-v2.png) For the single **Type** parameter, a selection field allows a static single selection for the class to be instantiated. As can be seen in the screenshot, the search function takes into account the internal name in addition to the applicable localization for the language of the session, if any. Upper and lower case letters are ignored. The [**+**] symbol indicates that class names not selectable in the dropdown can also be entered as free text. ## Examples ### Create and initialize a data object of the "Date range with time" type Within an event handling, a variable (`enroute`) specifies the expected transport time of a shipment as "Date range with time" in the time zone that is selected as "Default time zone" (`defaultTimeZone`) in the ordering party"s company account. The estimated transport time is given by two variables, which define the estimated time of departure (`ETD`) and the estimated time of arrival (`ETA`) of the transport as "Date with time" (with any time zone). Since a "Date range with time" is not a simple value, but a "complex" data object with several fields ("Time zone"/`timeZone`, "From"/`start` and "To"/`end`), an instance must be created as a target for the necessary value assignments. The `enroute` variable is primarily intended to enable further calculations within the transaction. However, its value could also be assigned as a value to a date attribute of the shipment (e.g. "Estimated transport time"/`ENROUTE_ESTIMATE`). Configuration: | As all three fields of the "Date range with time" are to receive assignments, the [Set values](/v1/docs/en/core-set-values-actor) event action is used as shown on the right to use the created instance as the *Target host* for all assignments. - In the *value configuration* for the **Target host** of the [Set value](/v1/docs/en/core-set-value-actor) event action, the [Create instance](/v1/docs/en/core-create-instance-resolver) value resolver is used to instantiate the type "Date range with time" (`DateRange`). - The directly concatenated [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver stores a *reference* to the created instance in the `enroute` variable. The variable therefore only refers to the new data object and does not preserve its current state as a snapshot. The reference in the variable enables access to the created instance beyond the context of the value assignments within the [Set values](/v1/docs/en/core-set-values-actor) event action. - Three assignments are configured within the [Set values](/v1/docs/en/core-set-values-actor) event action, which affect fields in the data model of the generated `DateRange` instance as **Target values**: - For the assignment to the "Time zone" (`timeZone`) field, the company account of the client (here in the `principalCompany` [Variable](/v1/docs/en/core-storage-value)) is accessed, in which a time zone should be specified in the "Default time zone" (`defaultTimeZone`) field. The field provides the time zone identifier as text (e.g. `Europe/London` or `UTC`), which is automatically converted into a `TimeZone` value in the context of the assignment. **NOTE:** By default, the specification of a "Default time zone" in the company account is optional. It may be advisable to link the [Object property](/v1/docs/en/core-property-resolver) value resolver with a [Default value](/v1/docs/en/core-default-value-resolver) resolver that specifies the `UTC` time zone via static text, for example, in the event that the company account does not contain any information. - By definition, the assignments to the "From" (`start`) and "To" (`end`) fields refer to milliseconds since 1 January 1970 (`UTC`), so that the corresponding values can be taken directly from the "Date value" (`dateValue`) field of the respective variable of the "Date with time" (`ETD`/`ETA`) type. However, the "time zone" (`timeZone`) specified in these variables is irrelevant for the assignment. | ![images/download/attachments/201680268/image-2025-3-17_7-33-47-version-1-modificationdate-1748321480287-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_7-33-47-version-1-modificationdate-1748321480287-api-v2.png) | | --- | --- | ### Create a "Set" type and fill it with values Administrators should be able to run an automated "health check" for [Users](/v1/docs/en/base-user) accounts under their responsibility, which checks a catalog of criteria for these [Users](/v1/docs/en/base-user) and, if necessary, points out a qualitative "action required" in the management of the accounts. Each "action required" is identified by a key text. Each key text should only be listed once in the message. References to the affected accounts are not part of the requirement. Runtime example: ![images/download/attachments/201680268/image-2025-3-14_12-54-34-version-1-modificationdate-1748321480311-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-14_12-54-34-version-1-modificationdate-1748321480311-api-v2.png) Configuration: | An event handling, which can be triggered via a [Custom action event](/v1/docs/en/core-custom-action-events) (`HEALTH_CHECK`) starting from the ribbon in the overview for [Users](/v1/docs/en/base-user), is configured as shown on the right: - A [Search (Event action)](/v1/docs/en/core-search-actor) first determines all [Users](/v1/docs/en/base-user) relevant for the check and provides them as a list in a `users` variable. - The following [Execute with](/v1/docs/en/core-with-actor) event action defines a new instance of the "Set" (`java.util.Set`) type as the *reference object* for the action part via the **Object** **Resolver** parameter. - In the action block, a [For each loop](/v1/docs/en/core-for-each-entity-actor) event action is executed that iterates over the [Users](/v1/docs/en/base-user) accounts in the `users` variable and checks a number of criteria. If an "action required" is detected, the associated text key is added to the "Set" **Type** if it does not already occur among the existing entries. **NOTE:** The "Set" type automatically monitors the uniqueness of the contained entries. As shown below, the possibly redundant text keys can simply be passed via a [Modify list](/v1/docs/en/core-modify-collection-actor) a to the list for which the variable name `issueTypes` was set in the context of the loop. - After all [Users](/v1/docs/en/base-user) accounts have been checked, the [Show alert (Popup)](/v1/docs/en/core-popup-actor) event action will output the detected "issues" as a string representation of the "Set" type. The **Message** parameter refers to the *reference object*, i.e. the "Set" type, via an [Object property](/v1/docs/en/core-property-resolver) value resolver "without a field". | ![images/download/attachments/201680268/image-2025-3-17_7-40-9-version-1-modificationdate-1748321480285-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_7-40-9-version-1-modificationdate-1748321480285-api-v2.png) | | --- | --- | | ![images/download/attachments/201680268/image-2025-3-17_7-41-39-version-1-modificationdate-1748321480283-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_7-41-39-version-1-modificationdate-1748321480283-api-v2.png) | ### Create, initialize and save a new entity Within the company hierarchy, [Companies/Clients](/v1/docs/en/base-company-account) that relate to a specific [Company type](/v1/docs/en/base-company-type) (e.g. "logistics center") should be assigned to a specific "Group" (see [Company meta type](/v1/docs/en/base-company-meta-type)) depending on the selection for the "Country" (`address.countryCode`) address field. - For each [Country](/v1/docs/en/core-country) that appears for the first time in the address of a relevant company, a new "Group" – i.e. a company account with the [Company meta type](/v1/docs/en/base-company-meta-type) "Group" (`GROUP`) – will be opened automatically. - Each company should be linked to the "Group" that has been set up for the [Country](/v1/docs/en/core-country) specified in the address via an assignment in the "Parent companies" (`parentCompanies`) field. Configuration: | The screenshot on the right shows the configuration for event handling that reacts to the **Triggering events** "Change" and "Create" (see [Common action event](/v1/docs/en/core-common-action-event)). --- The **Validating rule** is an AND junction of a series of rules (including [Check type](/v1/docs/en/core-check-type-rule), [Company type rule](/v1/docs/en/base-company-type-rule), [Role rule](/v1/docs/en/base-role-rule)), which will not be discussed in detail here. These rules are intended to ensure that the actions defined below are only executed if there is "something to do" with regard to the group assignment for the changed or created company. --- The **Actions on passed rule** will also only be presented here in a broad overview, as the [Create instance](/v1/docs/en/core-create-instance-resolver) event action only affects an optional process step: - At the beginning, a [Search](/v1/docs/en/core-search) is carried out to identify the "Group" matching the [Country](/v1/docs/en/core-country) of the company. If this already exists, it is written to the `countryGroup` variable. - The following [If then else](/v1/docs/en/core-if-then-else-actor) event action checks whether there is a search result in the [Variable](/v1/docs/en/core-storage-value) `countryGroup`. If this is empty (see [Is empty](/v1/docs/en/core-is-empty-matcher)), an additional group must be created for the country. An [Execute with](/v1/docs/en/core-with-actor) event action summarizes all the necessary steps for this. These are described in detail below. The newly created group is written to the [Variable](/v1/docs/en/core-storage-value) `countryGroup`, which has not received a value from the search. - Finally, the "ID" of the group *found* or *created* (`countryGroup`) must be added to the list in the "Parent companies" (`parentCompanies`) field, if this is required. | ![images/download/attachments/201680268/image-2025-3-17_8-9-36-version-1-modificationdate-1748321480274-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_8-9-36-version-1-modificationdate-1748321480274-api-v2.png) | | --- | --- | | For the context of the [Execute with](/v1/docs/en/core-with-actor) shown on the right, the external *reference object* (the company account for the "logistics center") is written to the `newCompany` variable. In the **Object resolver**, the [Create instance](/v1/docs/en/core-create-instance-resolver) resolver with the **Type** "Company account" (`CompanyAccount`) is used, which defines the new "Group" as a *temporary reference object* for the following *action block*: - The [Save changes later](/v1/docs/en/core-merge-later-once-actor) event action causes the "Company account" instance that has just been created to be flagged for the "Group" to be saved at the end of the transaction. On the other hand, this action means that this instance is immediately assigned a unique "ID" (`id`) (see also [Fill primary key](/v1/docs/en/core-fill-primary-key-actor)). - The [Set values](/v1/docs/en/core-set-values-actor) event action fulfills different tasks: - In the *value configuration* for the **Target host**, a [Store value as variable](/v1/docs/en/core-store-value-resolver) resolver ensures that the company account for the new "Group" is written to the [Variable](/v1/docs/en/core-storage-value) `countryGroup`. Irrespective of this, it also serves as a **Target host** for all assignments without any special provisions, provided this takes a given *input value* into account. In this specific case, all assignments relate to fields in the group. - The **Source object** is read from the [Variable](/v1/docs/en/core-storage-value) `newCompany`, which acts as an interface to the *external reference object* – i.e. the company account for the "logistics center". - The "Metatype" (`metaType`) field is statically set to the [Company meta type](/v1/docs/en/base-company-meta-type) "Group" (`GROUP`). - The "Country" (`countryCode`) address field is transferred directly from the **Source host** to the **Target host**. - The "Matchcode" (`address.accMatchCode`) and "Name" (`addressName`) address fields are filled with a concatenated string, taking into account the [Country](/v1/docs/en/core-country) assignment in the **Source host**. | ![images/download/attachments/201680268/image-2025-3-17_8-11-15-version-1-modificationdate-1748321480270-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-17_8-11-15-version-1-modificationdate-1748321480270-api-v2.png) | | Runtime example: If a company account is created for the first time for a "logistics center" with reference to the [Country](/v1/docs/en/core-country) "Italy" (`IT`), the event handling creates a "group", i.e. a company account with the [Company meta type](/v1/docs/en/base-company-meta-type) "Group" (`GROUP`), the text `GROUP_IT` as the *Matchcode* and the (possibly temporary) name "NEW COUNTRY GROUP: IT". The account is automatically assigned to the "Logistics center" as the "Parent company". By convention, the *Matchcode* should enable the group created for a [Country](/v1/docs/en/core-country) to be recognized so that the automatically created "Group" can be renamed as required. |