Wednesday, June 18, 2014

What is save point restore and how to configure it and use it in Oracle ADF?

Save point restore is a mechanism to save a particular state of the current ADF application transaction state and return to it after a certain amount of time (not more than 24hrs)

We can use the save point restore facility in the ADF taskflows to return to that particular state. If we use this, the application will store the following information temporarily to the database and retrieves it when we require.

The information stored at the save point is
  1. Current ADF model transaction state of the application
  2. Memory states of the ADF Controller specific scopes - Page flow scope and View scope
  3. ADF controller navigation state, all the taskflow calls to come to this state
  4. UI state of the current page like the tabs opened, rows of the table selected, choices selected in the Boolean checkbox 
By default, the saved information is active in the database for 24 hours and is deactivated after that.

Steps to configure and use the save point restore

Step1: Indicate the database connection that will be used to save the state in the adf-config.xml file which can be found in application resources -> Descriptors -> ADF META-INF -> adf-config.xml

Select the data source of the database where the framework can store the application state as below

 


Clicking the check box enable implicit savepoints will save the application state automatically when the taskflow is marked as critical

Step2:

Decide the step in the taskflow where you want to save the state and invoke the controller method just before that to save the state as below.



The properties of the method to be executed are as below


The managed bean property configured in the return value of the method is a string and looks as below









Step3

Drag and drop the save point restore activity on to the current taskflow as shown in the tasflow. The properties of the activity are as below










Step4

Configure the command button/command link on clicking which the last change will be undone. Point the action property of the button to invoke the save point Restore activity

No comments:

Post a Comment