Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Showing posts with label Task Flow. Show all posts
Showing posts with label Task Flow. Show all posts

Thursday, August 4, 2011

Conclusion on Chris Muir's ADF Task Flow Behavior in 11g

Chris Muir wrote an excellent series on the behavior of adf task flows in conjunction with the transaction control options and am connection. You can find all from the last post available here 

For little impatient people who may not have enough time to go through all the 4 blog posts may read the key points here:


1. A Bounded Task flow knows to which AM to connect and establish which db connection only via page definition file bindings. So, a transaction wont be initiated or a 
db connection won't be created until some event is triggered on the page to access page definition bindings.

2. If "No Controller Transaction" option is chosen then creation of transaction are totally relied on BC4J. 

3. Chained calls of bounded task flows with no controller transaction option and other transaction options should not be mixed to avoid unpredictable results.

4. Calling a bounded task flow with option use existing transaction from another bounder task flow with option 'always create a new transaction' and both having different 
db connections will cause the caller db connection to be used in the called BTF as well. 

5. 11.1.2 onwards there is no automatic nesting of AM of the called BTF under calling BTF's AM. So prior to 11.1.2 this would have resulted into just 1 AM Pool but now all AMs would be treated as root AM and having their own pool (unless they are explicitly nested at design time). Needless to say they will still share the same transaction/connection (if called BTF has option used exiting transaction (or, if possible))

Friday, April 1, 2011

Design standard for Page Templates and Sub flow calls in ADF 11g

ADF 11g provides effective ways of reducing development time by allowing to create page templates. So, a typical example of a page template is say your organization app has 20 pages and all having same header and footer (or at least same layout). Now to avoid repetition of designing or copy/pasting manually in all 20 pages you can simply create a page template and use it while creating your pages. Page templates are much more powerful than what I said above as it allows you to keep dynamic data as well. But lets understand it this way as the focus of this post is different.

When a Task Flow call is made from a page fragment which is inside a task flow then the Task flow being invoked is referred as Sub-flow. The design diagram usually represent it by a task flow call activity. So, one of the most typical mistake I have seen people doing in ADF world is wrong way of using the page template in the sub-flows.  You must make sure that if the parent flow is using a page Template A (say with two areas header and content area) then you must not use the same template Template A in any of the page fragment of the sub-flow. The simple obvious reason is: in that case the page fragment of subflow having Template A will be embedded in the parent task flow page fragment. Visually, It is like:
So, what is the right way? Well in case of sub flows you should only use the page Template A in the parent task flow's page fragments. For the subflow page fragments there should not be any page template or there should be another page Template B which is only the content part of the template A.

So, in other words you should create a page Template B with only content part of Template A. And then you should create another Template A with only header part and in the content area including template B. So, for parent flow page fragments Template A should be used and for sub flow page fragment's Template B should be used.