NAME

WFA::Job - A job object, representing a single WFA job

METHODS

my $workflow = $job->workflow()

Retrieve the workflow associated with this job. Returns a WFA::Workflow object.

my $job_id = $job->id()

Get the unique id of the job.

my $job_start_time = $job->start_time()

Get the start time of the job. This is a string formatted by WFA of the format Jan 29, 2015 2:26:14 PM.

my $job_end_time = $job->end_time()

Get the end time of the job. This is a string formatted by WFA of the format Jan 29, 2015 2:26:14 PM.

my %job_parameters = $job->parameters()

Get the parameters passed when executing the workflow. Example:

(
  Parameter1 => 'value1',
  Parameter2 => 'value2',
)

my $job_status = $job->status()

Get the status of the job. This is a string that can be one of COMPLETED, FAILED, CANCELED, OBSOLETE, or SCHEDULED.

my $job_is_running = $job->running()

Returns true if the job is still running (not completed or failed).

my $job_was_successful = $job->success()

Returns true if the job has completed and was successful.

$job->refresh()

The $job object does not automatically update as state changes on the WFA server. Call refresh to update in-place the state of the $job object. This is absolutely necessary if you are polling for completion with methods such as running and success.

$job->poll_for_completion()

Wait until the job is complete, regularly polling the WFA server. This is equivalent to:

while ($job->running()) {
  $job->refresh();
  sleep(5);
}