Resume Points
Tasks have the option to support the resume function. When a task
is resumed in the user interface, the user requests the task to start
where it last successfully completed before a failure. It is the responsibility
of the task to identify where to set resume points in the processing
logic. If a task fails after it successfully set a resume point, the
user interface shows a Resume button that allows
the user to resume the task and start at this point in the logic rather
than from the beginning. The following example shows how a task can
set resume points.
public CompleteStatus runTask() throws TaskProcessingException
{
updateJobDescription("Example of a task setting resume points.");
/*
some code to create a file
*/
setResumePoint("File Created");
/*
some code to update database records
*/
setResumePoint("Database updated");
/* ... rest of runTask() ... */
}In the example, the task has the following resume points:
- After a file is created
- After the database is updated
If the task fails somewhere during the database update logic, the task activity record is in error. After the problem is found and resolved, the user can resume the task. The task skips the logic for creating the file again, since this was completed in the last run. It starts after the last successful resume point, which was file created, and tries the database update logic.
The task identifies it is a resume request using the isResume() method
from the BaseIPDTask. If the task identifies
that it is resuming, it gets the resume point using the getResumePoint() method
from the BaseIPDTask.
protected String getResumePoint()Refer to the Javadoc information for additional information about methods and signatures.