Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
TeamSite
TeamSite, LiveSite and OpenDeploy
External task - System Command problem
System
Below is a perl script which we want to run in an external task. It should supposedly call rsh.exe and return. When this script is called within an external task, the return value from the execution of rsh.exe command is 256 - It does not work! I strip out the workflow related parts from the ipl and run the script from the command line; this time the return code is 0 and everything works as expected. What may be causing the script to fail when it is run from within the workflow? Thanks.
#!c:\iw-home/iw-perl/bin/iwperl
######################################################################
#
# systemcommand.ipl
#
# This script executes rsh.exe
#
######################################################################
use TeamSite::WFtask;
my $iwhome = `iwgethome`;
$iwhome =~ s/[\n\r]+$//;
my $task = new TeamSite::WFtask($ARGV[1]);
open (LOG, ">$iwhome/tmp/systemcommand.log");
if ($task->IsValid())
{
print LOG "BEFORE\n";
$cmd = "c:\\winnt\\system32\\rsh.exe";
$par = "akportdev -l haluk touch test.txt";
print LOG "cmd: $cmd\n";
print LOG "par: $par\n";
$retval = system($cmd);
print LOG "Return Value: $retval\n";
print LOG "AFTER\n";
$task->CallBack(0, "Finished $cmd");
}
Find more posts tagged with
Comments
There are no comments yet