Common Krunch Pipeline parameters
- Last UpdatedApr 08, 2026
- 2 minute read
There are many common parameters available for use by a pipeline step.
For more detailed descriptions of the members of the class, see "CommonKrunchDataStreamParameters Class" in the Execution Pipeline Application Programming Interface (API) Reference documentation.
In the following example, the various CommonParameters are used in a file called AttachHPDBCustom.cs.
-
In the created project used to implement custom steps for the Krunch Pipeline, open or create the class file.
-
Set the class to implement the IStep interface.
-
Give the class the name of your step.
-
Set the Name member to the name of the step in the RealTime_PipelineExtensions_KrunchDataStream.json file.
-
Set the ExecutionRequired member of the IStep Interface (for more information, refer to "IStep Interface Members" in the Execution Pipeline Application Programming Interface [API] Reference documentation).
-
Create the step method, with IStepContext and ICachedSettings as parameters, and returning an IStepContext.
-
Initialize return parameters and local stepContext variables that access the CommonParameters.
-
Attach to the RealTime database (RTDB) table, record, and remote.
-
Return early if the krunch time is invalid.
-
Force remote disposition to unmodified.
-
Force record disposition to unmodified.
-
Return early if the krunch is questionable.
-
Record the result to the SetRecord's flag.rtu_qsd field.
Example step
// In the created project used to implement custom steps for the Krunch Pipeline, open or create the class file.
using System;
using OASySDNA.RealTime.ExecutionPipelines.KrunchCommon.Context;
using OASySDNA.RealTime.ExecutionPipelines.KrunchDataStream.Context;
using OASySDNA.RealTime.HighPerformanceSetDB;
namespace OASySDNA.RealTime.ExecutionPipelines.KrunchDataStream.Steps.Common
{
// Set the class to implement the IStep interface.
// Give the class the name of your step.
public sealed class AttachHPDBCustom : IStep
{
// Set the Name member to the name of the step in the RealTime_PipelineExtensions_KrunchDataStream.json file.
public String Name { get; } = "AttachHPDBCustom";
// Set the ExecutionRequired member of the IStep Interface.
public Boolean ExecutionRequired { get; } = true;
// Create the step method, which takes an IStepContext and ICachedSettings as parameters, and
// returns a resulting IStepContext.
public IStepContext Execute(IStepContext stepContext, ICachedSettings cachedSettings)
{
// Initialize return parameters and local stepContext variables that access the commonParameters.
Exception resultException = null;
var resultState = true;
var context = stepContext as KrunchContext;
var commonParameters = context.CommonParameters as CommonKrunchDataStreamParameters;
var setRecord = commonParameters.SetRecord;
try
{
//Attach to the RTDB table, record, and remote.
context.SetTable.AttachInsteadOfLock(TableLockRequestType.SAFE_READ);
commonParameters.SetRecord.AttachInsteadOfLock(RecordLockRequestType.SAFE_WRITE);
commonParameters.RemoteRecord.AttachInsteadOfLock(RecordLockRequestType.SAFE_WRITE);
//Return early if the krunch time is invalid.
if(commonParameters.CurrentTime.high < 0)
{
resultState = false;
//Force remote disposition to unmodified.
commonParameters.RemoteDisposition = Disposition.DISP_UN_MOD;
//Force record disposition to unmodified.
commonParameters.RecordDisposition = Disposition.DISP_UN_MOD;
}
//Return early if the krunch is questionable.
if (commonParameters.IsQuestionable == true)
{
//Record the result to the SetRecord's flag.rtu_qsd field.
setRecord.WriteField<Boolean>("flag.rtu_qsd", true);
commonParameters.RecordDisposition = Disposition.DISP_DATA_MOD;
resultState = false;
}
}
catch (Exception exp)
{
resultException = exp;
resultState = false;
}
context.StepResults.Add(new StepResult(Name, resultState, resultException));
return context;
}
}
}