Closed GromitD90 closed 5 years ago
This is a good callout. Thanks! Unintended consequences is a bad model. As such, I have added a boolean parameter to the end of the ImportTask
called overwriteExisting
and set its default so that it behaves the same as the current implementation. However, for your purposes, it should allow you to capture the condition where the task already exists and will throw an exception. Code is committed and will be included in 2.8.14 after testing completes.
Thank you for such a fast response. This is what I call awesome support.
Sent from my iPhone
On Jul 17, 2019, at 11:31 AM, David Hall notifications@github.com wrote:
Closed #817.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
You're welcome. I think under 30 minutes is a record for me. The stars aligned with me getting your email when it arrived, being in front of my dev station, and finding an easy fix.
I am making the following call to Import a scheduled task from an xml file. TaskService.Instance.RootFolder.ImportTask(taskname, item);
This works even if a scheduled task by the name taskname already exists. The old task is just deleted and overwritten with the new one.
Is this expected behaviour? Is there any way to determine if such an event has occurred?
Importing a task manually to the task scheduler does alert you to the fact that a task already exists.
Apologies if this should not have used the bug reporting process
Expected behavior I would expect that the ImportTask method would return an error code
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context Add any other context about the problem here.