Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
passing string to external task
sachin_sharma78
HI all,
I am unable to pass correct string value from workflow to external program. since it has white space this argument when passed to external program it passes as multiple arguments(truncating at every white space)
I get the string $heading from DCT
my $heading=$rootnode->value("community");
i pass this string to commandline argument
my $genCmd = $iwhome."/iw-perl/bin/iwperl ".$iwhome."/custom/scripts/gen_html.ipl $heading";
__INSERT__("<command v='$genCmd' />" );
so though i m passing correct value of string like
<command v='C:\Interwoven\TeamSite/iw-perl/bin/iwperl C:\Interwoven\TeamSite/custom/scripts/gen_html.ipl Sales Logix/Products' />
but when i debug external program i find it as two argument "Sales" and "Logix/Products". So how can i pass string as single argument.
Any help will be appreciated
Regards,
sachin
Find more posts tagged with
Comments
Migrateduser
Wrap it in quotes.
<command v='C:\Interwoven\TeamSite/iw-perl/bin/iwperl C:\Interwoven\TeamSite/custom/scripts/gen_html.ipl "Sales Logix/Products"' />
or, pass it as a task variable instead of passing it as a command line arg - that's what I prefer to do anyway. I find it cleaner.
sachin_sharma78
I think u didnt get me completely... i see this o/p when i debug the workflow.
command v='C:\Interwoven\TeamSite/iw-perl/bin/iwperl C:\Interwoven\TeamSite/custom/scripts/gen_html.ipl Sales Logix/Products' />
But i cant hard code it.can you tell l me in next line where to put the quotes. i tried many ways but cudnt succeed.
my $genCmd = $iwhome."/iw-perl/bin/iwperl ".$iwhome."/custom/scripts/gen_html.ipl $heading";
thanks,
Sachin
Adam Stoller
He already indicated how - but to be more explicit - instead of:
my $genCmd = $iwhome."/iw-perl/bin/iwperl ".$iwhome."/custom/scripts/gen_html.ipl $heading";
...
__INSERT__("<command v='$genCmd' />" );
try:
my $genCmd =
qq(
$iwhome/iw-perl/bin/iwperl $iwhome/custom/scripts/gen_html.ipl
"
$heading"
)
;
...
__INSERT__("<command v='$genCmd' />" );
or, as also was suggested, use a task variable instead - like:
my $genCmd ="$iwhome/iw-perl/bin/iwperl $iwhome/custom/scripts/gen_html.ipl";
...
__INSERT__("<command v='$genCmd'/>");
...
<variables>
<variable key="param" value="__INSERT__($heading);"/>
</variables>
and then within the gen_html.ipl, once you've defined the task object ($task) use it to access the parameter:
my $param = $task->GetVariable("param");
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sachin_sharma78
Thanx fish. it worked. Can you clear one more doubt ?
Actually i m using this value( like sales logix/products) to send as a target folder name where open deploy will deploy my output files. and if this folder(sales logix/products) does not exist on target server then they should be created. But i saw that though OD deploy says that deployment has been done successfully, i dont see any new folder created. If i remove the white space(like saleslogix/products) then two folder saleslogix and products are created and output files is also deployed successfully in producrs folder.
I dont know why it is behaving like this.
Any help will be appreciated.
Regards,
sachin
Adam Stoller
That would be a question for the OpenDeploy forum, and if you do post there - assume that nobody knows the history trail of this thread and provide ALL the relevant information in that post to make it easier for anyone who might respond.
That includes things like product versions, platform/OS versions, deployment configuration file, scripts, etc.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com