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)
Problem in adding task file using external task
saumil
Hi,
I have written workflow that have one external task, which is reading one record file (contains list of dcr).
I am adding all listed dcr as task file in external task.
Normally it works fine, but if dcr path contains
space
then it is not adding that dcr as task file.
My code is something like below.
if(-e $dcrFile){
#try to add as task file
if($task->AddFile($dcr,"$dcr to delete")){
debug("DCR Added ->".$dcr);
}else{
debug("DCR Not Added ->".$dcr);
}
}else{
#if dcr is not exist.
&debug("Not Exist ....".$dcr);
}
Saumil Shah
Technical Associate
Mahindra and British Telecom
+0919819890479
Find more posts tagged with
Comments
Jeremy
In my experience with Windows and Teamsite I have found it better to tell the users, and to enforce it via code, that spaces and special characters are not allowed in filenames/paths.
This will make your life a lot easier in the long run.
If you HAVE to have spaces try putting the $dcr in quotes when it is defined. Have no idea if that'll work but it might be worth a shot.
Edited by Jeremy on 09/30/04 02:03 AM (server time).
saumil
Hi,
I have already tried by putting path in ' ' , but it is also not working.
Saumil Shah
Technical Associate
Mahindra and British Telecom
+0919819890479
Migrateduser
I agree with Jeremy in that spaces in filenames is just bad form, but maybe you can put an event handler that replaces the filename's spaces with underscores?
Shot in the dark here, but I wonder if you tried escaping the spaces, i.e. "\ " -- I know Unix likes that and I's likes Unix, but I'm not sure how Windows would treat that.
Dave
saumil
Hi,
actually it's business rule not to have whitespace/special char. in dcr name/path.
but it was created previously and i have to delete all those from database too.
if i'll change the path by changing to '_' or any other, it will not solve my purpose.
simply i want to add those file as task file, without changing path.
Saumil Shah
Technical Associate
Mahindra and British Telecom
+0919819890479
Migrateduser
I wouldn't turn to this by default, but you can always make a system call in your Perl:
<iw-home>/bin/iwaddtaskfile <taskId> "<vpath>"
The quotes will address the space issue.
Dave
Migrateduser
Along those lines, you could go in and modify WFtask.pm to do exactly that. Naturally, this is unsupported and bad, bad, bad, but you do what you gotta do.
Migrateduser
Rob, I'm surprised! With what you've learned recently, I thought you would have written it like this:
... this
is
unsupported
and
bad
,
bad
,
bad
, but you can
do
what you
gotta
do.
Dave
Migrateduser
Just a quick note -- I actually had to edit that. It seems that the "using HTML and Markup" setting didn't work for me, either -- only the HTML took effect in that instance.
Dave
saumil
Hi,
Tahnx for giving solution.
it's working fine.
is it get solved in latter version ? (mine is 5.5.2).
Saumil Shah
Technical Associate
Mahindra and British Telecom
+0919819890479
Migrateduser
I wouldn't be so sure that it's solved as of v 6.1 -- I've had recent problems implementing the same exact thing as what you're trying to do.
Dave
Migrateduser
FYI, I tested this in TS 6.1, and it correctly attaches files that contain a space in the name...
but they still haven't fixed the wrong documentation of return codes (0 on error, non-zero on success)...and not only do you not get "0" on error, you don't get anything, not even the error message that goes to Standard Out! any suggestions, short of modifying WFtask.pm or just using the CLT directly?
thanks,
-Rori