Skip to main content

GetRtEntitiesByType@1

Node GetRtEntitiesByType@1 is used to extract runtime entities by type from the OctoMesh Asset Repository.

Adapter Prerequisites

Node Configuration

For fields path, targetPath, targetValueWriteMode, and targetValueKind, see Overview.

transformations:
- type: GetRtEntitiesByType@1
ckTypeId: Industry.Energy/Photovoltaic.Module # Type of the runtime entities
skip: 0 # Number of entities to skip
take: 10 # Number of entities to extract
fieldFilters: # Field filters to apply, multiple filters can be applied using the AND operator
- attributePath: manufacturer # attribute path to filter
operator: Equals # Value to filter
comparisonValue: "SunPower" # Comparison value (when using a direct value)
comparisonValuePath: $.manufacturer # Path to the comparison value in the payload (when using a path)
sortOrders: # Sort orders to apply to the results
- attributePath: manufacturer # attribute path to sort by
sortOrder: Ascending # Sort direction: Ascending or Descending
- attributePath: model
sortOrder: Descending

Operators

The following operators are available for filtering:

OperatorDescriptionSample
EqualsFilters entities where the field value is equal to the comparison value."comparisonValue": "SampleValue"
NotEqualsFilters entities where the field value is not equal to the comparison value."comparisonValue": "SampleValue"
LessThanFilters entities where the field value is less than the comparison value."comparisonValue": 10
LessEqualsThanFilters entities where the field value is less than or equal to the comparison value."comparisonValue": 10
GreaterThanFilters entities where the field value is greater than the comparison value."comparisonValue": 10
GreaterEqualsThanFilters entities where the field value is greater than or equal to the comparison value."comparisonValue": 10
InFilters entities where the field value is in the comparison value."comparisonValue": ["SampleValue1", "SampleValue2"]
NotInFilters entities where the field value is not in the comparison value."comparisonValue": ["SampleValue1", "SampleValue2"]
LikeFilters entities where the field value is like the comparison value."comparisonValue": "SampleValue"
MatchRegExFilters entities where the field value matches the regular expression."comparisonValue": "SampleValue.*"
AnyEqualsFilters entities where any of the field values of an array is equal to the comparison value."comparisonValue": "SampleValue"
MatchMatches documents that contain an array field with at least one element that matches all the specified query criteria."comparisonValue": [ { "attributeName": "sample", "operator": EQUALS, "comparisonValue": "demo"} ]

Sort Orders

The sortOrders parameter allows you to specify how the retrieved entities should be sorted. Multiple sort criteria can be applied, with the first sort order having the highest priority.

Sort Order Configuration

ParameterTypeRequiredDescription
attributePathstringYesPath to the attribute to sort by
sortOrderenumYesSort direction: Ascending or Descending

Sort Direction Options

Sort OrderDescription
AscendingSort from lowest to highest (A-Z, 0-9, oldest to newest)
DescendingSort from highest to lowest (Z-A, 9-0, newest to oldest)

Example Usage

sortOrders:
- attributePath: manufacturer # Primary sort: by manufacturer (ascending)
sortOrder: Ascending
- attributePath: model # Secondary sort: by model (descending)
sortOrder: Descending
- attributePath: installationDate # Tertiary sort: by installation date (newest first)
sortOrder: Descending

Sort Behavior

  • Multiple Sort Criteria: When multiple sort orders are specified, they are applied in the order they appear in the configuration
  • Data Types: Sorting works with various data types including strings, numbers, dates, and booleans
  • Null Values: Null values are typically sorted to the beginning (ascending) or end (descending) of the result set
  • Case Sensitivity: String sorting is case-insensitive by default
  • Performance: Adding sort orders may impact query performance, especially on large datasets

Parameters

ParameterTypeRequiredDescription
ckTypeIdstringNo*Static type identifier of the entities to retrieve
ckTypeIdPathstringNo*JSONPath to the type identifier in the data context
skipintegerNoNumber of entities to skip (for pagination)
takeintegerNoMaximum number of entities to retrieve
fieldFiltersarray of FieldFilterWithPathDtoNoFilters to apply when querying entities
sortOrdersarray of SortOrderDtoNoSort criteria to apply to the result set

*Either ckTypeId or ckTypeIdPath must be specified.

Use Cases

  • Entity Listing: Retrieve entities of a specific type for display or processing
  • Filtered Queries: Get entities that match specific criteria using field filters
  • Sorted Results: Retrieve entities in a specific order for reporting or display
  • Pagination: Implement pagination using skip and take parameters
  • Data Processing: Extract entities for further transformation or analysis
  • Reporting: Generate sorted and filtered reports based on entity data