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


DallasVC
2017-01-26T02:06:17Z
Hi, I have a Workflow defined with list of 6 tasks combination of both command and SQL tasks and after completion of all the 6 tasks I want to email out the Job Log which lists out Last Run, Name, Exit Code, Execution Time and output. Is that possible to achieve?

Thanks
Sponsor
Forum information
Support
2017-01-26T14:02:09Z
In theory this could be done:

1. Create a HTTP Task. Use the Web API to get the log: http://www.visualcron.com/doc/HTML/web_api.htm 
2. use the Email Task or Notification and use the output from the HTTP Task

/// <summary> 
/// Get the Task log 
/// </summary> 
/// <param name="taskId">Task Id</param> 
/// <param name="startDate">Start date (yyyy-MM-dd HH:mm:ss)</param> 
/// <param name="endDate">End date (yyyy-MM-dd HH:mm:ss)</param> 
/// <returns type="LogTaskHistoryClass[]"></returns> 
/// <link type="text">http://localhost:8001/VisualCron/text/Log/Task/List?token={token}&taskId={taskId}&startDate={startDate}&endDate={endDate}</link> 
/// <link type="xml">http://localhost:8001/VisualCron/xml/Log/Task/List?token={token}&taskId={taskId}&startDate={startDate}&endDate={endDate}</link> 
/// <link type="json">http://localhost:8001/VisualCron/json/Log/Task/List?token={token}&taskId={taskId}&startDate={startDate}&endDate={endDate}</link> 
Log_Task_List LogTaskHistoryClass[] (String taskId, String startDate, String endDate) 


What could be improved is that the Web API method could support ExecutionId instead of using taskId, startDate and EndDate. Because if that was supported we do not need to think about the dates to provide for this Task. We will add this to our todo list.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
DallasVC
2017-01-26T15:31:47Z
Thanks for the reply, When we call HTTP task from Email Task how to supply those 3 parameters dynamically so that we get automatic email notification without manual intervention?
Support
2017-01-26T22:13:46Z
By the way, we just implemented this in the beta 8.2.4. You only need these parameters:

http://localhost:8001/VisualCron/text/Log/Task/List?username=admin&password=&executionId={JOB(Active|UniqueProcessId)}

You can download 8.2.4 here: http://www.visualcron.co....aspx?g=posts&t=7049 

The trick is to first run your main Tasks. Then add HTTP Task as final Task where you call this. Then you can use Email Task and easiest way, to use this Variable in the body:

{TASK(PrevTask|StdOut)}

If you really want this on file you should create a File write Task with this value after the HTTP Task.

Now, if you got this to work I believe you do want some other columns. Like Task name. It is not there at the moment (only Id:s). Let us know what you need and if you get it to work.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top