Can the Guid of a SRM booking be defined when creating one from an automation script?
We have an element that ingests event information, and passes them to an automation script silently, these events have a Guid already, so it would be useful to keep the same one when creating the booking SRM.
Hi Philip,
If you are using SRM Solution, you cannot specify the ID of the booking, you should have a custom property that will hold that ID. If you need to get the reservation by that property you can then use method GetReservationInstancesByProperty present in namespace Skyline.DataMiner.Library.Solutions.SRM.
If you don't use SRM Solution, Flávio's response is correct.
Hi Philip
When you're using the SRM framework it's possible to get the ID for the new booking by checking the BookingId property in the Booking object used when calling CreateNewBooking or TryCreateNewBooking.
The property is available since version 1.2.27 of the framework.
It's possible to use that ID in e.g. SrmLogHandler to create a logger object before the booking is created.
The BookingId property is a getter only, so it’s not possible to set the Id.
This is to make sure that each booking creation is done with a new ID.
Hi André
You’re right, updated the answer accordingly.
Hi Philip,
Yes, it's possible to define a particular Guid for a SRM Booking upon instanciation of the ServiceReservationInstance class via the set of the ID property, or via the usage of one of the constructor overloads, which receives the Guid of the Booking as an argument.
Thanks Flavio,
I’ll test and feed back.
Hi Jorge,
That’s what we’re doing at the moment.
I’m going to test the other answers to see if they work or not.