Column Matcher
Table Scan can be customizied with user logic to match columns.
Such logic must be coded in a column matcher class which must implement the HPE.Ianus.Scripting.IColumnMatcher
interface.
namespace HPE.Ianus.Scripting
{
public interface IColumnMatcher
{
void Initialize(Environment env, Task task, Column column);
bool Matches(object sourceValue);
}
}
Therefore it must implement the method Match
, that must return true
when the column value meets the desired criteria.
The method Match
receives the following input parameters:
Parameter | Description |
---|---|
sourceValue | Source value to be matched |
The converter class can be coded in C# when embedded as script, and in any .NET language (including COBOL if available) when provided as DLL.
Note
Ianus provides data to the Match
method exactly as it reads from the ADO resultset and uses the returned value according to ADO mechanisms.
Example 1
public class MatchText : IColumnMatcher
{
LoggerFacade Log;
public void Initialize(HPE.Ianus.Environment env, HPE.Ianus.Task task, Column column)
{
Log = task.Log;
}
public bool Matches(object value)
{
Log.Info($"Matching [{value}]");
return value.ToString().Contains("A");
}
}