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.


swapna
2011-12-01T03:30:40Z
Hi,

I am executing a Job.
The Job has 2 taks.
1. First task executes a ".exe"(C#) file along with arguments. This exe returns different values for example Success - 0, Failure - 6, Critical - 8, Nothing - 12.......
2. Second task writes the output and Exit Code of First task to a text file in file system.

When I run the job, if the .exe(first task) returns a Success value - 0 then the second task runs succesfully. If the .exe(first task) returns a value other than "0" it throws an Output(stderr) - Exception In Task: Non Zero Exit Code
Result - The handle is Invalid.
And the second task does not start.

What i need is:
I need to add conditions on task1 based on ExitCode - Like if ExitCode is 0 - Sending email to test1@gmail.com
Like if ExitCode is 6 - Sending email to test2@gmail.com
Like if ExitCode is 8 - Sending email to test2@gmail.com

I am using VisualCron client not using API.

Thanks.

Sponsor
Forum information
Support
2011-12-01T07:41:07Z
Hi,

as you have sent both email and forum post we answer here.

You can use the Variable for the output of a Task wherever you want it. Just open the Variables browser and find that specific Variable which is located under;

VisualCron->Jobs->Your Job->Tasks->Your task->Output

The actual exit code check might get a little messy as you want to do so many different things depending on result. You can use Conditions for checking the exit code for a specific value. For example, you could create x number of email Tasks depending of how many results you are expecting. Add this Tasks after your execute Task.

Then, create a Condition for each exit code and Task. Set them to Continue if exit code is met, else, Next (jump to next Task where next exit code is checked).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
swapna
2011-12-01T22:50:47Z
Hi,

My only issue with the ExitCode is that a positive number normally indicates a failure whereas I have results that are still considered a success, but I need to vary the next task.

Is it possible to write to a task specifically (even using the API from within the application being run) and set something like the result or a user defined variable related to that task that I can also check in a condition on the next task. The general flow might be as follows:

There are 4 results possible being success, success with issues, failure and critical (the first two are considered successful tasks but require a different subsequent task).

Task1 – execute the application.exe passing in the task id (via a parameter), this application writes back the result to the task identified by the id (using the VisualCron API?)
Task2 – only runs on the condition that the previous tasks results is ‘success’
Task3 – only runs on the condition that the previous tasks results is ‘success with issue’
etc.

My questions therefore are:

1. Can the API be used to write back to a specific task?
2. If it can, how could this be achieved in code (I have looked at the API but I am not sure if VisualCron.dll or VisualCronAPI or both is required)?
3. If it cannot, can we write to a user defined variable that we can relate to each task (by name or something) and then check these for the results?

Any sample code you can direct me to or provide would be appreciated.

Thanks
Support
2011-12-05T11:06:40Z
1. what exactly do you mean by write back to a specific Task. Are you talking about changing the Task or passing parameters before executing or?

The actual result cannot be changed. You need to do as we suggested - to react on result.

If you do not want to use conditions for this you can check this with API in your own way. But it seems better to do this in VisualCron so you can leave it without being dependent on other code.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
swapna
2011-12-06T06:17:09Z
Hi,
Thank you for your reply.
I am using API for my previous posts.

I need some help on copying job from Local Server to Test Server.

I have created a Job with 4 tasks. Each task and job have some conditions and User defined variables on my local Server.
Now I want to copy this entire Job along with Tasks ,Conditions and User defined variables to my Test Server.

When I am trying to copy and paste a Job what I can See is Clone Of Job?
how to copy entire Job along with tasks ,conditions and User defined variables.


Thanks.
Support
2011-12-08T17:38:32Z
Please create a new topic for each different query. Otherwise we might miss answering your question.

If you are connected to two servers you can right click and choose copy on one server and the right click on the other server and paste. You can also drag'n drop between them.

The copy will only copy Jobs and Tasks. No other global objects. If you want to copy more please use the Export and Import functionality in the Client->File->Export/Import.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top