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)
Hung workflows
xsriniva
Some of our workflows get hung in the external tasks.Can we programmatically determine if some workflow is hung or not.Please let me know.
Find more posts tagged with
Comments
Migrateduser
Define "hung". Have you debugged the script enough to know which command they are getting stuck on? Have you debugged the script outside of workflow? You could potentially make use of an
eval
statement, but without knowing what you mean by "hung" it's hard to say.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Migrateduser
I posted some workflow reporting code that might help you with this a while back but now I can't find my post. Basically you want to use some of the TeamSite modules to loop through all tasks, locate externaltasks that are active and report them. I guess you could use iwquerytasks instead, but this is what I did.
But you might want to add a timeout to all externaltasks that activates an error recovery task.
use TeamSite::WFsystem;
use TeamSite::WFtask;
use TeamSite::WFworkflow;
use TeamSite::Config;
use File::Basename;
use Getopt:
td;
my $system = new TeamSite::WFsystem;
if ( ! defined( $system ))
{
die( "ERROR : $script : unable to create WFsystem object" );
}
my $tasks = $system->GetActiveTasks();
my %counts = ( total => 0 );
my %reports = ();
foreach my $task (
@$tasks
)
{
my $type = $task->GetType();
my $wfid = $task->GetWorkflowId();
my $taskID = $task->GetId();
if ( $type =~ m#(external|submit)# )
{
print "\nWorkflow $wfid Task $taskID is an open $type.\n";
}
}
laj1
I'll go out on a limb here, and ask if your external task does its callback() into the workflow so that the workflow can transition to the next task.
Len Jaffe
My Heart Is A Flower
Update your DevNet profile - let us know who you are!
Migrateduser
I think you can also do View->All Jobs in WebDesk Pro, then click in the pane that contains the job ID, press CTRL-F (in IE) and search for externaltask.
Migrateduser
Cleaned up a bit.
use strict;
use TeamSite::WFsystem;
my ${report} = '';
my ${wfsys} = new TeamSite::WFsystem();
if ( ! defined( ${wfsys} ))
{
${report} .= 'ERROR : unable to create object of type TeamSite::WFsystem.' . "\n";
}
else
{
my ${tasks} = ${wfsys}->GetActiveTasks();
foreach my ${task} (
@${tasks}
)
{
if ( ${task}->GetType() =~ m#(external|submit)#i )
{
${report} .= 'Workflow ' . ${task}->GetWorkflowId() . ' Task ' . ${task}->GetId() . ' appears to be a stalled ' . ${task}->GetType() . '.' . "\n";
}
}
${tasks} = ${wfsys}->GetTasks();
foreach my ${task} (
@${tasks}
)
{
if ( ! ${task}->IsValid())
{
${report} .= 'Workflow ' . ${task}->GetWorkflowId() . ' Task ' . ${task}->GetId() . ' appears to be an invalid ' . ${task}->GetType() . '.' . "\n";
}
}
}
print ${report};
exit( 0 );