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)
WFTask CallBack() and Active Tasks
djhalliday
Environment:
TeamSite 6.5 SP2
Windows 2003 EE
Question:
I'm using a cgitask to run a deployment of a dcr's content to a database. On completion of the deployment, the user can choose to proceed or to circle back to the previous task. Within the cgi task's perl script, this is accomplished by a call to CallBack() - the transitions being defined in the .wft file. I'm seeing some strange behavior with this aspect of the workflow, however. The transitions behave normally for an initial workflow for a DCR. If another workflow is spawned for the same DCR while another workflow is active, however, the transition to 'revise', or loop back, doesn't function correctly. Instead, when I refresh the workflow tab, there are no 'active tasks', and the log files show no errors. Is there some sort of workflow limit for a DCR in TeamSite that I may not be aware of that is causing CallBack to malfunction? I get the same result when using the iwcallback clt.
Thanks,
Derek
Find more posts tagged with
Comments
reddyl
I dont think there is a limit on number of active workflows for a DCR. Use iwcallback cgi_task_id succ_no comment to see if its transitions correctly or not.
djhalliday
As I stated in my initial post, using the clt iwcallback produces the same results: that is, the task is listed correctly under the 'Completed Tasks' section of the Job, with the correct transition label and transition comment. The 'active tasks' section, however, is empty.
reddyl
What is the retry task that should be active after the cgi task?
Did you check the iwprocoutput.log for any error messages?
Adam Stoller
If you have two workflows with the same file associated with both of them (not recommended) - and your tasks have the lock="t" attribute set - the problem is that one of the workflows is waiting to get the lock on the file. If you look at the output from iwgetwfobj for the job which doesn't seem to have any active tasks you can probably find one task which indicates that it is trying to get the locks - it's not "active", it's *waiting* to become active.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Herman
ya ,i have the some problen with you.
the task is under the 'Completed Tasks' section ,
but the 'active tasks' section is empty.
Now i get another problem,
the mail task has send the mail,
and I actually get the mail,
but the next task doesn't be actived.
I use the iwsend_servlet_mail.ipl
and use callback,but the mail task is still hang on "active tasks" section.
### Construct the email ###
my $url = "$webapp_url/viewtaskdetails?taskid=@{[ $target_task->GetId() ]}";
debug("url = $url\n");
my $mailer = new Mail::Mailer('smtp', Server => $mailserver);
my %headers = (
'To' => $recipient_email,
'From' => $taskowner_email,
'Subject' => "TeamSite Task Notification",
);
$mailer->open(\%headers);
print $mailer <GetOwner() ]} has assigned a TeamSite task to you.
To perform the task, please use the following link:
$url
Job description:
@{[ toBig5($job->GetDescription()) ]}
EOS
if ($target_task->GetDescription()) {
print $mailer <GetDescription()) ]}
EOS
}
my
@workcomments
;
$this_task->GetComments(\
@workcomments)
;
if (
@workcomments){
print $mailer "================ Job Comments ===============\n";
foreach my $cmt_hash (reverse(
@workcomments))
{
print $mailer " Date: ", $cmt_hash->{date}, "\n";
print $mailer " Task: ", $cmt_hash->{task}, "\n";
print $mailer " User: ", $cmt_hash->{user}, "\n";
print $mailer "\n";
print $mailer "> ", $cmt_hash->{body}, "\n";
}
print $mailer "=============================================\n";
}
my $iw_files = join("\n\t", $this_task->GetFiles());
if ($iw_files) {
print $mailer "==================== File list ===================\n";
print $mailer "\t$iw_files\n";
print $mailer "==================================================\n";
}
$mailer->close;
$this_task->CallBack(0, "Completed email notification");
Adam Stoller
A modified version of my previous response. The mail task may in fact have called the CallBack, but if the subsequent task has lock="t" set and, for some reason, is unable to get locks on all the files associated with the task - it will wait indefinitely until the locks can be gotten without completing the transition from the preceding task.
Running iwgetwfobj with the taskid of the "next" task (the one that *should* be active) will usually provide the information to verify this (I believe it's something like tryingtolock="t" though I could be wrong on the name of the attribute there - it's been a while since I've had to deal with this).
If you run into this problem - you can usually fix it by finding out which files are associated with the job / task - and manually, explicitly, unlock them (from GUI or command line) and then wait about 60 seconds and see if the task finishes the transition.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Herman
My mail task is aways active and the next task is not be actived.
And the subsequent task has lock="n" .
My workflow has two submit task ,
I found my workflow will be right when i remove my first submit task.
I think maybe muti-submit task will cause the mail task error.
Adam Stoller
Do your submittask's have different names?
Multiple submittask's in and of themseleves should not cause a workflow to hang like that.
I'd be curious to see the output from:
iwgetwfobj
taskid
- (a) where
taskid
is the mail task that you believe completed
- (b) where
taskid
is the task following the mail task that you believe should be activated
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Herman
Yes,my submittask have different name.
(a) taskId: 33819 MAIL Task NotifyQA was sent mail but didn't go to inactive task section in teamsite.
(b) taskId: 33823 GROUP Task QATest should be activated
i run iwgetwfobj then get
C:\Documents and Settings\Administrator>iwgetwfobj 33819
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<externaltask name="NotifyQA" owningworkflow="33814" lock="f" transferonly="f" r
eadonly="f" state="active" active="t" owner="server\abc" unactivatible="t"
tryingtolock="f" undoable="f" retry="f">
<description>Notify QA</description>
<areavpath v="\stroe\main\facture\WORKAREA\LMS_Reviews"/>
<activation>
<pred v="33815"/>
</activation>
<inactivate>
<pred v="33815"/>
</inactivate>
<resets/>
<predecessors>
<predecessor hasactivated="t" id="33815"/>
</predecessors>
<files>
<file path="ERP\LMS_PBK101.aspx" deleted="f" objid="0x000010084280084040
002401">
<comments>
<comment date="1115962963" user="server\Administrator" task="3382
5">task file</comment>
</comments>
</file>
</files>
<comments>
<comment date="1115962963" user="server\Administrator" task="33825">?�交
?�å??</comment>
<comment date="1115962970" user="server\Administrator" task="33815"/>
</comments>
<activationtime v="1115962970"/>
<unactivationtime v="0"/>
<variables/>
<successors>
<successorset description="ToQA">
<succ v="33823"/>
</successorset>
</successors>
<transitionmade v="-1"/>
<command v="C:/iw-home/iw-perl/bin/iwperl.exe C:/iw-home/bin/iwsend_servlet_
mail.ipl NotifyQA qa"/>
</externaltask>
C:\Documents and Settings\Administrator>iwgetwfobj 33823
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<grouptask committed="f" retainowner="t" name="QATest" owningworkflow="33814" lo
ck="f" transferonly="f" readonly="t" state="inactive" active="f" owner="<no u
ser>" unactivatible="f" tryingtolock="f" undoable="f">
<description>QA Test The Files</description>
<areavpath v="\store\main\facture\WORKAREA\LMS_Reviews"/>
<activation>
<pred v="33819"/>
</activation>
<inactivate>
<pred v="33819"/>
</inactivate>
<resets/>
<predecessors>
<predecessor hasactivated="f" id="33819"/>
</predecessors>
<files/>
<comments/>
<activationtime v="0"/>
<unactivationtime v="0"/>
<variables/>
<successors>
<successorset description="Pass">
<succ v="33818"/>
</successorset>
<successorset description="ToQA">
<succ v="33824"/>
</successorset>
</successors>
<transitionmade v="-1"/>
<users>
<group v="server\QATest"/>
</users>
</grouptask>
Please help me ,thanks.
Adam Stoller
I think I may have found your problem:
...
<externaltask name="
NotifyQA
" ...>
...
<successors>
<successorset description="ToQA">
<succ v="
33823
"/>
</successorset>
</successors>
<command v="C:/iw-home/iw-perl/bin/iwperl.exe C:/iw-home/bin/
iwsend_servlet_mail.ipl NotifyQA qa
"/>
</externaltask>
First, the first argument to
iwsend_servlet_mail.ipl
is supposed to be the name of the
target
task / the task to which you want the email to refer. In your case - you're passing it the name of the email task (
NotifyQA
) - but it should really be the name of the task to which you will be transitioning (
QATest
).
Second, I believe
qa
should be a fully qualified Windows username - like
server\qa
- however, this may not be a problem if the default evaluation happens to be correct.
Third, and probably most importantly, I'd generally recommend using either
iwsend_mail.ipl
or
iw_solution_email.ipl
as I believe
iwsend_servlet_mail.ipl
is old and largely unmaintained (along with
iwsend_owner_mail.ipl
) and the code for interacting with the Mail::Mailer module was never
fixed
as it is in the other, more well-maintained scripts.
If you look at the code in
iwsend_mail.ipl
you'll see something like this:
...
eval {
$mailer->open(\%headers);
print $mailer $message;
$mailer->close;
};
if ($
@){
. "\n To:\t" . join(", ", @{ $headers{To} })
. "\n From:\t" . $headers{From});
my($callback) = (defined($$oref{e}) && $$oref{e} != 0) ? 1 : 0;
$$href{task}->CallBack($callback,
"ERROR: Unable to send notification: $
@)
;
}
else {
debug("Success sending email to: " . join(", ", @{ $headers{To} }));
$$href{task}->CallBack(0, "Completed email notification");
}
If you look at the code for
iwsend_servlet_mail.ipl
- you'll instead see something like:
...
$mailer->open(\%headers);
print $mailer <close;
$this_task->CallBack(0, "Completed email notification");
The problem is, if
anything
goes wrong during the attempt to send email - the older scripts (such as you are using) will simply die - and never reach the CallBack line.
I see several choices here:
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Herman
ya, I appreciate your response.
I get much from you.
I think i use
iwsend_servlet_mail.ipl
it 's a problem.
If use iw_solution_email.ipl is more architecture,
To study how to use iw_solution_email.ipl and iwsend_mail.ipl is need for me.
Adam Stoller
iwsend_mail.ipl is pretty simple - run from the command line with '-h' for usage.
iw_solution_email.ipl is a bit more complicated, but more flexible - I think you'll have to read the code for a better understanding of it.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com