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)
submiting deleted floders
megamala
How can we prevent users submiting the deleted folders from workflow. User should able to submit the folders,files and deleted files but not deleted folders.
When users try to submit select the files and deleted folders , they should get error msg. saying that you are not authorised to submit the deleted folders. Please unselect the deleted folders.
TIA
MM Guptha
Find more posts tagged with
Comments
herald10
check for that condition in the workflow. you might want to make it a CGI task or an external task. If you explain how your workflow is configured then probably some one can tell where exactly to insert that piece of code.
Migrateduser
I'd probably suggest some sort of external task that does a check if the "File" exists. If it doesn't exist, check if it exists in STAGING. If it does exist in STAGING and is a directory in STAGING, return an error. Otherwise procede as you normally would.
- Jason
megamala
I did like this it seems working fine. It checks before it initiates the task.
foreach my $file (__VALUE__('iw_file')) {
if (!(-e "$iwmount/$workarea/$file") && (-d "/$staging/$file")) {
die("Submitting deleted directories is not allowed.\n The Deleted Directores are $temp.");
}
}
TIA
MM Guptha
Migrateduser
That solution works well unless the user has the opportunity (either via user or group task) to add folders to the job which have been deleted. If you need to prevent that from happenning, you'd still want to have some sort of CGI or external task to prevent it.
- Jason
megamala
Thanks
In our case , users shouldn't allow to deleted folders add to the Job. Administrator submits the deleted folder using Submit Direct. Do you think in our case it works above code or any other issues. Please let me know.
TIA
MM Guptha
Migrateduser
Are you putting this code in your WFT? I guess it doesn't matter, but if you are you should use the
valid_input
attribute of a TAG_info field to do your validation, which allows you to gracefully let the user know they did something that is not allowed. Performing a
die
in the middle of processing is not good coding.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
nipper
>Performing a die in the middle of processing is not good coding.
You should re-read his post. (I think) he is doing this in the perl in the start of the WF and not
in an external task.
me
Migrateduser
Yes Mr. Smarty Pants I know. That means it's in the WFT, right? Why would you do a
die
in your WFT? Would you ever really want to kick a user out of the process that way? That's not clean and not a good user experience. Or am I completely missing the concept?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
I think Dave is right. His suggestion would be a cleaner user experience. I'm not even sure what would happen if you did a die in the middle of a workflow instantiation. I'm thinking it would be bad.
- Jason
megamala
Yes you are right. I am doing at the beginning of the code. We shouldn't not allow the users to kick the work flow if they select deleted folder. Do I use die? Is there going to create any other problems?
TIA
MM Guptha
nipper
>Do I use die? Is there going to create any other problems?
if you do not need the users to know why it is ending, use die.
Otherwise what Smitty suggested should provide some error reporting to the end user
Jeremy
Actually, if you do something like
$msg = "This is the reason for the Workflow dieing...\n";
die $msg;
Then it should print out the error to an alert box, although it does first say there was a Teamsite error, then it prints out the contents of $msg.
Although I agree this is probably not the best way to do this. Smitty, do you happen to have any code lying around that uses the "valid_input" method?
Thanks,
Jeremy
Edited by Jeremy on 05/06/04 08:58 AM (server time).