public interface TaskletOutputContext
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getOutputBean()
Returns the default output JavaBean that is persisted on the server if one is defined.
|
void |
saveOutputBeanCheckpoint()
The output JavaBean for a Tasklet is saved and persisted automatically once the Tasklet as
finished running.
|
void |
sendAlert(java.lang.String msg)
Send error/warning alert to all interested parties.
|
void |
sendAlert(java.lang.String msg,
java.lang.Throwable ex)
Send error/warning alert to all interested parties.
|
void |
setCookie(java.lang.String name,
java.lang.String value,
Tasklet.Scope scope)
Cookies are Tasklet properties that are shared between Tasklet runs.
|
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 a tasklet as it runs.
|
void |
setCustomStatusMessage(java.lang.String message)
Set a user defined custom status message for a Tasklet 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 getOutputBean()
Returns the default output JavaBean that is persisted on the server if one is defined. The corresponding tasklet may edit this output JavaBean as it chooses to save the ouput state of the itself.
Having an output JavaBean is optional. If one is not defined
then null
is returned. The object type
is defined in the SOAFaces definition and must have a default
constructor. You should cast this object
before using it. If the output JavaBean has not been saved before, then
a default object is returned, otherwise the saved version is returned.
null
if output JavaBean is defined for this Tasklet.void saveOutputBeanCheckpoint()
@Deprecated void setUserExitStatus(int status)
setCustomStatusCode(int)
status
- @Deprecated void setUserExitMsg(java.lang.String message)
setCustomStatusMessage(String)
message
- void setCustomStatusCode(int status)
Set a user defined custom status code for a tasklet as it runs. This method can be called repeatedly to update on-going status code changes as the Tasklet runs. This method can be used to show the on-going progress of a Tasklet as the Tasklet runs or to just report on the final status code of the Tasklet when it finishes running.
This method is used by Tasklet reporting GUIs to display the custom status code of a Tasklet as it runs or after it has finished running to keep the user informed on the status of the Tasklet as it runs or to show the final status of a job/Tasklet run.
You may call this method repeatedly for the same property name, if you need to update the same property value as the Tasklet is running. This will be then availlble to the RuntimeViewer for display.
This status property is available to RuntimeViewer GWT GUIs, if one is associated with the Tasklet. This allows developers to customize GWT GUIs to monitor output status that is reported by the Tasklet as the Tasklet runs.
status
- Any custom defined code.RuntimeViewer
,
IOViewerContext
void setCustomStatusMessage(java.lang.String message)
Set a user defined custom status message for a Tasklet as it runs. This method can be called repeatedly to update on-going status message changes as the Tasklet runs. This method can be used to show the on-going progress of a Tasklet as the Tasklet runs or to just report on the final status message of the Tasklet when it finishes running.
This method is used by Tasklet reporting GUIs to display the custom status message of a Tasklet as it runs or after it has finished running to keep the user informed on the status of the Tasklet as it runs or to show the final status of a job/Tasklet run.
You may call this method repeatedly for the same property name, if you need to update the same property value as the Tasklet is running. This will be then availlble to the RuntimeViewer for display.
This status property is available to RuntimeViewer GWT GUIs, if one is associated with the Tasklet. This allows developers to customize GWT GUIs to monitor output status that is reported by the Tasklet as the Tasklet runs.
message
- Any custom defined message. Recommended to keep this no more than 255 characters.RuntimeViewer
,
IOViewerContext
void setCustomStatus(int status, java.lang.String message)
status
- message
- void sendAlert(java.lang.String msg)
void sendAlert(java.lang.String msg, java.lang.Throwable ex)
void setCookie(java.lang.String name, java.lang.String value, Tasklet.Scope scope)
Cookies are Tasklet properties that are shared between Tasklet runs. Cookides can be used in two scenarios:
RUN Scope Cookies: Retry Scenario
If a job run fails and the job is later retried, the cookies that are set with this scope are avaialble
to the retry job runs via the TaskletInputContext.getCookie()
method.
If cookies are set in a
particular job/Tasklet run and then the job fails during processing, and is later retried,
the cookies will be passed to the job/Tasklet that is retried. The cookies may, for example,
contain data that can be used to allow the newly retried Tasklet to pickup
processing where the previous job/Tasklet run had left off.
Viewing Cookies Manually
The cookie properties are available to the RuntimeViewer and Weblet GWT GUIs that are associated
to a Tasklet. This allows developers to
customize GWT GUIs to monitor progress and status reported by the Tasklet as the
Tasklet runs (RuntimeViewer) and during design time (Weblet).
See IOViewerContext.fetchTaskletStatus()
for how to
request the APP and RUN scope cookies (and other Tasklet related properties)
from your RuntimeViewer GWT client. And
WebletContext.fetchAppCookie()
for how to view APP scope cookies from a Weblet.
If you need to send complex table or array data to the RuntimeViewer, it is recommended you send this as a serialized JSON string in a cookie. This can then be parsed more efficiently by the GWT RuntimeViewer to display the status details in the GUI.
name
- Name of the cookie.value
- Any string value. Recommend to save as a JSON string, if you need to save complex data
structures that will be read by RuntimeViewer GWT client. If value null the cookie
will be removed.scope
- Scope the cookie applies to.IOViewerContext#fetchTaskletStatus()(FetchTaskletStatusCallback callback)
,
TaskletInputContext#getCookie(String name, Scope scope)
Copyright © Grand Logic, Inc. All Rights Reserved.