Hi Dojo,
I want to make use of reservations Event to trigger automation script at specific time.
I have following code:
First I define ReservationInstance, then I assign property to it(not relevant for the question) and finally I add 2 ReservationEvents to it. My expectation would be for TestEventScript to be triggered at predefined startTime and endTime, however that doesn't happen. I've also tried setting deprecated Time property to startTime and endTime with no luck.
Few other question come to mind:
- First parameter of AddEvent method is the key in the reservation json, which seems weird. Is that correct or am I doing something wrong?
- How can I pass parameters to the TestEventScript?
In this case TestEventScript is simple automation script that just logs one line and works fine when I execute it directly. I've tried to invoke automation script where Action is of type Script instead of C#, but again, with no luck.
I have been using DataMiner Objects Tool to inspect the new ReservationInstance and it looks okay to me:
I've tried looking at the documentation but, sadly, I wasn't able to find anything that could help me with this.
One more thing I've noticed is that Event class describes Script property to contain "script configuration string", so I'm thinking that maybe I need to pass specific format as second parameter in ReservationEvent constructor instead of simply providing the name.
Thanks,
Cheers
Hi Edib,
The second argument expects the same format as linking a visual shape to an Automation script.
string.Format("Script:{0}||Reservation ID={1};Action={2}|||NoConfirmation,NoSetCheck,Asynchronous", ActionScriptName, coreReservationId, action);
Hi Jens,
I’ve added a new comment with screenshot of string formats I’ve tried, none of them work. Would you be able to assist me further?