public interface Tasklet
This interface implements code that is executed on the server-side. The onExecute
method is what does the work that makes up a heart of a Tasklet. The implementation
of this method can perform any server-side logic that can be done
using Java. A SOAFaces container will call this method to kick off the processing
of the Tasklet when it is run as part of a job.
A Tasklet can optionally define an input and/or output JavaBean. The input/output JavaBeans allow a Tasklet to pass properties to other Tasklets that are part of the job/workflow.
Modifier and Type | Interface and Description |
---|---|
static class |
Tasklet.Scope
APP_SCOPE are cookies (name/value properties) that are shared between
all jobs runs of a Tasklet.
|
Modifier and Type | Method and Description |
---|---|
void |
onExecute(TaskletInputContext inputContext,
TaskletOutputContext outputContext)
Implement this method with virually any server-side code you want to execute.
|
void onExecute(TaskletInputContext inputContext, TaskletOutputContext outputContext) throws TaskletFailureException, JobExitException, TaskletApprovalException
Implement this method with virually any server-side code you want to execute. The container executing the Tasklet will invoke this method once the Tasklet is ready for execution.
A Tasklet can optionally use an input JavaBean as input to use during the execution of this method. The Tasklet can also store any relavent output that it wishes to expose or feed to other Tasklet, in the form of an output JavaBean, that execute later on in the workflow/job chain.
inputContext
- This context contains information related to the input state the
Tasklet is running in.outputContext
- This context contains information related to the output state the
Tasklet is running in.TaskletFailureException
- Thrown by the Tasklet to stop processing of the Tasklet.
Based on how the Tasklet is configured, this exception can also stop
all processing of the job.JobxitException
- Will force job to stop all processing. All proceeding Tasklet
(if there are any) will not execute. The job will stop processing as soon as
all other concurrent Tasklets have completed.TaskletApprovalException
- Will stop processing pending approval/rejection. Once
approved the job containing this Tasklet will pick up
where it left off. That means it begins executing
at the start of the Tasklet that threw this exception
and with all prior state. Note, it is invalid to throw
this exception if the Tasklet has other concurrent
Tasklets executing.JobExitException
Copyright © Grand Logic, Inc. All Rights Reserved.