ADF: Using Save Points (Explicit)

You can configure a task flow to capture the state of an ADF application at a particular instance creating what is called a Save Point. This allows you to save application state when, for example, you are creating a new department, and the application state can be restored at a later point.

An explicit save point requires an end user action before a bounded or unbounded task flow creates a save point. For example, an end user clicks a button that invokes a method call activity that, in turn, creates a save point.

In this post, you will learn how to use explicit save point in Oracle ADF 12c (12.1.3).
Download the sample application:

Create an ADF Fusion Web Application, and call it as ADFSavePointApp.
This application must implement ADF Task Flow with departments data.


Configure your application to use save points.
In the Application Resources pane, expand Descriptors > ADF META-INF, and open the adf-config.xml file.
Go to Controller page and click the magnific glass icon near Data Source field, to choose savepoint connection.


To use save point, leave the value of the jbo.locking.mode property set to the default value optimistic.


A database table named ORADFCSAVPT stores save points. If this database table does not exist, it is created automatically by your ADF application. You may use the following SQL script to create the ORADFCSAVPT database table too.


To create save points, you may use the createSavePoint method exposed by the currentViewPort node of the ADF Controller Objects. The resulting EL expression is similar to the following:


I will identify my save points with the departments name, so, I will create a custom method for creating save points.
In the task flow, double-click listSavePoints component.
In the Select Method dialog, click the New button and create a new Managed Bean.


In the Select Method dialog, set listSavePoints as method name.


Double-click in listSavePoints component to go to bean.
Replace all the file content with the following code:



import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

import oracle.adf.controller.ControllerContext;
import oracle.adf.controller.savepoint.SavePointAttributes;
import oracle.adf.controller.savepoint.SavePointManager;

public class SavePointBean implements Serializable {

  private static final long serialVersionUID = 1L;
  private List savePointSelectItems = new ArrayList();

  public SavePointBean() {}

  public List getSavePointSelectItems() {
    return savePointSelectItems;

  public void createSavePoint(String savePointName) {
    ControllerContext cc = ControllerContext.getInstance();
    if (cc != null) {
      SavePointManager mgr = cc.getSavePointManager();
      if (mgr != null) {
        SavePointAttributes spa = new SavePointAttributes(savePointName, savePointName, null);
        String id = mgr.createSavePoint(spa);
        System.out.println("Save point is being set " + id);

  public void listSavePoints() {
    ControllerContext cc = ControllerContext.getInstance();
    if (cc != null) {
      SavePointManager mgr = cc.getSavePointManager();
      if (mgr != null) {
        List savePointIdList = mgr.listSavePointIds();
        for (String savePointId : savePointIdList) {
          SavePointAttributes attributes = mgr.getSavePointAttributes(savePointId);
          SelectItem item = new SelectItem(savePointId, attributes.getName());

Create the deptView page fragment.
The selectOneChoice component displays all save points.
The button components adds departments and manages save points (Restore and remove).



Create the deptEditView page fragment.
The button components saves departments and creates save points.



Click the removeAllSavePoints component and configure it.
It removes all Save Points for the current user.


Click the savePointRestore component and configure it.
It restores the save point by id.


Click the removeSavePoint component and configure it.
It removes the save point with a given id.


Click the createSavePoint component and configure it.
It creates a save point for the current user.


Deploy the application and enjoy!
Create a save point.




Restore the save point.


Commit the new department (and remove the save point).



Remove all save points.



Oracle ADF 12c Documentation
Java API Reference for Oracle ADF 12c