What is the difference between Bounded and UnBounded taskflows?

·

·

,

Oracle Adf Bounded and Unbounded Taskflow and difference between Bounded and Unbounded Taskflow.

Bounded Task Flow Unbounded Task Flow
Bounded TF have single entry point and can have zero or more exit points.

Bounded Task Flow should always have a default Activity which is also an entry point for your Bounded Task Flow.

Unbounded TF can have one or more entry point for the application (adfc-config.xml).
There is no concept of default Activity in Unbounded Task flow.
JDeveloper By default, create one default unbounded task flow for Fusion App and the file is called adfc-config.xml

Bounded TF MUST have a default activity (Which is the entry point)

Unbounded TF cannot have default activity

Bounded TF can be parameterized and with parameters, re-usability is extended as well

UnBounded TF cannot be parameterized.

You can create multiple Bounded TF and make them reusable across and beyond your Applications.


You can create multiple Unbounded TF but during runtime they all become into one unbounded TF, thus resulting into inefficiency

Bounded TF is re-usable and can it’s own private activity, control flows, managed beans, bean scope, etc.

UnBounded TF is not re-usable and the only benifit we get in my opinion is bookmarking ability for our users.

We can implement Undo feature with Bounded TF( because it supports Transaction)

UnBounded TF doesn’t support Transactional Capability

Now that you know what is Bounded Task Flow and Unbounded Task Flow and the difference between them in Summary, Let’s deep dive into details.

What is A Task Flow in Oracle Adf

In Oracle Adf, Task Flows provides a declarative way to define navigation of the application. In other words, it acts as or is one of the controller for your application that defines your navigation flows between pages or other task flows.

Why to use Task Flows in Oracle Adf

In Oracle adf, taskflow helps to break large page flow into reusable pieces, and these reusable pieces contains portion of your application and are then defined via taskflow navigations.

Types of Task Flows in Oracle Adf

There are two types of Task Flows in Oracle Adf. Below is the short summary of both Bounded Taskflow and Unbounded Taskflow, later in the below section, we will go into more details.

Bounded Taskflow

Bounded Taskflow in Oracle Adf is a reusable form of Task Flow that has single entry point with zero or more exist points, has it’s own reusable sets of control flows, activities, managed beans and can accept parameters, has transactional capability, can be secured and allows reentry as well.

Since Bounded Taskflow always has a single entry, you should always have default activity. We will go over each in details below.

Unbounded Task Flow

Unbounded Task Flow in Oracle Adf is Task Flow that is an entry point or points to your Application.

Unbounded Task Flow contains various view activities that are all entry points to your application. And Unbounded Taskflow can not do any thing that Bounded taskflow can do.

Unbounded Task Flow is not reusable, does not support transactions, can not accept parameters, can not have default activity as there are multiple entry points, you can not secure Unbounded Taskflow.

But Unbounded Taskflow gives the benefit of letting Users Bookmark your Application URL.

JDevelper will create empty Unbounded Task Flow called adfc-config.xml under WEB/INF folder when creating a new Fusion web application from JDeveloper IDE.

Usages of Bounded and Unbounded Taskflow in Oracle Adf

Let’s say you are developing Online Store like Say Amazon.com, you want anyone to see your Home Page, Product Listing, About pages but you want to control/secure Wishlist, Orders, History, Profile pages, etc. right?

So to accomplish above which of the above pages should be under Bounded Task Flows and Which of them should be under Unbounded Task Flows ?

Yes, you guessed it right ! Unsecured pages, that do not need transnational capability and has multiple entry points like Home Page, Product Listing Page, About Us Page should be under Unbounded Taskflows.

It has to be under Unbounded Taskflow for another reason as well, you want your users to bookmark you Home or product page right !

And Pages like Orders, History, Profiles are secured and can be resuable, must have Transactional Capabilities, and always has single entry point so they must be under Bounded Taskflow.

You should only use Unbounded Taskflow instead of Bounded Taskflow in below cases:

  1. If Bookmarking is your only Objective and your page is not secure and Other things you can get around such as your taskflow is not reusable and you don’t have to worry about transaction, etc.
  2. Your task flow is called by any other task flow.
  3. Your application consists of many entry point and should be unsecure.

An Unbounded Task Flow is not resuable and thus can not accept paramters and does not have transactional capability.

If You want certain portion of your application to take advantages of security, re-usability, transnational capability, single point entry with default activity and reentry support, you should use Bounded Task Flow.

You should always use Bounded Taskflow instead of Unbounded Taskflow otherwise:

  1. If your Application has certain Portion that are reused in multiple difference places within your App, then you should create Bounded taskflow for it.
  2. If your Application should go in sequence like, you should first Add items to Cards before Paying, Bounded Taskflow is your answer as it should always have one default activity (single point of entry)
  3. If You want to support Undo feature in your application as Bounded Taskflow supports Transnational Capabilitie.
  4. If your Application wants to take parameters and return values by one of your reusable Bounded Taskflow.
  5. If your Application only wants to remember control flows and/or users data while they are in certain page and then let that be garbage collected, you want to choose Bounded Taskflow because you can specify which memory scope you want to use. My general recommendation is always stick with lowest Memory Scope like BackingBean Scope is not use higher but i won’t recommend using anything above PageFlowScope.
  6. If your Application have more than one Application Modules since you are talking to multiple Databases but from Taskflow you want to control them declaratively , Bounded Taskflow is your answer.
  7. I can only name some but almost all of the use case will mostly tell you to use bounded Taskflow.

Features of Bounded Taskflow in Oracle Adf

As you now already know, In most case we always use Bounded Task Flow and only time we use Unbounded Task Flow is when we want to make it bookmarkable for user.

Even You can choose no security or security level for your Bounded Task Flow. Now that we saw goodies about Bounded Task Flow, Let’s looks are its features in details.

Resuability, Parameters and Return Values

When you create Bounded Taskflow thinking of re-usability, you should identify all the things that can and can not be reused and also you should think of which of them can be reused if user can or your logic can supply inputs to the bounded taskflow.

Once you identify them, create them or use them in the form of reusable views, control flows, managed beans, as a single entity.

Now to reuse them in another portion of the same application or different application, you simple drag and drop them.

If you have created inputs to be required, you will get dialog box to provide input parameter values either as simple value or you can provide managed bean to derive it or you can use EL expression to derive it from data controls, managed beans, etc.

I just can’t explain how much strength it has, even the return value can be output of one portion of taskflow and that is declaratively an input for next portion of same taskflow. I would say, you can just imagine the chaining we can do and all declaratively.

Single point of entry and Boundaries

Bounded Task Flow has a single point of entry which is also called a default activity and that default activity is the first one to be executed before any others that are defined in that same Task Flow.

What ever is defined in the Bounded Taskflow are internal to the taskflow and caller of the taskflow is only required to passed input parameters only if it is even required. In most case to make it reusable, developer should make required input parameters.

Transaction management

Bounded Taskflow gets the benefit of Transactional Capability and you can declaratively specify if you want your taskflow to create new transaction or join existing transaction during the entry of your bounded taskflow.

Your Taskflow can also deal with multiple Application Module’s i.e. multiple Databases and peform actions to multiple databases and all in a declarative way.

you can even use Oracle ADF Java API to programmatically commit or check the status of your transaction if it’s dirty or not so that you can provide “Unsaved Data” Dialog Box to user if they accidentally hit back button or something.

You should also carefully choose if are you are changing transaction of your bounded taskflow to be new transaction or to join existing transaction.

If you want to provide “Unsaved Data Waring” dialog and you are in second activity of your taskflow and if user click back button, then you can’t choose a new transaction because taskflow will not consider your first activity and will only check if your second activity in your taskflow is dirty or not.

You can also create your Bounded Taskflow such that, it has capability for your user to have UNDO feature.

Security

You can secure your Taskflow and you can choose how granular you want to be for your bounded taskflow. Let’s say you want anyone to View your Product Page and Basic User and premium user can only Buy with Credit Card but you want premium user only to Buy with Points.

Your Product Page can be Unbounded Taskflow or even Bounded Taskflow and remove security.

Your Buy action to call Bounded Taskflow with Basic User Role Security.

Your Buy With Points action to call Bounded Taskflow with Premium User Role Security.

Reentry

In your Bounded Taskflow you can specify options if you will allow your Bounded Task Flow to be reentered or not.

In Nutshell, We have to have one Unbounded TF and many Bounded TF to take advantage of many features such as re-usability, train stop, data sharing between task flows , transaction, etc.