In the absence of a Task Trigger, I was trying to work around it by employing a Job/Task Control. But I'm getting unexpected results.
This is my configuration:
JobA -> TaskA
JobB - > TaskB
JobC -> TaskC
JobD -> TaskD
Job1 -> Task1
Job2 - > Task2
Job3 -> Task3
Job4 -> Task4
Now, Jobs A,B,C,D need to be fired in a sequence.
So I created a Job Job1Group with following Job/Task Control Tasks:
RunJobA (runs JobA)
RunJobB (runs JobB)
RunJobC (runs JobC)
RunJobD (runs JobD)
Similarly, Jobs 1,2,3,4 need to be fired in sequence
So I created a Job Job2Group with following Job/Task Control Tasks:
RunJob1 (runs Job1)
RunJob2 (runs Job2)
RunJob3 (runs Job3)
RunJob4 (runs Job4)
The contraint is - JobB is dependent on successful completion of Job2.
To enable this, I added a Event Trigger for JobB with a VisualCron setting of "Job completed successfully" for Job2.
I kicked off Job1Group and Job2Group at the same time.
I was hoping that JobA will fire in Job1Group and will be waiting on JobB till Job2 in Job2Group finishes.
But I'm getting unexpected results.
All the tasks use a powershell script to write the active Job, Task and the current datetime to a file.
Task2 in Job2 has a wait of 10 secs before it writes its content to a file.
Job1Group tasks write to a file called Job1Group.txt and Job2Group tasks write to another file Job2Group.txt.
Both Job1Group and Job2Group were scheduled for 2013-12-05T14:43:00.
These is the content of Job1Group.txt
JobA , TaskA, 2013-12-05T14:43:00
JobB , TaskB, 2013-12-05T14:43:00 // This should not have bee written at 14:43:00
JobC , TaskC, 2013-12-05T14:43:00
JobD , TaskD, 2013-12-05T14:43:01
JobB , TaskB, 2013-12-05T14:43:10 // additional entry for JobB ??
Content of Job2Group.txt
Job1 , Task1, 2013-12-05T14:43:00
Job2 , Task2, 2013-12-05T14:43:00 // this is the task with 10 secs delay
Job3 , Task3, 2013-12-05T14:43:10
Job4 , Task4, 2013-12-05T14:43:11
Can you explain why I'm getting these results?
Also, I noticed that JobB was not waiting at all.