Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to call parent action from bounded task in region without rendering page fragment, immediately f

prophetNov 30 2018 — edited Dec 6 2018

Hi,

I'm trying to configure pretty simple bounded task flow in region called from page in unbounded task flow.

Idea is:

  • page in unbound flow (accessible by url in browser) contains region with this bounded task flow
  • default activity in bounded task flow is Router
  • one outcome goes to shows page fragment, another immediately calling Parent Action (which 100% exist in parent unbound task flow)

screenshots are attached below

Problem:

It works only in case of rendering Page fragment. Second case - calling Parent action - does not work. It does not redirects to another page.

More about that: In page fragment, which renders perfectly, I can place a navigation button, which calls action navigating to Parent Action - that way it works -

it redirects to proper page in unbound task flow (menuMyaccount flow case)

So as I understand it is something with "scope/phase" of bounded task flow. Can I get it working somehow?

I want to achive pretty simple goal: call parent action without rendering page fragment; router makes checks and in some cases it redirects to parent action immediately.

screenshots:

bound_task_flow.png

unbound_task_flow.png

Thanks in advance,

Artem

Comments

Philip Sommer
Answer

Hi Yogesh,

Take a look at the Cookbook example for the router at https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=corerouter&demo=module
Setting up the new router should be fairly similar to the old one.
I implemented the login screen in my application as follows. (Don't know if this is best practise, but it works.) This is also very similar to the router example above.
Create a oj-module element in your main/index HTML to switch between login and content screens/modules.
During application startup - e.g. in your root viewmodel constructor - configure the router paths for login and content. Default should be login.
Check the login status of the user. If login is valid, directly navigate to content; Else stay on the login page.
(Optional) If you have more than one content-screen/module you may want to return your user to the one he last visited (if the login is still valid). In this case, I made a simple extension to the OJ CoreRouter which keeps track of the last routing state in the SessionStorage. I then simply restore the cached state.

image.png
Obviously, you will need to change this for the GoogleAPI, e.g. the validateToken() call would need to be replaced/changed.

Kind Regards,
Philip

Marked as Answer by user525840 · Sep 1 2022
John JB Brock-Oracle

As usual, Philip is correct. The CoreRouter is not that much different from the older ojRouter, and the methods used for actual Login integration are the same.

user525840

Thank you John and Philip.
I will try to implement this logic in my application.

1 - 3

Post Details

Added on Nov 30 2018
6 comments
238 views