Hi all,
TS 6.7.1
WFM
Perl
I have an external task in my wokrkflow and one its external task loops through the workareas and executes the following in the perl script calling iwsend_wf_email.ipl:
[HTML]$email_cmd = qq($iwhome/iw-perl/bin/iwperl $iwhome/local/config/wft/monitor/$environment/iwsend_wf_email.ipl $wfid $taskid $dstWorkarea -H -t $wf_author -f $conf_reviewer -s "$email_subject");[/HTML]
The first time it goes it executes:
[HTML]
#In iwsend_wf_email.ipl
my($wfid, $taskid, $area) = (
@ARGV[0..2]);
@hash{"wfid", "taskid", "area", "job", "task"} =
(
@ARGV[0..2],
new TeamSite::WFworkflow($ARGV[0]),
new TeamSite::WFtask($ARGV[1]));
[/HTML]
Which works fine, initializes variables and instances of job and task and sends the email. However the second time it loops, the initialization for both the job and task fail and all the variables that depend on them fail too. It still sends the email, but just the html with no job/task related data at all.
Things that I triedI tried using the
wait keyword
[HTML]
my $email_cmdOut = system ("$email_cmd 2>&1");
debug("$dbgInfo", " email_cmd '$email_cmd'\n");
my $status = wait;
debug("$dbgInfo", " status '$status'\n");[/HTML]
Thinking that the child process didn't finish and that's why the the job/task didn't get initialized, but value of status was -1, but still didn't work.
Also I decided to catch the error by doing the following
[HTML]
my $taskComment;
if ($hash{task}->IsValid()){
$taskComment= "Valid task";
}else{
$taskComment= "inValid task";
$taskComment .= $hash{task}->GetError();
}
my $jobComment;
if ($hash{job}->IsValid()){
$jobComment= "Valid job";
}else{
$jobComment= "inValid job";
$jobComment .= $hash{job}->GetError();
}
[/HTML]
and the logs show:
[HTML]
jobComment is inValid jobXML parse error in WFworkflow.pm:
no element found at line 1, column 0, byte -1 at C:\Applications\Interwoven\TeamSite\iw-perl\vendor\lib/XML/Parser.pm line 187
taskComment is inValid taskXML parse error in WFtask.pm:
no element found at line 1, column 0, byte -1 at C:\Applications\Interwoven\TeamSite\iw-perl\vendor\lib/XML/Parser.pm line 187
[/HTML]
I've seen that this error occurs when users try to initialize a new workflow.
Perhaps the variable is already defined somewhere?
Moreover, Once the external task is done then there's another external task that calls the ipl and that seems to work fine cause it initializes the task/job variables and sends emails with the proper data.
Do you think the previous process still running and it can't initialize a new workflow object?
Any suggestions?
Thanks in advance.