Hi there,
I have following WFT file (see below) and somehow the WF hangs on the external email task. WF invokes the email task just fine and that email task remains "active" task and hangs forever. It does NOT transition to next step so my only option is to login as Administrator and then "End Job" manually.
I looked through the file and could NOT tell what I am missing. Please help.
Any help will be appreciated.
Thx,
V.
Here is the WFT:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
<template_script><![CDATA[
#------------------------------------------------------------------------------
# File author_submit_with_email.wft
# Use modified workflow based on the default workflow for author seat
#
# Copyright 2001, 2002 Interwoven Inc.
# All rights reserved.
#------------------------------------------------------------------------------
use TeamSite::Config;
use TeamSite::JavaResourceBundle;
# Load the appropriate resource bundle for this page.
my $iwconfigs = TeamSite::Config::iwgetlocation("iwconfigs");
my $dir = $iwconfigs . "/wft/locale";
my $localizer = TeamSite::JavaResourceBundle->new();
my $propfile = "authorsubmit_" . __VALUE__('iw_locale');
my
@bundle = $localizer->load( $dir, $propfile );
my $submit_image = $localizer->format('submit_image');
my $submit_image_label = $localizer->format('submit_image_label');
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
##############################################
#=====================================================================
# Name: iw_getrole
# Args: role - basename of a TeamSite role (*.uid) file, or
# similarly constructed customized file in the
# same directory.
# Usage: $html = iw_getrole("master");
# Purpose: Generate an HTML formatted drop-down menu of all
# entries in named file for use within a TAG_info()
# section.
# Returns: Returns the generated drop down list on success, or
# a text field with an error message if it was unable
# to open the file.
#=====================================================================
sub iw_getrole{
my($role) =
@_;
$role .= ".uid" if ($role !~ /\.uid$/);
my($html) = "";
if (!open(IN, "<$iwhome/conf/roles/$role")){
$html = "<input type='text' value='--Error opening $role--'>";
}
else {
$html = "<select size='1'>\n<option>\n";
foreach (sort(<IN>)){
s/^\s*//gs; s/\s*$//gs;
$html .= "<option>$_\n";
}
close(IN);
$html .= "</select>\n";
}
return($html);
}
#=# (changed reference to renamed subroutine)
my($iw_admin_html) = iw_getrole("admin");
my($iw_masters_html) = iw_getrole("master");
my($iw_authors_html) = iw_getrole("author");
my($iw_editors_html) = iw_getrole("editor");
##############################################
my $banner_html=<<EOS;
<table cellspacing=0 cellpadding=3 class="iw-base-heading" style="width:100%;">
<tr width='100%'>
<td><img align=left valign=center width=125 height=18
src="$submit_image"
alt="$submit_image_label">
</td>
</tr>
</table>
EOS
CGI_info(
title => $localizer->format('page_title'),
error_label_bgcolor => "#EEEEEE" ,
locale => __VALUE__('iw_locale'),
cancel_label => $localizer->format('cancel_button_label') ,
submit_label => $localizer->format('submit_button_label') ,
banner_html => $banner_html,
);
my $sOwner = __VALUE__('iw_user');
my $uContributor = __VALUE__('iw_user');
my $uApprover1 = __VALUE__('uApprover1');
# my $cVPath = $cVPath;
my $uDescription = __VALUE__('uDescription');
TAG_info(
# The value of the tag "iw_submit_comment" (obtained from the user)
# will appear as a user variable on the submit task.
# It will also be used as the job's description.
iw_submit_comment =>
[ html => $localizer->format('submit_comment_label').
"<br><textarea rows=8 style='width:100%'></textarea>".
"<br> ",
error_msg => $localizer->format('submit_comment_error_msg'),
label => 'Description / comment',
],
uApprover1 => [html => "$iw_editors_html", is_required => 'true', label => "Approver1",],
# push iw_info_comment into workflow
iw_info_comment =>
[ html => $localizer->format('info_label1') .
"<br><input type=text size=50>".
"<p> <br><em>" .
$localizer->format('info_label2') . "</em>",
error_msg => $localizer->format('info_label_error_msg'),
is_required => 'false',
label => '',
],
iw_output_file => "<input type='text' value='/tmp/foo.xml'>\n",
iw_debug_mode => "<input type='text' value='true'>\n",
);
# make sure the file list is defined
my
@submit_file = (); # files sorted in unencoded
if (__ELEM__('iw_file')) # form, then html-encoded
{ # by hand via CGI_lite
@submit_file = map { TeamSite::CGI_lite::escape_html_data($_);
} sort __VALUE__('iw_file');
}
for (my $i=0; $i<
@submit_file; ++$i)
{
TAG_info(
"File_comment_$i" =>
[ html => $localizer->format('comment_label') .
" $submit_file[$i]<br>".
"<textarea rows=8 style='width:100%'></textarea>".
"<br> ",
error_msg => $localizer->format('comment_label_error_msg'),
is_required => 'false',
label => '',
],
);
}
sub get_cmd {
my ($program,
@parameters) =
@_;
my $parameter;
foreach (
@parameters) {
$parameter .= " -t " . "\"$_\"" ;
}
$parameter =~ s/\s$//;
my $cmd;
if ($^O eq "MSWin32") {
$cmd = '"' . __VALUE__('iw_home','html') .
"/iw-perl/bin/iwperl.exe\" " .
'"' . TeamSite::CGI_lite::escape_html_data($iwconfigs) .
"/wft/solutions/$program\"" .
"$parameter";
} else {
$cmd = TeamSite::CGI_lite::escape_html_data($iwconfigs) .
"/wft/solutions/$program" .
"$parameter"
}
$cmd = "<command v='$cmd'/>";
return $cmd;
}
]]></template_script><?xml version="1.0" standalone="no"?>
<!DOCTYPE workflow SYSTEM "iwwf.dtd">
<!--
This workflow works much like the TeamSite author seat.
The parameters are:
iw_areaowner Owner of the workflow
iw_file File to be worked on
iw_workarea Workarea
iw_user Current user
-->
<workflow name="Author Submit with Email"
owner="__TAG__('iw_user');"
creator="__TAG__('iw_user');"
description="__TAG__('iw_submit_comment');">
<externaltask name="Email_Approver"
owner="__TAG__('iw_user');"
start="t"
description="Approval WF.">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Author Content Approval">
<succ v="Approver"/>
</successorset>
</successors>
__INSERT__(get_cmd("iw_solution_email.ipl", "$uApprover1"));
<template_script><![CDATA[
if (
@submit_file != 0)
{
__INSERT__("<files>\n");
for (my $i=0; $i <
@submit_file; ++$i)
{
__INSERT__("
<file path='$submit_file[$i]' " .
"comment='__TAG__(File_comment_$i);'/>");
}
__INSERT__("</files>\n");
}
]]></template_script>
<activation>
<pred v="AuthorWork"/>
</activation>
<variables>
<variable key="iw_mailheader_pt" value="reviewer_iwmailheader.tpl"/>
<variable key="iw_mailbody_pt" value="reviewer_iwmailbody.tpl"/>
<variable key="iw_mailbody_text_pt" value="reviewer_textbody.tpl"/>
</variables>
</externaltask>
<usertask name="Approver"
owner="__INSERT__($uApprover1);"
description="Author Content Approval"
readonly="t">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Approve">
<succ v="Submit"/>
</successorset>
<successorset description="Reject">
<succ v="AuthorWork"/>
</successorset>
</successors>
<activation>
<pred v="Email_Approver"/>
</activation>
</usertask>
<usertask name="AuthorWork"
owner="__TAG__('iw_user');"
description="Author Work">
<areavpath v="__TAG__('iw_workarea');"/>
<successors>
<successorset description="Finish">
<succ v="Email_Approver"/>
</successorset>
</successors>
<activation>
<pred v="Approver"/>
</activation>
</usertask>
<submittask name="Submit"
owner="__TAG__('iw_areaowner');"
description="Content Submission"
unlock="t"
savecomments="t">
<areavpath v="__TAG__('iw_workarea');"/>
<successorset>
<succ v="End"/>
</successorset>
<activation>
<pred v="Approver"/>
</activation>
<variables>
<variable key="submit_cmt" value="__TAG__('iw_submit_comment');"/>
<variable key="submit_info" value="__TAG__('iw_info_comment');"/>
</variables>
</submittask>
<endtask name="End">
<activation>
<pred v="Submit"/>
</activation>
</endtask>
</workflow>