Hi,
I need to automate running a Service Template on an Element. What ways can I achieve this? Ideally, I would give the automation engine an element, a template name and the input data and have the template run. Is that possible? If not, is there another way I can achieve the same goal?
For background, I have a script that configures services on a device. For the solution to really save us a lot of time I want it to also build the View and Visio mimic. I have a View template with placeholders that are filled with pages of the Visio assigned to the service but at the moment the service generation is manual. The service template runs on 1 Element with 4 or 5 pieces of input data.
Hi Ross,
You are looking for the TryCreateServiceMessage, which takes a service template name along with input data. This same type of request is being used when applying service templates from Cube.
Without going into too much detail, here are some references to previous questions from which the examples could help you to get started:
- Dojo: TryCreateServiceMessage -> ElementsToConsider (dataminer.services)
- Dojo: Service creation from QAction (dataminer.services)
- Dojo: Automation: how to provision a new service based on a service template on a specific DMA? (dataminer.services)
Hope this helps!
There is no official documentation on these messages indeed.
To send the message:
TryCreateServiceResult result = engine.SendSLNetSingleResponseMessage(serviceMessage) as TryCreateServiceResult;
Also note that ServiceTemplateID will have to be something like “123/76699”
Thanks this is exactly what I’m looking for. I can’t find any documentation on it in dataminer.services so struggling a little bit with how to send the message. I currently have…
public class Script
{
///
/// The script entry point.
///
/// Link with SLAutomation process.
public void Run(IEngine engine)
{
IDms dms = engine.GetDms();
int[] views = new int[1];
views[0] = 237;
TryCreateServiceMessage serviceMessage = new TryCreateServiceMessage
{
ServiceTemplateID = “76699”,
HostingDataMinerID = -1,
DataMinerID = -1,
CreateAll = false,
ViewIDs = views,
ExtraData = new TCSExtraData[3],
};
serviceMessage.ExtraData[0].Name = “data:serviceName”;
serviceMessage.ExtraData[0].Value = “Ross”;
serviceMessage.ExtraData[1].Name = “data:elmentName”;
serviceMessage.ExtraData[1].Value = “CHF-LAB-A07-APC-01B-SDI04”;
serviceMessage.ExtraData[2].Name = “data:deviceID”;
serviceMessage.ExtraData[2].Value = “1”;
TryCreateServiceResult result = (TryCreateServiceResult)engine.SendSLNetMessage(serviceMessage);
}
the bottom line obviously isn’t right but not sure how to send the message properly.