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!

TaskFlow Managed Beans and Managed Properties Issue/Solution/BestPractice

MarVinceReyesAug 7 2012
Tested in both 11.1.1.6.0 and 11.1.2.0

All taskflow are bounded.

B = TaskFlow containing MainIndex and C
C = TaskFlow - Cycles
M = MainIndex.jsff

I have a taskflow (B) which contains a fragment (M) and a taskflow (C) where F navigates into.

TaskFlow C has a return outcome called Cycle.

TaskFlow B registers the cycle outcome and reenters TaskFlow C.

In this example, TaskFlow can partake an action which exits the taskflow and reenters a new instance of the same taskflow.

Once all of that is absorbed, the issue I've encountered is that if a ManagedBean (MB) has a ManagedProperty (MP) in TaskFlow C, there is a potential that the managed property won't be "reset" on the succeeding entries.

By default, the taskflow actually takes care of the reset in normal circumstance and this is by following the documentation that on initial access on a ManagedBean on InvokeApplication (lifecycle), the setters for the managed property will be set.

Now here's the gotcha that was causing the issue as to why I am not getting the expected new Managed Properties due to reentry.
(Just to clarify this line I'll explain some more - Skip to the next paragraph if it gets boring)
Eg.
InputParameter is an integer which is incremented by TaskFLow B. So expectation is that on every re-entry of this taskflow I would expect an incremented input parameter. Once I've explained the issue below, you'll see that I am NOT getting the incremented integer but rather the old (before increment) parameter.

The gotcha here is that if I'm about to exit TaskFlow C and I entered a method on the same class that has a managed property on the parameter, the setter of the managed bean property gets configured one step too early!

So here's some of my initial findings as to how to solve this.

My Method Controls in my task flow was referencing a backingBeanScope "bean", when I moved it into a pageFlowScope then the managed beans are set correctly on re-entry. Another way is by retrieving the parameter programmatically which I only prefer when I'm desperate and would rather take the declarative approach primarily because I find it to be much well documented and well defined (readability).

Based on this findings, I'm trying to find an ADF document that can probably give me a broader explanation as to:

A - I'm using the taskflow method control-case wrong. Could it be that I missed the document stating what scope I'm suppose to use method controls and limitation?
B - Best practice in using managed properties in ADF/JSF standards

I'd appreciate a more technical discussion in this thread regarding this, probably some best practice would be great as well.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2012
Added on Aug 7 2012
0 comments
153 views