VarbanVarbanov

Programatically registered context doesn't work

Discussion created by VarbanVarbanov on Apr 11, 2013
Latest reply on Apr 22, 2013 by mhamel

Hi, I'm adding a context to module programaticcaly using this code (Before this I create a module in the Mdb with needed aliases):

 

public bool ApplyAceSchedule(string executableName, string moduleName, string fullContextModulePath, double offset, double period)
{
var contextRegistrationPath = MdbHelpers.GetContextPath(_serverName, executableName, moduleName, fullContextModulePath);
var isOk = PIACEMDBFunctions.AddPIACEContextSchedule(contextRegistrationPath, CreateContextScheduleInfo(offset, period));
return isOk;
}

 

private NamedValues CreateContextScheduleInfo(double offset, double periodInSeconds)
{
var values = new NamedValuesClass();
values.Add("Type", 0);
values.Add("Offset", offset);
values.Add("Period", periodInSeconds);
values.Add("Priority", 3);
return values;
}

 

The context module and also the context itself is created, visible in ACE Manager and in Mdb. But although i tried to restart the module many times - the context stays in "Starting" ot "Error" mode.. While debugging everything seems fine - the module is calculating. While testing the module with the test tool using new context - it is also calculating at first and during second test - message appears that context (context path) is unknown server which is not included in servers table - despite the message the values are calculated.

Do I need to do something else when adding context programatically? Do I need to restart the module (not that this helps)? Any ideas why this isnt working will be higly appreciated

 

Best Regards 

Outcomes