Hi,
I would like to call the SRM_CreateNewBooking script and prefill the following fields:
Booking name
Service Group
Start time
end time
The last two are possible with an json entry in the Prefill partion of the script, but how can i do the first two?
Hi Ian,
No i’m playing around to get the a name from a DOM instance, so we can get from a low code app to an booking
Even better 🙂
Is the booking name added manually into the Job Manager (Low Code App) or are there further automations to a system upstream?
Well with the in between script i can go completly custom, but i was trying to use the Job name as well for the Booking so they’re also linked that way.
Hi Gerwin,
Please try the following code, should do what you want.
var bookingManager = new BookingManager("Replace with Booking Manager Element Name");
var bookingData = new Booking
{
BouqetViewName = "Replce with View Name (Service Group)",
Recurrence = new Recurrence
{
StartDate = startDate,
EndDate = endDate,
},
};
bookingManager.TryCreateNewBooking(engine, bookingData, new Function[0], null, null, null, out var reservation, false);
Hi Jorge,
This also renders an list of errors:
Script Failure (RBMN_CreateBookingFromLowCodeApp): (after retries) (Code: 0x80040251) Skyline.DataMiner.Net.Exceptions.DataMinerException: No Assembly found for cookie 18
(105,46): error CS1503: Argument 2: cannot convert from ‘Skyline.DataMiner.Library.Solutions.SRM.Model.Booking’ to ‘Skyline.DataMiner.Library.Solutions.SRM.Model.BookingManagerInfo’
(105,59): error CS1503: Argument 3: cannot convert from ‘Skyline.DataMiner.Library.Solutions.SRM.Model.Function[]’ to ‘Skyline.DataMiner.Library.Solutions.SRM.Model.Booking’
(105,98): error CS1615: Argument 7 may not be passed with the ‘out’ keyword
(105,115): error CS1620: Argument 8 must be passed with the ‘out’ keyword
at CManagedAutomation.RunWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* pvarReturn, String scriptName)
at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn)
Hi Gerwin,
You are not putting the correct using statements or initializing the correct objects. Below you can find my entire script code:
using System;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Library.Automation;
using Skyline.DataMiner.Library.Solutions.SRM;
using
using Skyline.DataMiner.Library.Solutions.SRM.Model;
///
/// DataMiner Script Class.
///
public class Script
{
public static void Run(Engine engine)
{
var bookingManager = new BookingManager(“Replace with Booking Manager Element Name”);
var bookindData = new Booking
{
BouqetViewName = “Replce with View Name”,
Recurrence = new Recurrence
{
StartDate = startDate,
EndDate = endDate,
},
};
bookingManager.TryCreateNewBooking(engine, bookindData, new Function[0], null, null, null, out var reservation, false);
}
}
In DLL references you need to add: ‘C:Skyline DataMinerFilesSLSRMLibrary.dll’
even with those referentions i still can’t choose the service definition i want to use.
Also it still ignores the enddate
Gerwin, is it an option to share your code sample here ? Could you also add a screen capture of the current result of your IAS front-end ?
Gerwin, please make sure you start from the code sample provided by Jorge , including the namespaces ( the other sample is related to Service Profile, which is not what you need here ).
Hello Gerwin,
Are you looking for an integration between DataMiner and another booking tool/system if the BookingName is going to be ingested/automated.
I am keen to have this discussion with you and your team to see what the best approach forward may be.