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)
Passing Parameters to an external script
Paul
I have the following code in a workflow:
__INSERT__(&get_cmd("run_datadeploy.ipl", $DBEnvironment));
This is working fine. I am developing another workflow and have need to pass two parameters.
I have tried this:
__INSERT__(&get_cmd("run_datadeploy.ipl", $DBEnvironment, $fullDatapath)); and that doesn't work. Only the first parameter gets passed or picked up.
The code I have tried in the run_datadeploy.ipl is as follows:
my $DBEnvironment = $ARGV[0];
my $fullDatapath = $ARGV[1];
I have also tried:
__INSERT__(&get_cmd("run_datadeploy.ipl", $DBEnvironment $fullDatapath)); and get a syntax error.
I tried putting the two scalars in an array but that failed miserably but maybe I wasn't unwrapping the array properly
Any ideas would be appreciated
Find more posts tagged with
Comments
JonathonG
It seems that the
get_cmd
subroutine only expects 2 parameters. You'll either need to update that subroutine to take more parameters or write out the full command line yourself. I could be wrong, though. Could you post the source code for that subroutine? Either I or someone else may be able to shed some light on what's happening from that information. Oh, and it wouldn't hurt to include your TeamSite and OS version information.
Jonathon
Interwoven Developer
Allstate, Inc.
awizardly
if you want to pass multiple parameters then you just need to add them as a single string with a space between them.
my $param = $DBEnvironment . " " . $fullDatapath;
Then call
__INSERT__(&get_cmd("run_datadeploy.ipl", $paramt));
if you want to do multiple params then put the concatenation into a for loop.
Lee
Organic Inc
http://www.organic.com
Adam Stoller
Or - just rewrite the subroutine - assuming your basing this off the OOTB routine, something like this [unverified]:
use TeamSite::Config;
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
sub get_cmd {
my ($program,
@params)
=
@_
;
my $args = q{};
$args = q{ "} . join(q{" "},
@params)
. q{"} if (
@params)
;
$args =~ s/"(-\w+)"/$1/g;
my $perl = ($^O eq "MSWin32") ? qq("$iwhome/iw-perl/bin/iwperl" ) : q{};
# special case for iw_solution_email
if ($program eq "iw_solution_email.ipl"){
$program = "$iwhome/local/config/wft/solutions/$program";
}
my $cmd = qq($perl$program $args);
# I prefer not to wrap this last part, if you want it, uncomment it
#$cmd = "<command v='$cmd'/>";
return $cmd;
}
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Paul
Thanks all -- I ended up writing a new subroutine and it wirks like a champ. It was a forest and trrees type thing.