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


Brett
  •  Brett
  • No customer Topic Starter
2012-05-18T05:29:22Z
Hi support

I have a loop which tests for the successful completion of a process initiated by a cmd task executed as a the task just before the loop. The loop executes a get status command , parses the xml output file produced by the get status check , resolving the processing complete date element from the file - when the processing complete date is greater than the date and time stored just before the task was started the job is complete. This is an external tool and I have no control over the method the command provides to test for completion.

I set a user variable (type double) as - {DATEFORMAT(yyyyMMddHHmmss)}

after parsing the xml element that was output I get - 2012-05-18T12:02:14+10:00

and then I try setting a variable as this - which should extract all the numeric elements and stitch them together

{STRING(Left|{TASK(PrevTask,StdOut)}|4)}{STRING(Substring|{TASK(PrevTask,StdOut)}|5|2)}{STRING(Substring|{TASK(PrevTask,StdOut)}|8|2)}{STRING(Substring|{TASK(PrevTask,StdOut)}|11|2)}{STRING(Substring|{TASK(PrevTask,StdOut)}|14|2)}{STRING(Substring|{TASK(PrevTask,StdOut)}|17|2)}{STRING(Substring|{TASK(PrevTask,StdOut)}|20|2)}{STRING(Substring|{TASK(PrevTask,StdOut)}|23|2)}


the variable gets the value - [Thi Vribl i olyav
also the variable is changed from double to string

Should this work and is it a valid approach

Thanks
Sponsor
Forum information
Support
2012-05-18T06:37:34Z
A Variable can have a maximum of 5 levels down. I suggest using .NET Code Condition or Task instead.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Brett
  •  Brett
  • No customer Topic Starter
2012-05-20T22:00:17Z
Thanks for the response - I don't understand the levels point - it is probably just the way I formatted the post - but it is just various different chunks of the same string snipped out so the concatenate as a single string (number).
Brett
  •  Brett
  • No customer Topic Starter
2012-05-21T01:12:03Z
Have upgraded to 6.1.1 due to a need for some excel automation features.

For the above problem I find now that the following does not work - setting a variable with this results in an empty string - although using the variable dialog box shows the correct result in the preview pane

{TASK(PrevTask,StdOut)}

task output - Variable 'store_date' was updated to:

but this does - where that is a direct reference to the previous task ID

{TASK(46276194-6bd8-4dd3-b5a8-95ef1f2482f8,StdOut)}

task output - Variable 'store_date' was updated to: 2012-05-18T14:30:11+10:00

we use prevtask fairly heavily and this is causing some problems




Support
2012-05-21T06:07:31Z
We create a simple job with one Task that returns some output and another Task, a "Set Variable Task" referencing with PrevTask. This works in 6.1.1. Could you try this simple test and let us know the difference in your setup from ours?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Brett
  •  Brett
  • No customer Topic Starter
2012-05-21T06:23:11Z
Hi Support - I created a task that reads a text file into stdout and then used a set variable task to read the prev task output into a string - but with the same result - the variable is empty.

Again if I change to a direct reference to the task it works fine.

Thanks

Brett
Support
2012-05-21T06:31:25Z
We would really like to see this in action as we cannot reproduce this. Is it possible that we could share your screen through TeamViewer? If so, install TeamViewer and send us "Your Id" and "Password" to support@visualcron.com
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Brett
  •  Brett
  • No customer Topic Starter
2012-05-21T23:21:56Z
OK have resolved why I am having this issue -

I have been building this job and task set. Processing each step manually with a run task to see that each task was executing correctly - then going on to the next step and manually executing it.

With this approach the problem occurs


So running the simple two task job (by selecting each task in turn and running them manually) - read file and then set variable to output of prev task - fails

Running the job as a whole - works

What was confusing is that when building the set variable function\format string - the preview pane correctly shows the expected value from what was the previously executed task. This was why I presumed that executing each task one by one should work.

So I suppose the question is - should I be able to execute the job task by task as I build it as a form of debug or can it only be executed as a single job stream to get the correct output from the prev task function.

Sorry for any confusion over this issue and thanks for the prompt responses.

Brett.



Support
2012-05-22T19:01:46Z
Without knowing the whole relationship between Tasks in the Job I can say that you will get problems when trying to run a Task that is dependent on previous output. Also, if your are depending on loop context you will run into problems as well if you expect the same behavior as when running the whole Job.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top