Thursday, October 31, 2013

Reenterng Bounded Task Flow

 task-flow-reentry  Option is used to handle cases with user re-enter to the task flow using back button.Task flow uses re-entry not allowed or reentry-outcome-dependent options for task-flow-re-entry.For reentry settings , redirect activity with in task flow should set true.



  • reentry-allowed - Reentry allowed on any view activity within bounded task flow 
  • reentry-not-allowed - User can go back to the screen but clicking on any button with in the view throws InvalidTaskFlowEntry exception 
  • reeenty-outcone-dependent - User can navigate to the a task flow using browser button solely on how user originally exited the tf.

 
reeentry-not-allowed 

Create a taskflow 
Reentry_view1.jspx
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <!--<jsp:directive.page contentType="text/html;charset=UTF-8" />
-->
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view>
    <af:document id="d1">
      <af:form id="f1">
        <af:panelGroupLayout id="pgl1">
          <af:button text="button 1" id="b1" action="toRet"/>
        </af:panelGroupLayout>
      </af:form>
    </af:document>
  </f:view>
</jsp:root>

Not that Redirect property=true for this view.
Create the main page in the adfc-config.xml 

Main.jspx
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
        <af:document title="main.jspx" id="d1">
            <af:form id="f1">
                <af:panelGroupLayout id="pgl1">
                    <af:button text="button 1" id="b1" action="toTF"/>
                </af:panelGroupLayout>
            </af:form>
        </af:document>
    </f:view>
</jsp:root>

Run the main.jspx . Navigate the UIs and try the browser back button
<Oct 6, 2013 6:08:42 PM IST> <Error> <oracle.adfinternal.view.faces.context.RichExceptionHandler> <BEA-000000> <ADF_FACES-30200:For more information, please see the server's error log for an entry beginning with: The UIViewRoot is null. Fatal exception during PhaseId: RESTORE_VIEW 1.
oracle.adf.controller.InvalidTaskFlowReentryException: ADFC-06016: Task flow reentry is not allowed: '/WEB-INF/tfReentry.xml#tfReentry'.
            at oracle.adfinternal.controller.state.ControllerState.reentryNotAllowed(ControllerState.java:1019)
            at oracle.adfinternal.controller.state.ControllerState.reenterTaskFlow(ControllerState.java:992)
            at oracle.adfinternal.controller.state.ControllerState.recoverState(ControllerState.java:925)
            at oracle.adfinternal.controller.state.ControllerState.synchronizeStatePart1(ControllerState.java:369)
            at oracle.adfinternal.controller.application.SyncNavigationStateListener.beforePhase(SyncNavigationStateListener.java:263)
            at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.beforePhase(ADFLifecycleImpl.java:557)
            at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchBeforeEvent(LifecycleImpl.java:100)
            at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchBeforePagePhaseEvent(LifecycleImpl.java:147)
            at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.dispatchBeforePagePhaseEvent(ADFPhaseListener.java:290)
            at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.beforePhase(ADFPhaseListener.java:76)

reentry-outcome-dependent
Change the re-entry option for the tf return based on the task flow activity outcome the re-entry option changes.
Managed bean values upon taskf flow reentry
Value of managed bean reset to the value of the managed bean before the end user existed the btf.Value of btf before the re-entry is lost .To change this set the re-direct property of the tf.

No comments:

Post a Comment