Você está na página 1de 7

Oracle ADF Task Flow Interview Questions and Answers

Q : What is a Taskflow? A : Taskflow is the controller of an ADF application, it provides us an declarative approach to define the control flow. It is used to define the navigation between pages and various taskflow activites. Task flows pass the control not only between JSF pages, but also between other activities, for instance method calls or other task flows. Note: In fusion web application navigation and declaration of managed bean are taken care by adfcconfig even though faces-config.xml file is required for JSF-related functions such as defining global resource bundles and data type converters. Difference between JSF Page Flow & ADF Task Flow: JSF Page Flow: The entire application must be represented in a single page navigation file (facesconfig.xml). Although you can have multiple copies of faces-config.xml in a project, the application loads these files as one at runtime. All nodes within a JSF page flow must be JSF pages. No other types of objects can exist within the JSF page flow. Navigation is only between pages. Application fragments cannot be reused. There is no shared memory scope between multiple requests except for session scope. ADF Task Flow: The application can be broken up into a series of modular flows that call one another. You can add to the task flow diagram nodes such as views, method calls, and calls to other task flows. Navigation is between pages as well as other activities, including routers. ADF task flows are reusable within the same or an entirely different application. After you break up your application into task flows, you may decide to reuse task flows containing common functionality. Shared memory scope (for example, page flow scope) enables data to be passed between activities within the task flow. Page flow scope defines a unique storage area for each instance of an ADF bounded task flow. Task flows provide a more modular and transaction-aware approach to navigation and application control. Aside from pages, task flows can also coordinate page fragments. Page fragments are JSF JSP documents that are rendered as content in other JSF pages. You can create page fragments and the control between them in a bounded task flow as you would create pages, and then insert the entire task flow into another page as a region. Unbounded Task Flows: A set of activities, control flow rules, and managed beans that interact to allow a user to complete a task. An ADF unbounded task flow consists of all activities and control flows in an application that are not included within any bounded task flow.

1. 2. 3. 4. 5. 1. 2. 3. 4. 5.

It is similar to the JSF page flow. When a project with the ADF Page Flow technology scope is created, it will contain a task flow definition file called adfc-config.xml by default. This is an unbounded task flow. Such task flows are called unbounded simply because they have no explicit start or end. It can start from any view activity. An application can have one, and only one, unbounded task flow. It is possible to have several separate definition files containing unbounded task flow definitions, but at runtime, these are all Merged into a single logical flow. No limits for entry and exit points. Cant be creating on page fragments. An unbounded task flow cannot declaratively specify parameters. It cannot contain a default activity, an activity designated as the first to run in the unbounded task flow. Bounded Task Flows: Reusable and parameterized and maintain private state. Can participate in transaction.

1. 2.

3. 4. 5. 6. 7. 8.

Bounded task flow does not have an equivalent in the current JSF standard. Single entry point and zero or more exit point. Can be created as a page or page fragment. Data controls can be shared between task flows A bounded task flow can declaratively specify parameters. The bounded task flow always specifies a default activity, a single point of entry that must execute immediately upon entry of the bounded task flow. An unbounded task flow can call an ADF bounded task flow, but cannot be called by another task flow. A bounded task flow can call another bounded task flow, which can call another and so on. Below are the different activities which participate in task flow:

A view activity configures the page or page fragment in task flow. A router activity create an expression whose evaluation will determine which control flow rule will be followed. A method call activity configures the method to be called in task flow. A task flow call activity configures the task flow to be called in task flow. A return activity is used to return the task flow. Scope in task flow: Scope for ADF Managed Beans:

Application - The application scope lasts until the application stops. Values that you store in a managed bean with this scope are available to every session and every request that uses the application. Avoid using this scope in a task flow because it persists beyond the life span of the task flow

Session - The session scope begins when a user first accesses a page in the application and ends when the user's session times out due to inactivity, or when the application invalidates the session. Use this scope only for information that is relevant to the whole session, such as user or context information. Avoid using it to pass values from one task flow to another. Instead, use parameters to pass values between task flows. Using parameters gives your task flow a clear contract with other task flows that call it or are called by it. Another reason to avoid use of session scope is because it may persist beyond the life span of the task flow.

pageFlow - A managed bean that has a pageFlow scope shares state with pages from the task flow that access it. A managed bean that has a pageFlow scope exists for the life span of the task flow. If another task flows page references the managed bean, the managed bean creates a separate instance of this object and adds it to the pageFlow scope of its task flow. You can specify page flow scope as the memory scope for passing data between activities within the ADF bounded task flow. Page flow scope defines a unique storage area for each instance of an ADF bounded task flow. Its lifespan is the ADF bounded task flow, which is longer than request scope and shorter than session scope. When one task flow calls another, the calling task flow cannot access the called task flows pageFlow scope. This means, for example, that a UI component on a page referenced by a task flows view activity cannot access the pageFlow scope of another task flow even if this task flow is an ADF region embedded in the same page as the UI component. View - Use this scope for managed bean objects that are needed only within the current view activity and not across view activities. It defines scope for each view port that ADF Controller manages, for example, a root browser window or an ADF region. The life span of this scope begins and ends when the current viewId of a view port changes. If you specify view, the application retains managed bean objects used on a page as long as the user continues to interact with the page. These objects are automatically released when the user leaves the page. Request Use request scope when the managed bean does not need to persist longer than the current request.

Backing Bean - A backing bean is a convention to describe a managed bean that stores accessors for UI components and event handling code on a JSF page. It exists for the duration of a request and should not be used to maintain state. Use this scope if it is possible that your task flow appears in two ADF regions on the same JSF page and you want to isolate each instance of ADF region. Q : What are the different types/categories of Taskflows? A : Taskflows are of two categories : Bounded and UnBounded. Q : What is the difference between Bounded and UnBounded taskflows? A : Differences between Bounded and UnBounded taskflows : Bounded taskflows can be secured but Unbounded cant. Bounded taskflows can accept parameter and return values but unbounded taskflows dont support parameters. Bounded taskflows has a single entry point or a default activity but unbounded taskflows have multiple entry points. Bounded taskflows can be called from other bounded/unbounded taskflows but unbounded cannot be called or reused. Bounded taskflows support transactions unbounded dont. ADF Bounded Task Flow Features:

Well-defined boundary :An ADF bounded task flow consists of its own set of private control flow rules, activities, and managed beans. A caller requires no internal knowledge of such things as page names, method calls, child bounded task flows, managed beans, and control flow rules within the bounded task flow boundary. Input parameters can be passed into the bounded task flow, and output parameters can be passed out on exit of the bounded task flow. Data controls can be shared between task flows. Single point of entry : An ADF bounded task flow has a single point of entry, a default activity that executes before all other activities in the task flow. Page flow memory scope : You can specify page flow scope as the memory scope for passing data between activities within the ADF bounded task flow. Page flow scope defines a unique storage area for each instance of an ADF bounded task flow. Its lifespan is the ADF bounded task flow, which is longer than request scope and shorter than session scope. Addressable :You can access an ADF bounded task flow by specifying its unique identifier within the XML source file for the bounded task flow and the file name of the XML source file. For more information. Reuse: You can identify an entire group of activities as a single entity, an ADF bounded task flow, and reuse the bounded task flow in another application within an ADF region. For example, the Hot Items and Start Shopping tabs on the home page of the Fusion Order Demo application reuse the same task flow embedded in a region. Different parameters are passed to each region to determine the lists of products that display. You can also reuse an existing bounded task flow simply by calling it. For example, one task flow can call another bounded task flow using a task flow call activity or a URL. In addition, you can use task flow templates to capture common behaviors for reuse across different ADF bounded task flows.

Parameters and return values: A caller can pass input parameters to an ADF bounded task flow and accept return values from it. In addition, you can share data controls between bounded task flows.

Transaction management:An ADF bounded task flow can represent a transactional unit of work. You can declaratively specify options on the bounded task flow that determine whether, when entering the task flow, the task flow creates a new transaction, joins an existing one or is not part of the existing transaction. Reentry :You can specify options on the bounded task flow that determine whether or not it can be reentered. On-demand loading of metadata :ADF bounded task flow metadata is loaded on demand when entering an ADF bounded task flow. Security: You can secure an ADF bounded task flow by defining the privileges that are required for someone to use it.

Q: What is taskflow ? how many type of taskflow adf support? Ans: Taskflow is the Component of Oracle ADF which is used to define simple task. After successfully defining task-flow can consume any number of time. ADF support two kind of taskflow: Bounded TaskFlow : Bonded taskflow require the page on which they will consume. An ADF bounded task flow is used to encapsulate a reusable portion of an application. A bounded task flow is similar to a Java method in that it: Has a single entry point May accept input parameters May generate return values Has its own collection of activities and control flow rules Has its own memory scope and managed bean lifespan (a page flow scope instance) UnBounded TaskFlow : Unbounded taskflows can directly run on browser Q: Can bounded taskflow run on browser? Ans: NO Q: How to develop reusable taskflow in ADF? Ans: Please fins the step below

1. 2. 3. 4. 5.

Define taskflow Define deployment profile as ADF Library jar Deploy adf jar file Open new project where you want to consume the task flow. Add newly created jar of taskflow project go to component palate You will find your jar name, select it. It will show list of taskflow which you have developed. Drag drop your taskflow as region on jsff/jspx page and run an application Q: What are different scope of adf taskflow? Ans: Isolate/Shared Shared scope will share data among the multiple instance of taskflows while Isolated doesn't. Q: How can you force ADF taskflow to use new transaction everytime taskflow is called? Ans: Go taskflow overview and you will find Share data controls with calling task flow option as shown below Select always begin new transaction fron dropdown Q: How to use same transaction in ADF taskflow? Ans Select Always Use existing Transaction option.

Q How can you pass parameter to adf taskflow? Ans: Go to overview select parameters link it will show screen like

Here you can add multiple parameter which you want to pass to takflow while loading it. Q: Explain the purpose of using Controls flow in adf? Ans: Controls flow defined in taskflow can be called anytime from any page of that taskflow. if you have same flow for multiple pages just define the control flow once in taskflow. You can invoke it anytime from any action event. Q: What is the behavior of router in ADF taskflow? Ans : Based on some condition router can decide which route need to be follow. If none of condition match in that case router will follow default route defined by used. Q: How can navigation define in taskflow? Ans : Navigation can be defined in taskflow using control flows and invoked by jsff/jspx page using action event like button link etc. Q: Can ADF task flow hold more than 1 view activity? Ans: Yes. ADF taskflow can have multiple view activity but 1 activity has to be defined as default activity. Q: What is the Parent Action Activity in ADF Taskflow? Ans: Parent action activity using it you can invoke the Control flow define in parent taskflow from child taskflow. Used to create new task flow using existing task flow. Q: What is method activity in Adf Taskflow? Ans: Using this activity you can invoke a method defined in manage-bean. Q: How to initialize ADF Taskflow? Ans: Open the taskflow in Overview Mode select General option, there is initiallizer property. you can provide the any method reference which will get invoked whenever taskflow instance created. Q: How to convert an ADF bounded task flow to Unbounded Task Flow or Page Fragments? Ans: In the editor, open the bounded task flow diagram. Right-click anywhere in the diagram other than on an activity or control flow. Choose a menu item such as Convert to Unbounded Task Flow or Convert to Task Flow with Page Fragments. If the bounded task flow contains fragments, the menu item will be Convert to Task Flow with Pages.

Q: How to use same value in multiple activities of a Task Flow? Ans:

Using Shared memory scope (for example, page flow scope) enables data to be passed between activities within the task flow. Page flow scope defines a unique storage area for each instance of an ADF bounded task flow. Any managed beans you decide to use within task-flow can be specified in page flow scope, so are isolated from the rest of the application Q: What are entry points for task flow? Ans: This task flow contains a number of view activities that are all entry points to the application. Q: How can one bounded task flow can call another? Ans:One task flow can call another bounded task flow using a task flow call activity or a URL. Q: How to identify default activity in bounded task flow? Ans: A green circle identifies the default activity in a task flow diagram.

The first activity that you add to a new ADF bounded task flow diagram is automatically identified as the default activity. You can also right-click any activity in the task flow diagram and choose Mark Activity > Default Activity. The default can be any activity type and it can be located anywhere in the control flow of the ADF bounded task flow. To find the default activity, right-click anywhere on the task flow diagram and choose Go to Default Activity.

Task Flow Activities: Method Call: Invokes a method, typically a method on a managed bean. A method call activity can be placed anywhere within an applications control flow to invoke application logic based on control flow rules. Parent Action: Allows a bounded task flow to generate outcomes that are passed to its parent view activity. Router: Evaluates an EL expression and returns an outcome based on the value of the expression. For example, a router in a credit check task flow might evaluate the return value from a previous method call and generate success, failure, or retry outcomes based on various cases. These outcomes can then be used to route control to other activities in the task flow. Save Point Restore: Restores a previous persistent save point, including application state and data, in an application supporting save for later functionality.

Task Flow Call: Calls a bounded task flow from an unbounded task flow or another bounded task flow. Task Flow Return: Identifies when a bounded task flow completes and sends control flow back to the caller. (Available for bounded task flows only). URL View: Redirects the root view port (for example, a browser page) to any URLaddressable resource, even from within the context of an ADF region. View: Displays a JSF page or page fragment. Multiple view activities can represent the same page or same page fragment.

Control Flow Case: Identifies how control passes from one activity to the next in the application. Wildcard Control Flow Rule: Represents a control flow case that can originate from any activities whose IDs match a wildcard expression. For example, it can represent a control case from-activity-id containing a trailing wildcard such as foo*. Q. If you want to show information to end users in a secondary browser, how will you show? Ans: Use dialogs option from activities. Examples: 1. you want to display help information to end users to assist them with a task in the primary browser window 2. you want end users to select a value from a list of values.

Você também pode gostar