Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
die statement with Open a file
holmes
I am opening a file in an external script. The statement is :
open (BUSS_RULES, $business_rules) || die("Cannot Open File $business_rules") ;
If for some reason the file cannot be opened, the WF execution stops and no indication is bubbled up to the workflow. How do I solve this problem?
Find more posts tagged with
Comments
nipper
Learn Perl
That command writes to STDERR (on unix) if the file cannot open. Where it is collected from a WF I am not certain.
You will want to change it to something like this:
if (! open (BUSS_RULES, $business_rules)) {
# Put your eror logic here
open (LOG, /tmp/WF.log);
print LOG " Could not open $business_rules\n";
$task->CallBack(1,"WF Fail");
}
THen you need a step in your workflow to go to if this fails.
Kind of a pain, much easier to make certain you can always open that file.
HTH
Andy
herald10
When you use a die statement it completely exits the program without any further notification. So its not suggestible to use it from WFs.
Adam Stoller
I believe the output will show up in either iwtrace.log or the iwui/error_log file.
As already mentioned, using a 'die' statement (or any exit statement prior to performing a callback) within a workflow externaltask or cgitask script is a questionable practice.
--fish
(Interwoven 5.5.2 Certified, Senior Technical Consultant)
Bill Klish
messages written to STDERR are recorded in iwtrace.log for external tasks and in iwui/error_log for cgi tasks.
A practice that I have used before stores the error text in a workflow job variable before it transitions.