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-06-26T03:19:49Z
Hi Support - before I dig myself into to deep a hole could you provide some advice on the best way to handle the following


Job x

read filenames

loop filenames

call job y

next


JOB y

LOOP 1 to 200

Read NODE from xml file loop - element/node (loop x value)
on error go to Set Var

Do something with output of read node

NEXT

Set var - reset job so returns OK if error was end of nodes



This is fine until the xpath runs out of elements to read - there are 3 in the test file

On loop 4 the read node returns 77777 with stderr of 'xpath found nothing'

What is the best way to cleanly trap this and exit the job so the next xml file can be processed


I am currently trying a goto on unhandled error for the read node task to a set variable task as the last task in the job
This task tries to reset the exit code for the job to zero if the exit code of the read node task was 77777 and the stderr output was 'xpath found nothing'

But this doesn't seem to be working - it jumps to the last task but doesn't clear the exit code - seems to create a uservar called '77777'

this refers to the read node task
{TASK(159ed169-9cb2-4c69-b158-3c7f63e6f03b,ExitCode)}
and I set it to zero creates avariable calleed '77777'

I also tried setting the job exit code to zero
{JOB(2fdec01a-1ec9-4127-9a5b-b21d8d8accd6|ExitCode)}
But at this point seems to be zero and I create a variable called '0'



I have attached a pic of the set var screen - this is a variable I am trying to set so I shouldn't set the translate to constant when trying to set it ?


What i want to achieve is a clean - zero exit code for the job when the read node hits end of file. So that the VC sequence does not abort and just reads the next filename and calls the sub job again.

Thanks
Brett.
Brett attached the following image(s):
Sponsor
Forum information
Support
2012-06-27T20:47:21Z
I think, in this case, we need to add specific 'On error' handling for this. Could you send a simple loop reproducing this error. Then we can add some error handling for this.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Brett
  •  Brett
  • No customer Topic Starter
2012-06-28T03:57:34Z
Hi Support - I have created a very simple sample job of the read node activity

For me there is a job above this that reads parameters and passes file names to the job that this is an example of - I have hard coded the file name for this sample and provided that file and the XSD file attached to this post.

The number of rows in the file varies - in this case I think there are 11 rows - for my job I call a sub job that checks and loads output based on the value of each row.

What I wanted to do was detect / trap the end of row condition from the read node activity and gracefully exit to the parent job so that I can process the next file.

Appreciate the help

Thanks
Brett.


IAAPI.txt should be XSD renamed for upload
RL_NAME_FN_CF_CRODS.txt should be XML renamed for upload
File Attachment(s):
vc_export_brett_readnode.zip (6kb) downloaded 31 time(s).
iaapi.txt (52kb) downloaded 31 time(s).
RL_NAME_FN_CF_CRODS.txt (1kb) downloaded 29 time(s).
Support
2012-07-02T13:22:16Z
So, we did some changes to support a new "On error" called "XPath query returned nothing". This feature will be available in the next beta.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top