Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


pkujonewicz
2009-06-02T23:09:40Z
I've found a difference between the following variables in my email notifications:

{JOB(Active|LastExited|M/d/yyyy h:mm:ss.ff tt)}
{TASK(Active,LastExited,M/d/yyyy h:mm:ss.ff tt)}

For a task, the last exited variable shows the time the current task's run completed. So if I display LastRun and LastExited one after the other, it makes sense -- Last Run and Last Exited are separated by a span of time roughly equal to the Execution Time variable.

For a job, it doesn't seem to work this way. LastRun works as expected, showing the run time of the most recent run. But LastExited shows the exit time of the PREVIOUS run, which is counterintuitive.

Since this behaviour is different between jobs and tasks, I can only assume this is unintended? Or perhaps I'm missing something about the way tasks and jobs are meant to be used?
Sponsor
Forum information
Support
2009-06-02T23:20:07Z
Active is referring to current Execution. Since LastExited is not set until after a Job is done it will always refer to the previous Job. It is the same with Tasks but you probably query this value at a later stage.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
pkujonewicz
2009-06-03T18:17:37Z
In both Job and Task, I have an email notification setup with that variable in it. The notification fires "on complete". So I still don't understand why Job and Task behave differently.

If anything, I'd expect Task to work the same way as Job.
Support
2009-06-03T18:30:19Z
So, you have:

1. email notification with these two variables
2. you use the same notification for the job and the task
3. Both fires on complete?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
pkujonewicz
2009-06-03T18:57:15Z
In notifications, I have two email notifications set up.

One is called "Job is OK" and one is called "Task is OK".

In each notification, in the message body section, I have a bunch of relevant variables -- task variables for the task, and job variables for the job.

On the job itself, under notifications, I have clicked the checkbox for "on complete" for the "Job is OK" notification.

On the task, under notifications, I have clicked the checkbox for "on complete" for the "Task is OK" notification.
Support
2009-06-03T19:28:18Z
We can't reproduce this.

We create 1 Job with 1 Task. Both uses two different Notificiations:

In the Task Notification I use {TASK(Active,LastExited,yyyy-MM-dd HH:mm:ss)}
In the Job Notification I use {JOB(Active|LastExited|yyyy-MM-dd HH:mm:ss)}

It is a difference about 0 - 1 second every time.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
pkujonewicz
2009-06-03T19:58:49Z
Email Notification "Job ran OK", under Message/Body tab:


Everything is cool.

Job last run: {JOB(Active|LastRun|M/d/yyyy h:mm:ss.ff tt)}
Job last exited: {JOB(Active|LastExited|M/d/yyyy h:mm:ss.ff tt)}
Job execution time was: {JOB(Active|ExecutionTime)}

Next run: {JOB(Active|NextRun|M/d/yyyy h:mm:ss.ff tt)}

Trigger: {TRIGGER(Active|LastTrigger|Desc)}

Other job variables:

ID: {JOB(Active|Id)}
Name: {JOB(Active|Name)}
Description: {JOB(Active|Desc)}
Result: {JOB(Active|Result)}
Creation Time: {JOB(Active|CreatedDate|M/d/yyyy h:mm:ss.ff tt)}
Created By: {JOB(Active|CreatedBy.Name)}
Modification Time: {JOB(Active|ModifiedDate|M/d/yyyy h:mm:ss.ff tt)}
Modified By: {JOB(Active|ModifiedBy.Name)}
Number of executes: {JOB(Active|NoExecutes)}

Status: {JOB(Active|Status)}




Email notification "Task ran OK", under Message/Body tab:


The task was cool.

Last run: {TASK(Active,LastRun,M/d/yyyy h:mm:ss.ff tt)}
Last exited: {TASK(Active,LastExited,M/d/yyyy h:mm:ss.ff tt)}
Execution time: {TASK(Active,ExecutionTime)}

Other variables:

Exit code: {TASK(Active,ExitCode)}
Exit code description: {TASK(Active,ExitCodeDesc)}
Number of executes: {TASK(Active,NoExecutes)}

Status: {TASK(Active,Status)}
Result: {TASK(Active,Result)}

Command: {TASK(Active,Command)}
Parameters: {TASK(Active,Parameters)}
Working directory: {TASK(Active,WorkDir)}
Logon type: {TASK(Active,LogonType)}
Credential: {TASK(Active,Credential.String)}

Trigger: {TRIGGER(Active|LastTrigger|Desc)}

Output:
{TASK(Active,StdOut)}

Output (stderr):
pkujonewicz
2009-06-03T20:01:09Z
The job has TWO tasks under it, both are identical except run with different credentials and different working directories. So whenever the job runs, I get 3 email notifications, one for the job, and two for each task. Here are the emails I just got:


JOB


Everything is cool.

Job last run: 6/3/2009 1:57:30.31 PM
Job last exited: 6/2/2009 5:21:01.14 PM
Job execution time was: 0.968

Next run: 6/3/2009 1:58:00.31 PM

Trigger: On the 0th and 30th second

Other job variables:

ID: d0da59fe-2ba2-4299-80f0-bd44b6404e5c
Name: lister
Description: Run lister as Monthly_User and Administrator
Result: Success
Creation Time: 5/25/2009 11:19:29.50 AM
Created By: VisualCron Default Admin
Modification Time: 5/25/2009 3:53:50.21 PM Modified By: VisualCron Default Admin Number of executes: 28

Status: Running



TASK1

The task was cool.

Last run: 6/3/2009 1:57:30.80 PM
Last exited: 6/3/2009 1:57:31.11 PM
Execution time: 0.315

Other variables:

Exit code: 0
Exit code description: The operation completed successfully.
Number of executes: 18

Status: Waiting
Result: Success

Command: C:\lister-admin\lister.exe
Parameters:
Working directory: C:\lister-admin
Logon type: Network credentials only
Credential: Administrator@METRIC

Trigger: On the 0th and 30th second

Output:


Output (stderr):




TASK2


The task was cool.

Last run: 6/3/2009 1:57:30.33 PM
Last exited: 6/3/2009 1:57:30.77 PM
Execution time: 0.428

Other variables:

Exit code: 0
Exit code description: The operation completed successfully.
Number of executes: 28

Status: Waiting
Result: Success

Command: C:\lister\lister.exe
Parameters:
Working directory: C:\lister
Logon type: Network credentials only
Credential: Monthly_User@METRIC

Trigger: On the 0th and 30th second

Output:


Output (stderr):

Support
2009-06-03T20:08:33Z
Yes, I see now. I missed a part - I was focusing on the Task.

In the current implementation we have seen the Job Exit time = when the whole process has completed and sending Notifications. But I agree that this collides with the actual definition Job.Complete which is used in the Notification.

We will change this for next version, that Exited is set before running Notifications.

Thank you for the report and your samples.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
pkujonewicz
2009-06-03T20:17:46Z
Thanks!

So, currently, "exited" is set before notifications for Tasks, but only after notifications for Jobs, correct?

And you will be changing the Job variable to match the way the Task variable is calculated, correct?
Support
2009-06-03T20:21:54Z
Yes, the actual execution time is "correct" to the current Job. It is only the LastExited that is currently set after sending Notifications. That part will now be moved to _before_ complete Notifications.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2009-06-03T23:14:02Z
Here is the version where this is fixed:

http://www.visualcron.co...m.aspx?g=posts&t=616 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top