KBEC-00249 - Retreiving Transition History in a Workflow

Summary

How can I tell which states were called, and which transitions were taken. A view such as:

Start \-> State 2 (succeeded) \-> State 3 (succeeded) \-> State 4 (failed) \-> End

 

Solution

Use the findObjects API on logEntry, and the filter with containerName equal to your workflowName. Something like:

$[/projects/EC-Admin/scripts/perlHeader]
$[/projects/EC-Admin/scripts/perlLib]
 
my $wkfName="workflow_222_201308090956";
 
# create filterList
my @filterList;
# get only log associated to my workflow
 
push (@filterList, {"propertyName" => "containerName",
                    "operator" => "equals",
                    "operand1" => "workflow_222_201308090956"});
push (@filterList, {"propertyName" => "containerType",
                    "operator" => "equals",
                    "operand1" => "workflow"});
 
my ($success, $xPath) = InvokeCommander("", "findObjects", "logEntry",
                                        {maxIds => 5000,
                                         filter => \\@filterList ,
                                         sort => [ {propertyName => "time",  order => "ascending"} \]});

It should return a number of objects like:

  logEntry-122325
  
    122325
    workflow-222
    workflow_222_201308090956
    Invoking the sub-job for state 'Test'
    project: Training_user
    INFO
    state-1319
    Test
    2013-08-09T16:56:29.586Z
  
  logEntry-122328
  
    122328
    workflow-222
    workflow_222_201308090956
    The sub-job 'job_34687_201308090956' for state 'Test' has completed
    project: Training_user
    INFO
    state-1319
    Test
    2013-08-09T16:56:29.788Z
   

Applies to

  • Product versions: All
  • OS versions: Supported platforms

Have more questions?

0 Comments

Please sign in to leave a comment.