2007/07/22

using WHILE Loop - OWB10gR2

The diagram below details the usage of WHILE loop operator in OWB10gR2.








The requirement is to check for the existence of a file on the server at a specified location. If the file exists, then complete with success and then execute the mapping. If the file does not exists then to loop through a specified period of time an hour, checking for the arrival of file for every 1 minute, and to end with Error status if the file has not arrived in the specified time.

The way I have achived this task is -

1. Defined a variable "CHK_FILE_STATUS" under START activity.
2. Assign a value 0 to the variable "CHK_FILE_STATUS"
Assigning Value "0"



3. Then, in the while loop put a condition to loop for an hour.


4. Use the File_Exists condition and specify the full path for the file to be checked for.
5. From File_Exists operator Use two transitions.
6. If File_Exists returns "Exists" then branch to Success.
7. If File_Exists returns anything other than "Exists" then loop through the logic to increment the variable "CHK_FILE_EXISTS" by 1.

8. Wait for a 60 seconds (delay) before checking for the arrival of file.


9. The while condition will be evaluated and the "FILE_EXISTS" will be checked until the variable "CHK_FILE_EXISTS" reaches the count 61 ( 1 hours).
10. If the file arrives before the count reaches 61, the WHILE loop will be broken to END_SUCCESS otherwise after 60mins, the loop breaks to END_ERROR.


No comments:

Post a Comment

File Handling with Python

This little utility is for copying files from source to target directories.  On the way it checks whether a directory exists in the target, ...