adfemg
  1. adfemg
  2. ADFEMG-28

avoid the use of internal adf classes to know which task flow view is currently displayed in a ADF Task Flow region.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Incomplete
    • Labels:
      None
    • Environment:

      JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923

      Description

      situation is that we have an ADF region which contains a Task Flow, this BTF can call other Task Flows ( optimal reuse with Task Flow Call).
      Outside this region I got a global menu with a button which can call the Task Flow again but then in the default/ reset position.

      For this we need to set the task flow url and fire a queueActionEventInRegion reset event (control flow case). In case of a Task Flow call I need to fire a different event (located in that called BTF) which returns first to the original BTF (task flow return ) and then fire the reset control flow case.

      For this I need to know which BTF view is loaded so I can fire the right queue event inside the region.
      Outside the region (global menu) still the orginal BTF is active (even a other BTF is loaded/shown)

      I don't want to do tricks with the same name for control flow case or task flow return name. or add a dummy parameter in the BTF with for example the current time

      Only way to know, what is active, its to get the region DCTaskFlowBinding full name and use that in RootViewPortContextImpl to get the getViewId of the ChildViewPortContextImpl
      all these handy classes are internal classes and I would like to use the official supported oracle api.

      thanks

      here is the code snippet.

      import oracle.adf.controller.internal.binding.DCTaskFlowBinding;
      import oracle.adfinternal.controller.state.ChildViewPortContextImpl;
      import oracle.adfinternal.controller.state.RootViewPortContextImpl;

      taskFlowId = zoekBijZaakTF;
      logger.info("show Zoek Bijzaak TaskFlow " + taskFlowId);

      ChildViewPortContextImpl childView = getChildView();
      logger.info("" + childView.getTaskFlowContext().getTaskFlowId());
      logger.info(childView.getViewId());
      if (childView.getViewId().contains(substringDetentie))

      { logger.info("vanuit Detentie, uitvoeren resetTF"); outcome = "resetTF"; uitvoerenActieBinnenTF(actionEvent); }

      else if (childView.getViewId().contains(substringBijZaak))

      { logger.info("in BijZaak, doe reset"); outcome = "reset"; uitvoerenActieBinnenTF(actionEvent); }

      public void uitvoerenActieBinnenTF(ActionEvent actionEvent)

      { logger.info("uitvoerenActieBinnenTF"); region.queueActionEventInRegion(getMethodExpression(outcome), null, null, false, -1, -1, PhaseId.ANY_PHASE); }

      private MethodExpression getMethodExpression(String name) {
      FacesContext facesCtx = FacesContext.getCurrentInstance();
      Application app = facesCtx.getApplication();
      ExpressionFactory elFactory = app.getExpressionFactory();
      ELContext elContext = facesCtx.getELContext();
      return elFactory.createMethodExpression(elContext, name, String.class, new Class[] { });
      }

      private ChildViewPortContextImpl getChildView()

      { // get the current BindingContainer BindingContext bctx = BindingContext.getCurrent(); DCBindingContainer mainViewPageBinding = (DCBindingContainer)bctx.getCurrentBindingsEntry(); // find the task flow pagedef binding, see the pageDef DCTaskFlowBinding tf = (DCTaskFlowBinding)mainViewPageBinding.findExecutableBinding("dynamicRegion1"); ControllerContext conn = ControllerContext.getInstance(); RootViewPortContextImpl rootViewPort = (RootViewPortContextImpl)conn.getCurrentRootViewPort(); return (ChildViewPortContextImpl)rootViewPort.getChildViewPortByClientId(tf.getFullName()); }

        Activity

        Hide
        chriscmuir added a comment -

        Edwin, the dev team has come back with a response to this. The analyst has yet to respond, so if you're keen for a quick turn around you could update the original SR.

        CM.

        Show
        chriscmuir added a comment - Edwin, the dev team has come back with a response to this. The analyst has yet to respond, so if you're keen for a quick turn around you could update the original SR. CM.
        Hide
        biemond added a comment -

        Hi

        Sorry Development does not understand the use case.
        I know this feature but I don't want to know the current page
        what I want to know is , outside the region (in the jspx page ) I want to know which view or task flow ( cause TF can call TF ) is shown (inside the region ) so I can send the right queue event outside the region to the task flow in the region.

        thanks

        public void showAndReset(ActionEvent actionEvent) {
        // Add event code here...
        ControllerContext ctx = ControllerContext.getInstance();
        ViewPortContext viewPort = ctx.getCurrentViewPort();
        System.out.println("oracle current view " + viewPort.getViewId());

        ChildViewPortContextImpl childView = getChildView();
        System.out.println("current view "+childView.getViewId());

        Output ( see the difference )

        oracle current view /mainView
        current view /detail/detailView

        Show
        biemond added a comment - Hi Sorry Development does not understand the use case. I know this feature but I don't want to know the current page what I want to know is , outside the region (in the jspx page ) I want to know which view or task flow ( cause TF can call TF ) is shown (inside the region ) so I can send the right queue event outside the region to the task flow in the region. thanks public void showAndReset(ActionEvent actionEvent) { // Add event code here... ControllerContext ctx = ControllerContext.getInstance(); ViewPortContext viewPort = ctx.getCurrentViewPort(); System.out.println("oracle current view " + viewPort.getViewId()); ChildViewPortContextImpl childView = getChildView(); System.out.println("current view "+childView.getViewId()); Output ( see the difference ) oracle current view /mainView current view /detail/detailView
        Hide
        chriscmuir added a comment -

        Thought so. I'll ask the developer if he will talk to you directly. Watch this space.

        CM.

        Show
        chriscmuir added a comment - Thought so. I'll ask the developer if he will talk to you directly. Watch this space. CM.
        Hide
        chriscmuir added a comment -

        Everytime I revisit this issue I note I was never able to get the parties to talk together.

        I'll try another avenue.

        Show
        chriscmuir added a comment - Everytime I revisit this issue I note I was never able to get the parties to talk together. I'll try another avenue.
        Hide
        chriscmuir added a comment -

        Once again looks like I didn't get this to proceed. Beyond this I'm closing this EMG issue so I don't continuously track the issue, it's up to internal teams to prioritise this work.

        CM.

        Show
        chriscmuir added a comment - Once again looks like I didn't get this to proceed. Beyond this I'm closing this EMG issue so I don't continuously track the issue, it's up to internal teams to prioritise this work. CM.

          People

          • Assignee:
            Unassigned
            Reporter:
            biemond
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: