When I'm using the ResourceManagerHelper and initialize it in the following way
ResourceManagerHelper helper = new ResourceManagerHelper();
And then call a method
helper.GetEligibleResources(...)
Then I get a NullReferenceException. I also encountered something similar for profilemanager, servicemanager, and other managers... What am I doing wrong?
The SRM (and other) helpers require a callback to DataMiner. This can be added like this:
helper = new ResourceManagerHelper();
helper.RequestResponseEvent += (s, e) => e.responseMessage = engine.SendSLNetSingleResponseMessage(e.requestMessage);
Hi Pieter-Jan,
You need to call the RequestResponseEvent as part of the initiation of the helper as shown below for in an Automation Script
ResourceManagerHelper RmHelper = new ResourceManagerHelper();
RmHelper.RequestResponseEvent += (sender, e) => e.responseMessage = Engine.SLNet.SendSingleResponseMessage(e.requestMessage);
If you use one of the latest versions of the SRM packages you can use this:
SrmManagers.ResourceManager.GetEligibleResources().
You also have the ProfileManager and others on the SrmManagers.