Friday, August 26, 2011

ADF: Oracle ADF task flows


Task Flow-

ADF Task Flows is a new feature that will ship with ADF 11g. In simple terms, it is a tool to encapsulate page flow/navigation. A set of ADF Controller activities, control flow rules and managed beans that interact to allow a user to complete a task. It is much more than that in reality. A set of screens grouped into a Task Flow can be reused from wherever the application requires the same business function. A task flow can be a completely independent component with interaction through input and return parameters. 

A cool feature is when a task flow is generated as using page fragments (Note: a task flow can have either JSF Pages or JSF Fragments; not both). Such a task flow can be embedded into an existing screen as a region, so you have a main frame that stays static while a sub region contains an entire flowThe main component is the task flow definition file. This is an xml file on the lines of the faces-config.xml and adfc-config.xml. The various pages in a flow are represented by a view component and the navigation between the pages by a control-flow.

he return from a task flow is defined as a task-flow-return element. Note that this does not need to know where the task flow was called from. Of course, that’s necessary for a task flow to be reusable. Every task flow to be used in the application is then defined in adfc-config.xml. A task definition file can be dragged into the adfc-config in design mode. Navigations to a task flow are defined as control flows in adfc-config. These control flows can be anonymous so that they can be used from any JSF page in the application.

Bounded task flow represents modular and reusable application flows with a defined entry (i.e., default activity) and zero to many defined exit points (i.e., task flow return activities). They can be called from other task flows, referenced from a browser URL or embedded as a region in a view. They support reuse, parameters, transaction management and reentry.

A specialized form of ADF Controller task flow that has a single entry point and zero or more exit points. It contains its own set of private, control flowregion. Bounded task flows should be used for every other situation. In most circumstances these bounded rules, activities, and managed beans. A bounded task flow allows reuse, parameters, transaction management, and reentry. When dropped on a page, it becomes a
task flows will be hosted within the core page on the unbounded task flow and, as such, will be made up of JSF fragments rather than whole pages. A called ADF bounded task flow can accept input parameters and can pass return values to the caller upon exit

In addition, bounded task flows have the following features:
Operate within their own private memory scope–page flow scope are loaded lazily at runtime A new instance of TaskFlowContext (can be accessed using EL ${controllerContext.currentViewPort.taskFlowContext}) will be created each time a bounded ADF flow is entered. This context:

Manages the lifespan of all DataControl instances within the bounded task flow holds the information about the task flow ID and whether or not it contains uncommitted data.Don’t support multiple transactions when sharing the data control frame with parent flow To call a bounded task flow directly from a URL, the default activity must be a view activity can be set to be critical (i.e., dictates the framework to create an implicit save point when entering a bounded task flow. Also helps to prevent users from closing the browser window or browser tab if uncommitted data is present).

If protected by ADF Security, authorization is checked first.You can create train-based activities in a bounded task flow and only one train is allowed in each.Bounded task flow should be used if it:
Should be reused in same or other applications
Should run as part of a page within a region container
Requires an isolated transaction context
Changes data and then either commits or rollbacks on exit
Has a requirement for a single entry point

A Fusion web application always contains an ADF unbounded task flow, which contains the entry point or points to the application. Its XML configuration file (i.e., adfc-config.xml) is automatically created when building a new application using the Fusion Web Application (ADF) application template or when adding the ADF Page Flow Technology Scope to an existing or new web project. There will always exist a single instance of unbounded task flow at runtime, even if there is no activity added to it.

A set of activities, ADF control flow rules, and managed beans that interact to allow a user to complete a task. An unbounded task flow has a single point of entry. unbounded task flow should only be used to
define entry points to your application, for example the home page, pages that will be deep linked from emails and so on.

A unbounded task flow has the following features:

You cannot declaratively specify input parameters for it.It cannot contain a default activity (i.e., an activity designated as the first to run in the task flow). This is because an unbounded task flow does not have a single point of entry.It can be configured by one or many configuration files that are parsed and loaded the first time the user starts the application.View activities of an unbounded task flow can be configured bookmarkable managed beans that are in session or application scope should be configured in the unbounded task flow definition.You cannot create a train from activities in an unbounded task flow.You cannot use a task flow template as the basis for creating a new unbounded task flow


Read more: http://www.techartifact.com/blogs/2011/07/basic-of-task-flow-in-oracle-adf.html#ixzz1W5dfUEkI

No comments :

Post a Comment