Retrieve parameters and return results
- Last UpdatedApr 08, 2026
- 2 minute read
This scenario guides you through the steps required to retrieve parameters and return the results (including output parameters). The sample Business Logic Tier (BLT) component returns the same values that are used in its execution.
The numberOfAlarms parameter is defined as output and required. This definition makes it an input/output. It will return the input value multiplied by 2. The parameter numberOfEvents will return the value of the parameter numberOfAlarms multiplied by 3.
To identify the code associated with each step, see the code comments in the Example code section.
To retrieve parameters and return results
- Open the Program.cs file from the created project.
- Navigate to the Process method of the TestBLTProcessor class.
- Load the local variables from the parameters.
- Load the results into the output parameters and the results dataset.
- Load the RowsAffected attribute.
The RowsAffected attribute value usually indicates the number of rows that have been modified by the BLT component, but it can also be used to count the number of rows returned by the BLT component.
- Check the execution using the DALBLTTestCient application.
For more information, see Check the execution of a BLT component using the DALBLTTestClient application.
Example code
public override void Process()
{
// Load the local variables from the parameters.
var tableName = (String)Parameters.Item(0).Value;
var pointName = (String)Parameters.Item(1).Value;
var numberOfAlarms = (Int32)Parameters.Item(2).Value;
RowsAffected = 0;
try
{
// Load the results into the output parameters and the results dataset.
DataTable tabularResult = new DataTable("Result");
tabularResult.Columns.Add("Name", typeof(String));
tabularResult.Columns.Add("Value", typeof(String));
DataRow row = tabularResult.NewRow();
row[0] = "table";
row[1] = tableName;
tabularResult.Rows.Add(row);
RowsAffected++;
row = tabularResult.NewRow();
row[0] = "point";
row[1] = pointName;
tabularResult.Rows.Add(row);
RowsAffected++;
row = tabularResult.NewRow();
row[0] = "numberOfAlarms";
row[1] = 23;
Parameters.Item(2).Value = numberOfAlarms * 2;
Parameters.Item(3).Value = numberOfAlarms * 3;
AddResultSet(tabularResult);
}
catch (Exception ex)
{
Log.Always(quot;{nameof(TestBLT)}: {ex.Message}");
throw new BLTException(ex.Message);
}
}