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)
email task
Bhargav Coca
Hello,
I am on TS 6.5 on Win2k. I have a workflow which works fine for any number of reviewers. If i have a no reviewers, it works fine too, except for an external task "Email Task" at the end. This task works fine for any number of reviewers, but if we do not specify reviewers it blows up. I tried to debug it, using the workflow debugger, it appears that the task is active and owner of this task is 'iw_user'. But for some reason it gets stuck at this point in the workflow without ending it.
So i tried "iwgetwfobj.exe" providing this Jobid and this particular task id for email task. Now i see the result where the owner being "SYSTEM" instead of 'iw_user' may be thats the reason it is failing without sending email to me. How can one make the owner to be me when reviewers are "0". Please advice, Thank in advance.
Find more posts tagged with
Comments
Adam Stoller
I think you're chasing the wrong end of the problem.
Looking at the output from iwgetwfobj - you should see the actual command being executed.
You need to run that command from the command line yourself - providing it the correct command line arguments (jobid, taskid, etc.) so that you can see what *that* script is doing.
I believe you are using the solutions email script - which is, in turn, going to use PTs to generate the mail - my guess is that one of the PTs you are using is expecting there to be reviewers and doesn't know what to do when there aren't any - and instead of gracefully exiting or side-stepping the problem - it croaks and the task ends up hanging.
So - I believe you need to debug the PTs used by that last email task.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
fundingsourcedetails_dates_nocategory_export.rptdesign
Bhargav Coca
thank you fish, Lets assume you are right. But, i have an other email tasks in my workflow which work for "0" reviewers. And i haven't changes anything in the tpl file at all. I donno why this email task fails.
here is the sample tpl which i am using.
<iw_comment>
File: <iw-home>/local/config/wft/solutions/ccmail_header.tpl
This is a Mail Header presentation template for use with Content Center.
It can be used with iw_solution_email.ipl to create an email header.
This template is applied to an XML document that contains information
regarding a workflow job and tasks within that job. The output of the
template is an XML file that conforms to the DTD header_xml.dtd in the
<iw-home>/local/config/wft/solutions directory.
If you want to check the well-formedness of the XML file, you can use
the tool: iw-home/private/bin/iwxmlval <path-to-the-xml-file>
We assume that:
dcr.workflowinformation.task[0] is the email task itself, and
dcr.workflowinformation.task[1] is the subject task.
</iw_comment>
<iw_perl>
<![CDATA[
use Date::Manip qw(UnixDate);
use TeamSite:
Tparser qw(xml_escape);
# Use GMT as the timezone if it cannot be determined.
if (($^O eq "MSWin32") && ! exists $ENV{TZ} && ! defined $main::TZ)
{ $main::TZ = "GMT"; }
# TeamSite installation directory
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
my $user_task = iwpt_dcr_list('dcr.workflowinformation.task')[1];
my $areavpath = iwpt_dcr_value('user_task.areavpath@v');
my $workarea_name = "$areavpath";
$workarea_name =~ s/^.+WORKAREA[\/\\](.+)$/$1/;
# For the project name, use the last segment of the branch name.
my $project_name = "$areavpath";
if ($project_name =~ m/([^\/\\]+)[\/\\](WORKAREA|STAGING)/) {
$project_name = $1;
}
# Get the host name
my ($iwcfg) = "$iwhome/bin/iwconfig iwwebd";
(my $hostname = `$iwcfg host`) =~ s/\n$//;
my $message_id = '<IWOV.' . (int(rand 32000) + 1) . '@' . $hostname . '>';
# For the Subject: line, use the following from the user task:
# - the project name
# - the task name
# - the task ID (in square brackets)
# - the task description, and
# - if this is a group task without an owner, "(Group Task)"
my $subject = "Success Email "
. " [" . iwpt_dcr_value('user_task@id') . "] : "
. iwpt_dcr_value('dcr.workflowinformation.workflow.description');
sub xml_escape
{
return TeamSite:
Tparser::xml_escape(shift);
}
]]>
</iw_perl>
<headers>
<iw_comment>
Send the message to the owner of the task.
If the target task does not have an owner (i.e., owner = "<no user">)
then send the task to each user and group in the "users" element.
You can also hard-wire addresses. For example:
<iwov_emailmap user='jsmith' />
</iw_comment>
<to>
<iw_if expr='{iw_value name="user_task@owner"/} ne "<no user>"'>
<iw_then>
<iwov_emailmap user='owner' />
</iw_then>
<iw_else>
<iw_iterate var='user' list='user_task.users.user'>
<iwov_emailmap user='{iw_value name="user@v"/}' />
</iw_iterate>
<iw_iterate var='group' list='user_task.users.group'>
<iwov_emailmap user='{iw_value name="group@v"/}' />
</iw_iterate>
</iw_else>
</iw_if>
</to>
<!-- You can CC additional addresses. For example: -->
<cc>
<!-- <iwov_emailmap user='jane.doe' /> -->
</cc>
<!-- From the owner of the email task -->
<from>
<iwov_emailmap user='{iw_value name="dcr.workflowinformation.task[0]
@owner"/}
' />
</from>
<subject>
<iw_value name="xml_escape($subject)"/>
</subject>
<!-- Other headers -->
<other_header name="Date"><iw_value name='UnixDate("today","%g")'/></other_header>
<other_header name="Message-ID"><iw_value name="xml_escape($message_id)"/></other_header>
</headers>
thanks
Adam Stoller
Have you tried running the command for that task from the command line?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
report.zip
Bhargav Coca
here is my email task from the debug mode with no reviewers selected.
<externaltask name="Success Email" owner="NECWEB\andyb" description="Success">
<areavpath v="/default/main/NECWEB/WORKAREA/andy"/>
<successors>
<successorset description="Finish">
<succ v="End"/>
</successorset>
</successors>
<command v="C:\Interwoven\TeamSite/iw-perl/bin/iwperl C:\Interwoven\TeamSite\local\config/wft/solutions/iw_solution_email.ipl -t "Author Work""/>
<activation>
<pred v="Deploy"/>
</activation>
<variables>
<variable key="iw_mailbody_pt" value="author_iwmailbody.tpl"/>
<variable key="iw_mailbody_text_pt" value="author_textbody.tpl"/>
<variable key="iw_mailheader_pt" value="C:\Interwoven\TeamSite\local\config/wft/andy/ccmail_header2.tpl"/>
</variables>
</externaltask>
In the author_iwmailheader.ipl there is a statement as follows, is this right?
<iw_include pt="ccmail_header1.tpl"
type_of_task_param="iw_user"
mode="ptlocal" />
Thank you
Adam Stoller
Run this command from the command line:
c:\Interwoven\TeamSite\iw-perl\bin\iwperl C:\Interwoven\TeamSite\local\config\wft\solutions\iw_solution_email.ipl -t "Author Work"
jobid
taskid
areavpath-of-task
And see what happens.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
You may also want to turn on debugging from within iw_solution_email.ipl. Doing this creates an XML spec of the calling task (in this case, "Success Email") and the target task ("Author Work"), as well as workflow information. This spec is created in <iw-home>/tmp and is called "task_outputxxxxx.xml" where xxxxx is your task number.
Dave
Environments:
(1,2) TS6.5, TS6.5SP1 on W2K3
(3) Vignette V7 Portal on Solaris 9