We have a scheduler template automation script (with action parameter for START and STOP).
Is it possible to retrieve the duration of a scheduled event in the automation script during the triggered start-Action?
As far as I know the automation script does not know from which scheduled task it was started.
If this would be possible, the duration could be calculated by parsing the Schedule.xml.
It is possible to pass additional parameters to the automation script. You could configure it so that it contains the name of the even. As you suggest you could then parse the schedule.xml to find the duration.
I tested this by creating the same event twice. In the Schedule.xml it indeed contains an action for each scheduled event, even if the events are the same.
The reason why there is a split in Tasks and Actions in the xml is because a scheduled task can have multiple actions.
However an event only has one action that is automatically generated.
Thanks a lot Jeroen for this clarification.
For information purposes, I already have an event name.
So I can use that Parameter to filter the correct Action(s).
From the action I now need to infer the task, in order to get the date and time.
Looking at the xml structure I would say Task.RepeartAction references Action.ID.
Is this a 1:1 relation, so it is allowed to search the Action.ID in the tasks to determine the related task?
Empirically I would say yes, but data-wise I could imagine that an action can be used by several tasks, so that would be a 1:n relation and I would have no chance to get the correct Task.
Can you confirm that every Task has (connected via the Task.RepeartAction = Action.id) excatly one Action?