Skip to main content

SetPrimitiveValueNode

Namespace: Meshmakers.Octo.Sdk.Common.EtlDataPipeline.Nodes.Extracts

A data extraction node that sets primitive values at specified paths within the data context.

public class SetPrimitiveValueNode : IPipelineNode

Inheritance Object → SetPrimitiveValueNode
Implements IPipelineNode

Remarks:

The SetPrimitiveValueNode performs value injection operations by converting a configured value to a specified primitive type and assigning it to a target path in the data context. This node is fundamental for data enrichment, default value assignment, and metadata injection in ETL pipelines.

Processing workflow:

  1. Retrieve the configured value and target type from the node configuration
  2. Convert the value to the specified primitive type using culture-invariant parsing where applicable
  3. Set the converted value at the target path using the inherited target path configuration
  4. Continue to the next node in the pipeline.

The node supports robust type conversion with specialized handling for numeric types to ensure consistent behavior across different system locales. For Double values, string inputs are parsed using invariant culture formatting to prevent regional formatting issues.

Error handling includes detailed logging and specific exceptions for unsupported value types or conversion failures, making debugging and troubleshooting straightforward.

Constructors​

SetPrimitiveValueNode(NodeDelegate)​

A data extraction node that sets primitive values at specified paths within the data context.

public SetPrimitiveValueNode(NodeDelegate next)

Parameters​

next NodeDelegate
The next node in the pipeline to execute after this value assignment completes.

Remarks:

The SetPrimitiveValueNode performs value injection operations by converting a configured value to a specified primitive type and assigning it to a target path in the data context. This node is fundamental for data enrichment, default value assignment, and metadata injection in ETL pipelines.

Processing workflow:

  1. Retrieve the configured value and target type from the node configuration
  2. Convert the value to the specified primitive type using culture-invariant parsing where applicable
  3. Set the converted value at the target path using the inherited target path configuration
  4. Continue to the next node in the pipeline.

The node supports robust type conversion with specialized handling for numeric types to ensure consistent behavior across different system locales. For Double values, string inputs are parsed using invariant culture formatting to prevent regional formatting issues.

Error handling includes detailed logging and specific exceptions for unsupported value types or conversion failures, making debugging and troubleshooting straightforward.

Methods​

ProcessObjectAsync(IDataContext, INodeContext)​

Processes the data context by converting and setting the configured primitive value at the target path.

public Task ProcessObjectAsync(IDataContext dataContext, INodeContext nodeContext)

Parameters​

dataContext IDataContext
The data context containing the JSON data to modify.

nodeContext INodeContext
The node context containing configuration and logging capabilities.

Returns​

Task
A task representing the asynchronous operation.

Exceptions​

PipelineExecutionException
Thrown when the specified SetPrimitiveValueNodeConfiguration.ValueType is not supported.

ArgumentOutOfRangeException
Thrown when value conversion fails due to incompatible types or invalid format.

Remarks:

This method performs the core value assignment operation by:

  1. Retrieving the configuration including target path, value, and value type
  2. Converting the configured value to the specified primitive type
  3. Using the inherited target path configuration to set the value in the data context
  4. Proceeding to the next node in the pipeline,

The value conversion process handles various input formats and performs culture-invariant parsing for numeric types to ensure consistent behavior. If conversion fails, detailed error information is logged before throwing an exception.

The target path assignment respects all inherited configuration options including document mode, target value kind, and write mode, providing flexible integration with existing data structures.