This project has moved. For the latest updates, please go here.

Task Trigger Start Boundary

Topics: Errors
Feb 11, 2016 at 12:22 PM
I am creating a task from my code. It has a trigger (Idle Trigger) where I do not check "Active" time (keep the checkbox unchecked and create the task.

now if I try to read the task xml, it does not have a "StartBoundary" node.

However, when a task object is created, it shows me the Task Trigger with StartBoundary set to current time.

This sets the UI off and on my UI, the Active is set to CHECKED.

Is there something that I am missing.


Thanks in Advance.
Ashutosh
Coordinator
Feb 11, 2016 at 4:58 PM
In the library, all triggers are assigned a StartBoundary when constructed. It appears, now that you bring this to my attention, that the native library only assigns a StartBoundary to calendar triggers by default. Is this a problem for your code? I can't see any scenario where having a StartBoundary set to a time in the past would cause any different behavior.
Feb 11, 2016 at 5:13 PM
The code that I am using fetches the task from Task scheduler and based on whether the StartBoundary node is present or not, we can set the "Activate" checkbox for the trigger.

Task Scheduler allows us to set this time to be somewhere in past as well without any issues.

While mocking the same behaviour, the only check I have is to see if the NODE "StartBoundary" exists in the XML or not. If it does not exist, then the "Activate" Checkbox is unchecked in task scheduler. However, when this task comes to me through the wrapper, the TaskDefinition sets this StartBoundary to current date time if it does not find the node and thus, I now have a StartBoundary set for that trigger.


End result is that even if I have a task with an idle trigger which does not have "Activate" check box checked, it comes out to me with a "Start Date" that is equal to current date time and therefore, "Activate" is set to ON.


I hope I did not confuse things here.

I see the quick fix to this as making the StartBoundary and EndBoundary as DateTime? instead of DateTime and initializing them with NULL.

Although that might have its own issue which I am not yet aware of :)


Thanks
Ashutosh
Coordinator
Feb 11, 2016 at 11:43 PM
I believe I have this fixed in 2.5.14.