Sunday, December 26, 2010

Programmatically Navigating in Parent TaskFlow based on outcome of another Taskflow in popup.

In this article I will to show how can we navigate in parent taskflow based on outcome of another taskflow on the parent page dropped as a region or is being used in a popup. It seems that currently we do not have any public API’s to get these details from the Taskflow. However the good news is an ER 10198616 has been logged by Frank Nimphius to request public API’s for them.

Credit for the solution below goes to Chris Muir and Frank Nimphius for showing me way that led to this solution through thread posted in Oracle forum. Also code to access the taskflow API’s were taken from the blog  JDev: Programmatically capturing task flow parameters.

Issue at hand:
From a parent page a popup is launched that contains a taskflow which contained various ReturnActivity with different outcome. Based on what the outcome value of return activity a navigation in parent taskflow needs to be activated.

Solution:
We could achieve above by:
1. Storing the Taskflow Return Value in a Taskflow Return Parameter.
2. Programmatically capturing the Taskflow Return Parameter value in bean through Taskflow finalizer.
3. In RegionNavigationListener, based on the value captured in step 2, navigate to appropriate view or Taskflow.

To get the closer look you can check post TestCase: Programmatically Navigating in Parent TaskFlow based on outcome of another Taskflow in popup.

No comments:

Post a Comment