First page Back Continue Last page Graphics


Enabling Explicit Save for Later (continued)

5. After adding the method call activity to the diagram, connect it to the other existing activities in the diagram using control flows.

6. You can optionally set properties in the adfc-config.xml file, such as the savepoint default expiration time and where savepoints are stored. This is described later in this lesson.

You can access the createSavePoint() method under the currentViewPort node under ADF Controller Objects. Instead of calling this method directly, you may want to create your own method that calls createSavePoint(), as shown in the following example (if you do this, you can update the save-point-id with any attributes you create on your method):

package viewcontroller;


import oracle.adf.controller.ControllerContext;

import oracle.adf.controller.ViewPortContext;

public class SaveForLater implements Serializable {

public SaveForLater() {}

public String saveTaskFlow() {

ControllerContext cc = ControllerContext.getInstance();

if (cc != null) {

ViewPortContext vpc = cc.getCurrentViewPort();

if (vpc != null) {

String id = vpc.createSavePoint();

return id; }}}}

You can override global settings for individual savepoints for the amount of time that a savepoint remains in effect by calling the setSavePointTimeToLive() method. You can include this in the same method that you use to create the savepoint. The method signature is:

void setSavePointTimeToLive(long timeInSeconds)