--- title: "With rule" slug: "core-with-rule" updated: 2026-04-02T13:19:11Z published: 2026-04-02T13:19:11Z canonical: "docs.lobstersoftware.com/core-with-rule" --- > ## 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. # With rule *See also:* [Execute with](/v1/docs/en/core-with-actor) (Event action) > [!NOTE] > Rule type – Abstract > > **Purpose:** Is considered 'passed' if the rule configured within is considered 'passed' for the *alternative reference object* defined via a value resolver. > > > [!TIP] > > Tooltip > > > > - **Usage:** The [With rule](/v1/docs/en/core-with-rule) evaluates a somewhat complex *inner rule configuration* with an *alternative reference object*, which is defined via the **Entity property resolver** (value resolver). If the *inner rule configuration* also requires access to the *previous reference object*, this must be made available by specifying a variable name in the **Original entity name** parameter. > > - **Parameter:** > > - **Entity property resolver**: *Optional* value resolver for the *alternative reference object*; if no value is resolved here, the *previous reference object* also applies to the rule configured within it. > > - **Original Name**: *Optional* static text value that names a variable that refers to the *previous* *reference object* within the *inner rule configuration*. > > - *inner rule configuration*, which defines the check logic for the *alternative reference object.* > > - **NOTE:** If no *inner rule configuration* is defined, the [With rule](/v1/docs/en/core-with-rule) is considered as 'failed'. ![images/download/attachments/201665234/image-2025-3-26_15-14-52-version-1-modificationdate-1742998491951-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-26_15-14-52-version-1-modificationdate-1742998491951-api-v2.png) A [With rule](/v1/docs/en/core-with-rule) allows the temporary change of the *reference object* within a rule definition in order to evaluate one or more rules with an *alternative reference object*. **NOTE:** The use of the [With rule](/v1/docs/en/core-with-rule) within a rule definition is similar to that of an [Execute with](/v1/docs/en/core-with-actor) event action within an event action. The *alternative reference object* is defined at runtime via the [Resolvers](/v1/docs/en/core-i-value-resolver) in the **Entity property resolver** parameter. The name of the parameter refers to a typical use of the [With rule](/v1/docs/en/core-with-rule), namely accessing a field of the *previous reference object* via an [Object property](/v1/docs/en/core-property-resolver) value resolver. However, any other value resolver can be used instead to define the *alternative reference object* with which to evaluate within the rules configured using the [With rule](/v1/docs/en/core-with-rule). If rules within the [With rule](/v1/docs/en/core-with-rule) are to include the *previous reference object* in addition to the *alternative reference objec*t, the **Original entity name** parameter must be used. This names a variable via which rules can access the *previous reference* *object* within the [With rule](/v1/docs/en/core-with-rule). **NOTE:** The [With rule](/v1/docs/en/core-with-rule) can be used in cascade to override the *alternative reference object* in stages. In each stage of a cascade, there is access to the *reference objects* of the parent stages, provided that different variable names are used in the **Original entity name** parameter. ## Configuration | The *optional* **Entity property resolver** parameter defines a value resolver for the *alternative reference object*. At runtime, this determines the value of the `entity` variable in the context of the rules configured within [With rule](/v1/docs/en/core-with-rule). - If no value resolver is configured (default), then the *previous reference object* also applies to the rules configured within the [With rule](/v1/docs/en/core-with-rule). The *optional* **Original entity name** parameter specifies the name of a variable to which the *previous reference object* is (temporarily) assigned as a value for the context of the rules configured within the [With rule](/v1/docs/en/core-with-rule) . - If no variable name is specified, then the rules configured within the [With rule](/v1/docs/en/core-with-rule) cannot access the *previous reference object*. The ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/add(41).svg) symbol can be used to add configurations for rules within the [With rule](/v1/docs/en/core-with-rule), the evaluation of which at runtime determines whether the [With rule](/v1/docs/en/core-with-rule) as a whole is considered to have 'passed' or 'failed'. - If no rule is added here, then the [With rule](/v1/docs/en/core-with-rule) is considered 'failed' by definition. **NOTE:** Here the logic of the [With rule](/v1/docs/en/core-with-rule) differs from other similar contexts. For [Association criteria](/v1/docs/en/core-association-criteria) or the **Validating rule** in [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration), in the absence of a rule configuration, the rule is considered to have 'passed'. | ![images/download/attachments/201665234/image-2025-3-26_15-13-59-version-1-modificationdate-1742998438906-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-26_15-13-59-version-1-modificationdate-1742998438906-api-v2.png) | | --- | --- | ## Example The objective in this example is to evaluate within an association criterion, whether the country code (see [Country](/v1/docs/en/core-country)) of a company account address belongs to a set of 'zones' across several countries. Mappings from country codes to zones are defined by other association criteria, which should be referred to as [Sub criterion rule](/v1/docs/en/core-association-sub-criteria-rule). Each sub criterion runs a [Check type](/v1/docs/en/core-check-type-rule) for an entity type 'Address' (see [Addresses](/v1/docs/en/base-address)) and matches the contained country code (`countryCode`) against a specific whitelist. In the specific case, the company address is to be matched with the sub-criteria for the zones 'APAC' (Asia/Pacific) and 'LATAM' (Latin America), that check the `countryCode` property against a *static* white list of [Country](/v1/docs/en/core-country) values generate by a [Create list](/v1/docs/en/core-create-list-resolver) resolver. Configuration ![images/download/attachments/201665234/image-2025-3-26_15-10-30-version-1-modificationdate-1742998229069-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-26_15-10-30-version-1-modificationdate-1742998229069-api-v2.png) The original *reference* *object* (above the [With rule](/v1/docs/en/core-with-rule)) should be a [Company value](/v1/docs/en/base-company-account-value) (not shown in the screenshot), which could be resolved e.g. as [Company of session](/v1/docs/en/base-session-company-account-value) or from a company attribute of a business object (see [Business objects and attributes](/v1/docs/en/orchestration-btos-attributes)). - In this case, the [Object property](/v1/docs/en/core-property-resolver) value resolver in the [With rule](/v1/docs/en/core-with-rule) refers to the address (in the `address` field) of the *previous* *reference object* (company) as an *alternative reference object*, since every single [Sub criterion rule](/v1/docs/en/core-association-sub-criteria-rule) expects the entity type 'address' as a *reference object*. - The initial *reference object* (company) is assigned to the variable `company` via **Original entity name**. In the example, the existing rules within the [With rule](/v1/docs/en/core-with-rule) do not access this variable. However, additional rules could be added that require this access.