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)
grouptask
Bhargav Coca
I am on Teamsite 6.5 on win 2k3 server. I am using the example workflows in the iw-home/local/wft/solutions section. I am using "author_submit_with_email.wft" Instead of usertask="Approver", i am making that a grouptask="Approver", i have made changes accordingly which are required for the grouptask. I have my email_map.cfg and iw_soultion_email.ipl configured accordingly. Here is the code where i am extracting the approvers user id's. Can anyone tell me how to use these to send mails to the approvers? Here is the extraction code
#!F:/iw-home/iw-perl/bin/iwperl.exe
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $roles = "$iwhome/conf/roles";
my $groupFile = "$roles/editor.uid";
my ($userList, $user);
open (UID, $groupFile) or return $userList;
$userList = "<!-- Web Services Users -->";
while (<UID>) {
chomp;
$user = $_;
if (($user =~ /^(\s*)#/) || ($user !~ /\S/)) { # skip comment lines, skip blank lines
next;
} else {
$user =~ s/^((.*?)#(.*))/$2/; # grab text before a # sign
$userList .= "\n";
$userList .= " <user v = '$user'/>";
print("$user");
}
}
thank you
Find more posts tagged with
Comments
Migrateduser
Just as you'll have an external task to send the email to a single approver, you would need an external task to send the email to a series of approvers. No difference, really. You already have your list of approvers, so iterate through them and run them through the sendmail script.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
jbonifaci
Or modify the email script to take an attribute that is a delimited list of users to send a group email:
-g "email@address.one|email@address.two|email@address.three";
Bhargav Coca
where do you want me to do the iteration. In the Approval stage before going to the email task? Please let me know. And i can just call my *.ipl file in the approver task using the <command v=.....> right?
Please let me know as where i have to include my iterations.
Thank you
Migrateduser
Actually, Jeff hit the nail right on the head. Use that syntax and it'll work just fine. You might need to call the sendmail script FROM an external task, unless you can programmatically construct the list of recipients from within your WFT file.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
Bhargav Coca
can i send the <hostname>\<username> as one entity to my iw_solution_email.ipl, or should i have to break it down to only userid?
Thank you
Migrateduser
You would send their ID according to how they log in to TeamSite, but the script itself has some fairly elaborate usage notes within the script.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
Sample.zip
Bhargav Coca
will this work inside the group task,
#!F:/iw-home/iw-perl/bin/iwperl.exe
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $roles = "$iwhome/conf/roles";
my $groupFile = "$roles/editor.uid";
my ($userList, $user);
open (UID, $groupFile) or return $userList;
$userList = "<!-- Web Services Users -->";
while (<UID>) {
chomp;
$user = $_;
if (($user =~ /^(\s*)#/) || ($user !~ /\S/)) { # skip comment lines, skip blank lines
next;
} else {
$user =~ s/^((.*?)#(.*))/$2/; # grab text before a # sign
$userList .= "\n";
$userList .= " <user v = '$user'/>";
print("$user");
__INSERT__(get_cmd("iw_solution_email.ipl", "$user"));
}
}
Please advice,
thank you
Migrateduser
I'd check the usage syntax of iw_solution_email.ipl but all of your other code looks like it would work, albeit not as efficiently as it could.
As Jeff pointed out, you could modify this script to be able to take all N addresses at once. This will improve performance greatly over calling the script N times. If you'd rather not do that, then your code will work. But, like I said, you might need to modify your syntax when calling iw_solution_email.ipl.
Dave
Current Environment(s):
(1) TS 6.5 on W2K3
(2) TS 6.1 SP1 on W2K3
By the way, I miss Unix terribly.
james1
It sounds like you want the "Email_Approver" task to send e-mail to a large group of users, instead of just to the one user that would have owned the "Approver" usertask, which you have now turned into a grouptask. The "reviewer_iwmailheader.tpl" e-mail template, which is configured in the WFT to generate the mail headers for the "Email_Approver" task, will automatically adjust the recipients of the e-mail to be all users/groups sharing the grouptask. So, I don't think that you need to do anything regarding the e-mail -- you only need to change the usertask to a grouptask and set up a list of sharedby users and groups.
Hope this helps.
-- James
--
James H Koh
Interwoven Engineering
Bhargav Coca
thank you James, that is exactly i was trying to do, but not successful yet. Here is my workflow as an attachment. my editorlist.ipl is the file i posted above in the post. see if this works. well it certainly is giving errors for me.
thank you in advance.
james1
First of all, a "<command>" element will not execute the specified program during WFT instantiation, nor will it insert its output into the job specification. Second of all, a "<command>" element is not valid where you have placed it -- inside a "<sharedby>" element.
(If these facts come as a surprise to you, then you may need to become more familiar with WFT development, by reading the manual and/or taking some courses.)
You should replicate the Perl code inside editorlist.ipl in your WFT and use it to insert your "<user>" elements inside the "<sharedby>" element.
Finally, have you looked into the configurable_author_submit.wft workflow? It will do all that you need, and more, without the need for modifying the WFT code. You would only need to edit its config file. It does support grouptasks for approvers, and it will send e-mail to everyone listed in the "<sharedby>" of the grouptask. I strongly urge you to look into this avenue.
Hope this helps.
-- James
--
James H Koh
Interwoven Engineering