public interface JobContext
This context is passed to a Tasklet when it gets executed. The same context is passed to all the Tasklets within a job during job execution.
This context contains job level information related to how the job/workflow is configured. It also contains runtime information relating to the status of the running Job.
Modifier and Type | Method and Description |
---|---|
void |
checkpoint()
Used to allow a job to be killed when running.
|
java.lang.Object |
getAttribute(java.lang.String name)
Get Tasklet runtime attribute that has been set using
setAttribute or
passed to the JobContext as an input property when the job is running. |
java.util.Set<java.lang.String> |
getAttributeNames()
Returns all the attribute names that can be fetched from
getAttribute() . |
java.lang.Integer |
getCustomStatusCode()
Get the custom status code set by the job.
|
java.lang.String |
getCustomStatusMessage()
Get the custom status message set by the job.
|
JobDependencyRule |
getDependencyRule(java.lang.String name)
Finds the dependency rule with the given name.
|
java.lang.String |
getDescription()
Description of the job.
|
java.util.Date |
getEndDateRange()
This works with
getStartDateRange() to define
a effective date range that this Tasklets will execute
under. |
long |
getID()
Unique id assigned to a job within a container.
|
MuleClient |
getMuleClient()
Provides access to all the capabilites available to a MuleClient.
|
java.lang.String |
getName()
User defined name of the job.
|
java.lang.String |
getPersistentPath()
Sandbox directory where Tasklets can create, edit,
delete, and read files.
|
java.util.Date |
getRunDate()
Date/Time the job began running.
|
long |
getRunID()
Unique id assigned to the instance of the running job within
a container.
|
java.lang.String |
getRuntimePath()
Sandbox directory where Tasklets can create,
edit, delete, and read files.
|
java.util.Date |
getSchedDate()
Date/Time the job was scheduled to run.
|
java.util.Date |
getStartDateRange()
Starting date range assigned to this job run.
|
TaskletOutputSummary |
getTaskletOutputSummary(long id)
Returns
TaskletOutputSummary for tasklet that has previously executed
and that matches the given unique id. |
java.util.List<TaskletOutputSummary> |
getTaskletOutputSummaryList()
Get list of
TaskletOutputSummary for tasklets that have previously
executed as part of this JobContext. |
java.lang.String |
getUserExitMsg()
Deprecated.
Replaced by
getCustomStatusMessage() |
java.lang.Integer |
getUserExitStatus()
Deprecated.
Replaced by
getCustomStatusCode() |
java.lang.String |
getUserName()
User name that executed this job, if user initiated, otherwise null.
|
WorkflowContainer |
getWorkflowContainer()
Returns handle to object for access to actions and functions
available to workflow container.
|
boolean |
isError()
Runtime status that reports error(s) logged by any Tasklets that
has executed or is executing within this job.
|
boolean |
isRetry()
If a particular run of job failed during processing (e.g. server crashed) and the
systee attempted to run the same job again, this method will indicate that this
is a retry job run.
|
boolean |
isWarning()
Runtime status that reports warning(s) logged by any Tasklet that
has executed or is executing within this Job.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set an attribute that can be accessed by any Tasklet that is part of this
JobContext while the job is running.
|
void |
setCustomStatus(int status,
java.lang.String message)
Set both the code and text message at the same time.
|
void |
setCustomStatusCode(int status)
Set a user defined custom status code for the overall job as it runs.
|
void |
setCustomStatusMessage(java.lang.String message)
Set a user defined custom status message for the overall job as it runs.
|
void |
setUserExitMsg(java.lang.String message)
Deprecated.
Replaced by
setCustomStatusMessage(String) |
void |
setUserExitStatus(int status)
Deprecated.
Replaced by
setCustomStatusCode(int) |
java.lang.Object getAttribute(java.lang.String name)
setAttribute
or
passed to the JobContext as an input property when the job is running.name
- name of the attributenull
is returned if no attribute is found with the given name.java.util.Set<java.lang.String> getAttributeNames()
getAttribute()
.void setAttribute(java.lang.String name, java.lang.Object value)
name
- value
- @Deprecated void setUserExitStatus(int status)
setCustomStatusCode(int)
status
- @Deprecated java.lang.Integer getUserExitStatus()
getCustomStatusCode()
@Deprecated void setUserExitMsg(java.lang.String message)
setCustomStatusMessage(String)
message
- @Deprecated java.lang.String getUserExitMsg()
getCustomStatusMessage()
void setCustomStatusCode(int status)
Set a user defined custom status code for the overall job as it runs. This method can be called repeatedly to update on-going status code changes as the job runs. This method can be used to show on-going progress of the overall job as the job runs or to just report on the final status code of the job when it finishes running.
This status code is used by job reporting GUIs to display the custom status code of a job as it runs or after it has finished running to keep the user informed on the overall status of the job as it runs or to show the final status code of a job run.
status
- A custom defined code.java.lang.Integer getCustomStatusCode()
void setCustomStatusMessage(java.lang.String message)
Set a user defined custom status message for the overall job as it runs. This method can be called repeatedly to update on-going status message changes as the job runs. This method can be used to show on-going progress of the overall job as the job runs or to just report on the final status message of the job when it finishes running.
This status message is used by job reporting GUIs to display the custom status message of a job as it runs or after it has finished running to keep the user informed on the overall status of the job as it runs or to show the final status message of a job run.
message
- Any custom defined message. Recommended to keep this no more than 255 characters.void setCustomStatus(int status, java.lang.String message)
status
- message
- java.lang.String getCustomStatusMessage()
long getID()
long getRunID()
java.lang.String getName()
java.lang.String getDescription()
java.util.Date getRunDate()
java.util.Date getSchedDate()
java.util.Date getStartDateRange()
null
if not defined. by the job. Normally
defaults to the last date/time the job ran.java.util.Date getEndDateRange()
getStartDateRange()
to define
a effective date range that this Tasklets will execute
under. Normally applicable to ETL or ERP type
processing.null
if not defined by the Job. Normally
defaults to the getRunDate
.java.lang.String getUserName()
null
if no user defined. null is normally
returned if the job is executed by a scheduling
engine as oppposed to being triggered by a user manually.java.lang.String getRuntimePath()
Sandbox directory where Tasklets can create, edit, delete, and read files. All Tasklets within a job share the same directory.
This directory and all its contents will only exist for the life of the running job. Once the job has terminated the directory and its contents will be destroyed.
java.lang.String getPersistentPath()
Sandbox directory where Tasklets can create, edit, delete, and read files. The directory persists across job executions.
The contents of the directory can only be deleted by the job itself or if the job gets deleted.
boolean isError()
boolean isWarning()
WorkflowContainer getWorkflowContainer()
void checkpoint()
boolean isRetry()
TaskletInputContext#getCookie(String name, Scope scope)
,
TaskletOutputContext#setCookie(String cookie, String value, Scope scope)
java.util.List<TaskletOutputSummary> getTaskletOutputSummaryList()
TaskletOutputSummary
for tasklets that have previously
executed as part of this JobContext. The list is returned in order that the tasklets executed.List
of TaskletOutputSummary
objects of
related Tasklets that have already run and completed earlier as part of this JobContext.TaskletOutputSummary getTaskletOutputSummary(long id)
TaskletOutputSummary
for tasklet that has previously executed
and that matches the given unique id.id
- Unique id of Tasklet.null
if no match is found.JobDependencyRule getDependencyRule(java.lang.String name)
MuleClient getMuleClient() throws MuleException
MuleException
Copyright © Grand Logic, Inc. All Rights Reserved.