Hello everyone, hope you all are well!! Can someone help me understanding why i'm getting the erro bellow when i link the collumn. I've created a custom operator to calculate the remaining time of a job following some tutorial documentations that i'll be linking bellow and some other examples that we developed in our dma, but i was unable to identify the source of this problem.
Thank you all in advance!
tutorial links:
Building a GQI custom operator that calculates a duration | DataMiner Docs
Creating a minus operator | DataMiner Docs
My code is:
namespace remainingTimer
{
using System;
using System.Globalization;
using Skyline.DataMiner.Analytics.GenericInterface;
using Skyline.DataMiner.Automation;
[GQIMetaData(Name = "Remaining_Time")]
public class RemainingTime : IGQIInputArguments, IGQIColumnOperator, IGQIRowOperator
{
private readonly GQIColumnDropdownArgument _endTimeColumnArg = new GQIColumnDropdownArgument("End Time") { IsRequired = true }; // Input Argument to be requested from the user;
private GQIColumn _endTime;
private GQIColumn _remainingTime;
public GQIArgument[] GetInputArguments()
{
return new GQIArgument[] { _endTimeColumnArg };
}
public OnArgumentsProcessedOutputArgs OnArgumentsProcessed(OnArgumentsProcessedInputArgs args)
{
_endTime = args.GetArgumentValue(_endTimeColumnArg);
return new OnArgumentsProcessedOutputArgs();
}
public void HandleColumns(GQIEditableHeader header)
{
header.AddColumns(_remainingTime);
}
public void HandleRow(GQIEditableRow row)
{
var end = row.GetValue<DateTimeOffset>(_endTime);
if(end != null){
var duration = end - DateTimeOffset.Now;
row.SetValue(_remainingTime, duration);
}
}
}
}
Hi João,
The _remainingTime column you are using is not initialized yet (it still has value null).
Solution
Initialize _remainingTime with a new GQIColumn instance like so:
private static readonly GQIColumn<TimeSpan> _remainingTimeColumn = new GQITimeSpanColumn("Remaining time");
Some additional info:
- Since the column does not depend on the input arguments, it can be defined as a static readonly field
- The column is defined by a combination of its type and its name.
In this case, the type will be TimeSpan and its name will be "Remaining time". - For sake of readability/maintainability, it helps to rename _remainingTime to _remainingTimeColumn
Additional notes
It is indeed not explicitly stated in the tutorial for calculating a duration how to do this since that is not the main focus of the tutorial. Fortunately, the quick start package that is available for it on the catalog does the initialization in the constructor like this:
_durationColumn = new GQITimeSpanColumn("Duration");
Furthermore, the error message you got was very uninformative so we will make sure to improve that one in the future.

Do you still get the exact same error? Because the uninitialized column was without a doubt the reason for it.
Maybe the new version of the operator you made failed to load properly somehow? Does it compile correctly in Cube still?
Yes, the same error persistis. I think it compiles successfuly because when i click in the validate button ir returns no errors.

Curious. You could check in C:\Skyline DataMiner\Scripts\Libraries if the latest build of the custom operator library exists. There should be a file named <script-name>.<library-name>.<compile-time>.R.dll for your script with a recent compile time.
If you're on a development/staging setup, you can also try removing any older versions and restarting the SLHelper process to reload the custom operator.
Otherwise, feel free to create a support ticket for us to look into it further: https://docs.dataminer.services/user-guide/Troubleshooting/Contacting_tech_support.html
I've checked the path you informed and the dll exists. I've restarted the SLHelper as oriented, but nothing of this seen to be working, i keep getting the same error reported.
Here is the actual code, the rest remain the same:
[GQIMetaData(Name = "Remaining_Time")]
public class RemainingTime : IGQIInputArguments, IGQIColumnOperator, IGQIRowOperator
{
private readonly GQIColumnDropdownArgument _endTimeColumnArg = new GQIColumnDropdownArgument("End Time") { IsRequired = true }; // Input Argument to be requested from the user;
private static readonly GQIColumn<DateTime> _remainingTimeColumn = new GQIDateTimeColumn("Remaining time");
private GQIColumn _endTime;
private GQIColumn _remainingTime;
public GQIArgument[] GetInputArguments()
{
return new GQIArgument[] { _endTimeColumnArg };
}
public OnArgumentsProcessedOutputArgs OnArgumentsProcessed(OnArgumentsProcessedInputArgs args)
{
_endTime = args.GetArgumentValue(_endTimeColumnArg);
return new OnArgumentsProcessedOutputArgs();
}
public void HandleColumns(GQIEditableHeader header)
{
header.AddColumns(_remainingTime);
}
public void HandleRow(GQIEditableRow row)
{
var end = row.GetValue<DateTimeOffset>(_endTime);
if(end != null){
var duration = end – DateTimeOffset.Now;
row.SetValue(_remainingTime, duration);
}
}
}
Hi Ronald, thank you for your help, i've made the changes that you have addressed but unfortunately it won't worked. Maybe the problem is in the data source itself as it is an adhoc that was made by Skyline and i can't locate it in our Cube to check. I'll try to contact the person who helped us made it and try to fix it.