Hi,
How can I assign an alias to the resources added to the service created by an SRM booking? I'm creating these bookings via an automation script.
My question is similar to the one here: https://community.dataminer.services/question/how-to-assign-an-alias-to-the-resources-in-services-created-by-srm/?hilite=Alias except that in my case, I already have the 'use node label as element alias' option set on the general page in the booking manager, and I also use this in code:
bookingManager.UseNodeLabelAsElementAlias = true;
engine.Sleep(1000);
The service at pre-roll ends up with devices but without aliases set. If you have any hints with what I can do to troubleshoot this further it would be really great!
images:
Hi Razvan,
Normally you only need to set that parameter to Enabled, like mentioned in the other topic.
Can you check if your service.xml file (under C:\Skyline DataMiner\Services\your service name) has the 'alias' attribute set? E.g.: <Element idx="0" dmaid="198" eid="30063" alias="Satellite".
Can you also check you booking log file to see if there's any exception there?
Finally, would it be possible to post the rest of the Function object initialization?
It should be some issue that needs to be investigate further, can you please contact our support team?
Thanks!
1. All elements have alias=””
2. Both booking logs and debug html-format files are clean (no errors/exceptions)
3. I use this to create the Function object:
internal static Function GetFunction(
ServiceDefinition serviceDefinition,
string nodeLabel,
bool shouldAutoSelectResource = false,
bool skipResourceValidation = true)
{
var node = serviceDefinition.Diagram.Nodes.Find(x => x.Label == nodeLabel);
if (node != null)
{
return new Function
{
Id = node.ID,
ByReference = false,
ShouldAutoSelectResource = shouldAutoSelectResource,
SkipResourceValidation = skipResourceValidation,
};
}
return null;
}
Then, where needed, I do a lookup and I attach a resource with:
function.SelectedResource = foundResource.ID.ToString();
Most of the functions get created with shouldAutoSelectResource = false, skipResourceValidation = true, and with a resource attached, but few are auto-selected too, as well as functions without resource attached.