I want to retrieve a filtered set of table entries in an automation script.
Fetching first the whole table and then going through that table doesn't seem like the best idea, given that DataMiner already has a lot of filter possibilities.
Doing a 'follow' I see that a GetPartialTableMessage might be a good method.
Sending a GetPartialTableMessage with following filter
[0000] sort=1035|DESC|
[0001] fullFilter=((1011=="Kaleido 192.168.81.138") AND (1012=="A") AND (1013=="D") AND (1014=="15"))
results in a ParameterChangeEventMessage in the Message overview.
I expected something in the reply that would have the indexes, which was not the case.
I guess I'm not sure how to use this call.
Would you have more experience with this call or do you have a good alternative?
Hi Jeroen,
Below you'll find a sample:
GetPartialTableMessage req = new GetPartialTableMessage(dmaid, eid, table, filters);
ParameterChangeEventMessage data = Engine.SLNet.SendSingleResponseMessage(req) as ParameterChangeEventMessage;if (data == null || data.NewValue == null || (!data.NewValue.IsArray && !data.NewValue.IsEmpty))
{
// no or invalid data returned
}
else if (data.NewValue.IsEmpty)
{
// empty table
}
else if (data.NewValue.IsArray)
{
// log table
var columns = data.NewValue.ArrayValue;// iterate data
int rowCount = 0;
if (columns.Length > 1)
rowCount = columns[0].ArrayValue.Length;for (int idxRow = 0; idxRow < rowCount; idxRow++)
{
try
{
// start of row 'idxRow'
string column1 = data.NewValue.GetTableCell(idxRow, 0)?.CellValue.GetAsStringValue();
string column7 = data.NewValue.GetTableCell(idxRow, 6)?.CellValue.GetAsStringValue();
}
catch (Exception ex)
{
engine.GenerateInformation("ERR|Unable to precess row due to " + ex);
}
}
}
Ok, I think I found how to work with it.
The CellValue contains an array with ParameterValues
In the ParameterValue objects I need to read out the CellValue StringValue
I’ll give it a try in a script