We have a external task to send a mail in the wft file.We provide the users with a link to the files that are a part of the workflow.However we need to suppress the links to files in case they are DCRs.The extended attribute for a dcr seems to be iw_form_valid.I am new to TeamSite and have no previous PERL experience.Please help me find the right way to check if a file is a DCR in an ipl.Regards,Arshiya
#/iw-home/iw-perl/bin/iwperl# components declarationuse strict;use TeamSite::Config;# Get IW home and mount(my $iwhome = TeamSite::Config::iwgethome()) =~ s|\\|/|g;(my $iwmount = TeamSite::Config::iwgetmount()) =~ s|\\|/|g;# Prepare and execute iwextattrmy $full_path = qq(Full Tested File Path);chomp(my $file_type = qx($iwhome/bin/iwextattr -g TeamSite/Templating/DCR/Type $full_path));if (($? == 0) && ($file_type)) { # This is a DCR}else { # This is not}
...my @linkfiles = grep { !/templatedata/ } $task->GetFiles();...
Although the previous reply will work - it would be more efficient to just do something like this:...my @linkfiles = grep { !/templatedata/ } $task->GetFiles();...Going the EA route means you have to create a shell process to run iwextattr for each file associated with the task - going the above route avoids any system calls.
...keep JS in templatedata (bad idea IMHO but people do)
Why would you consider it a bad idea? I keep FormAPI-related JS (and only FormAPI related JS!) on the templatedatalevel for the Branch(Application)-shared components and together with related datacapture.cfg (as a peer) for the Type-specific modules. Both JS names are fixed - and I need only two. Works pretty well, not that I can't contemplateanother schemaWhat do you think?
You need to go to GearUp to get the details
Of course if you submit the DCT or TPL or keep JS in templatedata (bad idea IMHO but people do) then you need to filter it out. I would follow Bo's suggestion.
You need to go to GearUp to get the details. & I assume there will be a lot of audience participation like my last presentation. However 2 reasons, access control and code reuse.
We're talking about filtering out files from showing up as links in the email sent out by a workflow - not from being processed by the workflow. So I still believe the code I posted will do the job and be far more efficient than running iwextattr on each file to try to determine if it is a DCR ...