1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Real World ADF Design & Architecture Principles
Tas...
3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Learning Objectives
•  At the end of this module yo...
4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region ...
5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Task Flow Communication
Bounded Task Flow Call Opti...
6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Task Flow Communication
Call Activity
Task Flow
Tas...
7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Task Flow Communication
Call Activity
Task Flow
Tas...
8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Task Flow Communication
ADF Region
Shared Data Cont...
9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9 Copyright © 2012, Oracle and/or its affiliates. Al...
10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Example
Region 1
Region 2
12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region Interaction
•  Shared Data Control
•  Input...
13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Secret of Oracle ADF Rockstar Programmers
Often th...
14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
•  Master-detail synchronization ...
15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
•  Region to return value to pare...
16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Region
•  Master-Detail behavior
•  Regi...
17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Master-Detail Behavior – Shared D...
19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Master-Detail Behavior – Shared D...
20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Master-Detail Behavior – Shared D...
21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Master-Detail Behavior – Isolated...
22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Master-Detail Behavior – Isolated...
23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Common Usecase: Navigate to Speci...
25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Bean Reference Injection
Bounded ...
26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent: Chaperone in Action
Usecase: Sel...
27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent: Chaperone in Action
Usecase: Sel...
28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent: Chaperone in Action
Usecase: Sel...
29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent: Chaperone in Action
Usecase: Sel...
30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Navigate Parent View : RegionNavi...
32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Navigate Parent View : RegionNavi...
33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Navigate Parent View : RegionNavi...
34 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Secret of Oracle ADF Rockstar Programmers
The Regi...
35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
•  Method of the af:region compon...
36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
•  Region capabilities are used b...
37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
•  Determine Region Capabilities ...
38 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent-to-Region
Navigate Region: QueueActionEvent...
39 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
40 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Navigate Parent View : Parent Act...
41 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Navigate Parent View : Parent Act...
42 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Region-to-Parent
Navigate Parent View : Parent Act...
43 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
44 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
About Contextual Events
•  Mechanism on the ADF bi...
45 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Contextual Events #1
Parent View
ParentViewPageDef...
46 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent View
ParentViewPageDef
View Port View Port
...
47 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Parent View
ParentViewPageDef
View Port View Port
...
48 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Contextual Events
•  Discoverability
–  Event prod...
49 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Program Agenda
•  Task Flow Call Options
•  Region...
50 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Exercise #1
•  The corporate architecture board is...
51 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Exercise #1
Parent-Child Relationship Between Regi...
52 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Exercise #2
•  The requirement is for a task flow ...
53 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Exercise #2
Hide/Show Components From a Region
Par...
54 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Conclusion
•  Keep it simple! Contextual events is...
55 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Further Reading
•  ADF Region Interaction Function...
56 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Upcoming SlideShare
Loading in …5
×

Oracle ADF Architecture TV - Design - Task Flow Communication Pattern

713 views

Published on

Slides from Oracle's ADF Architecture TV series covering the Design phase of ADF projects, looking into the different options for communication between ADF task flows.

Like to know more? Check out:

- Subscribe to the YouTube channel - http://bit.ly/adftvsub
- Design Playlist - http://www.youtube.com/playlist?list=PLJz3HAsCPVaSemIjFk4lfokNynzp5Euet
- Read the episode index on the ADF Architecture Square - http://bit.ly/adfarchsquare

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
713
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
45
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Oracle ADF Architecture TV - Design - Task Flow Communication Pattern

  1. 1. 1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  2. 2. 2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Real World ADF Design & Architecture Principles Task Flow & Region Communication Patterns ORACLE PRODUCT LOGO 15th Feb 2013 v1.0
  3. 3. 3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Learning Objectives •  At the end of this module you should be able to: –  Understand different patterns of ADF region interaction –  Be able to choose the right pattern to implement for a problem –  Understand the dos and don’ts of task flow communication Image: imagerymajestic/ FreeDigitalPhotos.net
  4. 4. 4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes •  Contextual Events •  Exercises
  5. 5. 5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Task Flow Communication Bounded Task Flow Call Options Bounded Task Flow Region Task Flow Call Activity displayed in navigate to URL GET Request navigate to
  6. 6. 6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Task Flow Communication Call Activity Task Flow Task Flow Call Activity navigate to provision Input Parameter Input Parameter Input Parameter
  7. 7. 7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Task Flow Communication Call Activity Task Flow Task Flow Call Activity return control to process Return Value Return Value Return Activity
  8. 8. 8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Task Flow Communication ADF Region Shared Data Control Task Flow provision Input Parameter Input Parameter Input Parameter RegionParent View Task Flow Binding refresh Parent View PageDef get RegionModel
  9. 9. 9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 But where is the return value in ADF regions? Exercise Image: imagerymajestic/ FreeDigitalPhotos.net
  10. 10. 10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes •  Contextual Events •  Exercises
  11. 11. 11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Example Region 1 Region 2
  12. 12. 12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region Interaction •  Shared Data Control •  Input Parameters –  Parameter changes –  JavaBean instance references •  ADF Region events •  Contextual events Establishing Communication
  13. 13. 13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Secret of Oracle ADF Rockstar Programmers Often there is no single solution to a problem. Use case matters.
  14. 14. 14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region •  Master-detail synchronization between parent view and content shown in region •  Parent view passing data to child region for further processing –  Embedded wizard use case •  Parent view triggering navigation in region –  Generic CRUD flow –  Content switcher to display different views for a set of data Usecase
  15. 15. 15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent •  Region to return value to parent view at end of task flow processing –  Region "exit" use case •  Region method call to call behavior on parent view –  Dynamic Tab Shell Template use case •  Navigate parent view in response to region change •  Change dynamic task flow configuration from region Usecase
  16. 16. 16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Region •  Master-Detail behavior •  Region causing navigation in another •  Data passing Usecase
  17. 17. 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes –  Shared Data Control –  Input Parameter –  Region Events –  Other •  Contextual Events •  Exercises
  18. 18. 18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Master-Detail Behavior – Shared DC Task Flow af:region Parent View View <file>.jsff NextPrevious Administration PPR 1. 4.
  19. 19. 19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Master-Detail Behavior – Shared DC Task Flow af:region Parent View View <file>.jsff <file>PageDef.xml dependentEmployees Iterator <file>PageDef.xml allDepartmentsIterator NextPrevious Administration change row currency PPR 1. 2. 4.
  20. 20. 20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Master-Detail Behavior – Shared DC Task Flow af:region Parent View View <file>.jsff <file>PageDef.xml dependentEmployees Iterator <file>PageDef.xml allDepartmentsIterator NextPrevious Administration change row currency change row currency PPR update 1. 2. 3. 4.
  21. 21. 21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Master-Detail Behavior – Isolated DC Task Flow af:region Parent View View <file>.jsff NextPrevious Administration PPR 1. 4.
  22. 22. 22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Master-Detail Behavior – Isolated DC Task Flow af:region Parent View View <file>.jsff <file>PageDef.xml dependentEmployees Iterator Data Control Layer <file>PageDef.xml allDepartmentsIterator NextPrevious Administration change row currency PPR Data Control Layer taskFlowBinding DepartmentName detect change parameter value Input Parameter query 1. 2. 3. 4.
  23. 23. 23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes –  Shared Data Control –  Input Parameter –  Region Events –  Other •  Contextual Events •  Exercises
  24. 24. 24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Common Usecase: Navigate to Specific View in Region Task Flow af:region Input Parameter Parent Flow control flow case 1 control flow case 2 view1 view2 view3 view3 Show View 3 On Click PPR
  25. 25. 25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Bean Reference Injection Bounded Task Flow af:region Input Parameter Insert References to Parent View API Managed Bean Parent Task Flow (unbounded or bounded) #{viewScope.ManagedBean} Managed Bean invokes method on caller reference saved in
  26. 26. 26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent: Chaperone in Action Usecase: Self closing regions in tabs Bounded Task Flow af:region Managed Bean Parent View Dynamic Tab Shell Managed Bean View Scope Input Parameter View1 View2 Return Activity Method Activity
  27. 27. 27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent: Chaperone in Action Usecase: Self closing regions in tabs Bounded Task Flow af:region Managed Bean Parent View Dynamic Tab Shell Managed Bean View Scope View1 View2 Return Activity Method Activity Invoke method on
  28. 28. 28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent: Chaperone in Action Usecase: Self closing regions in tabs Bounded Task Flow af:region Managed Bean Parent View Dynamic Tab Shell Managed Bean View Scope View1 View2 Return Activity Method Activity Invoke method on
  29. 29. 29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent: Chaperone in Action Usecase: Self closing regions in tabs Bounded Task Flow af:region Managed Bean Parent View Dynamic Tab Shell Managed Bean View Scope View1 View2 Return Activity Method Activity Invoke method on close tab
  30. 30. 30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes –  Shared Data Control –  Input Parameter –  Region Events –  Other •  Contextual Events •  Exercises
  31. 31. 31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Navigate Parent View : RegionNavigationListener af:region Shopping Cart View Checkout View checkOut Task Flow View1 View2 Return Activity "view1" "view2" null
  32. 32. 32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Navigate Parent View : RegionNavigationListener af:region Shopping Cart View Checkout View checkOut Task Flow View1 View2 Return Activity "view1" "view2" null ?
  33. 33. 33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Navigate Parent View : RegionNavigationListener af:region Shopping Cart View Checkout View checkOut Task Flow View1 View2 Return Activity RegionNavigation Listener If(viewId == null){ //navigate to //checkout } "view1" "view2" null Managed Bean
  34. 34. 34 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Secret of Oracle ADF Rockstar Programmers The Region Navigation Listener listens for what happens in a region not for what happens to a region
  35. 35. 35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region •  Method of the af:region component –  RichRegion •  Invokes an ActionEvent as if it was queued from a command component inside a region –  Does not require the ADF region to refresh –  Used for navigating between activities •  Control flow cases are discoverable Navigate Region: queueActionEventInRegion
  36. 36. 36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region •  Region capabilities are used by a page to identify the available navigation cases for a view displayed in a region Determine Region Capabilities in EL #{bindings.[regionId].regionModel.capabilities['outcome']}
  37. 37. 37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region •  Determine Region Capabilities in Java //backing bean with region component binding RichRegion region = this.getEmpRegion(); RegionModel model = region.getRegionModel(); Set<String> capabilities = model.getCapabilities(); ...
  38. 38. 38 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent-to-Region Navigate Region: QueueActionEventInRegion af:region Parent View Task Flow View2 View3 View4 View5 toView2 toView5 View1 Managed Bean Handle Navigation RichRegion region = ... region.queueActionEventInRegion(...) Press to Navigate toView1
  39. 39. 39 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes –  Shared Data Control –  Input Parameter –  Region Events –  Other •  Contextual Events •  Exercises
  40. 40. 40 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Navigate Parent View : Parent Activity af:region Shopping Cart View CheckoutView checkout Task Flow View1 View2 FailView Task Flow checkoutCallFailed
  41. 41. 41 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Navigate Parent View : Parent Activity af:region Shopping Cart View CheckoutView checkout Task Flow View1 View2 FailView Task Flow checkoutCallFailed
  42. 42. 42 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Region-to-Parent Navigate Parent View : Parent Activity af:region Shopping Cart View CheckoutView checkout Task Flow View1 View2 FailView Task Flow checkoutCallFailed
  43. 43. 43 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes –  Shared Data Control –  Input Parameter –  Region Events –  Other •  Contextual Events •  Exercises
  44. 44. 44 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. About Contextual Events •  Mechanism on the ADF binding layer for creating loosely coupled publish and subscribe event models •  Events may carry a data payload –  Payload does not have to be a single simple scalar type but can be a complex object •  Require fragment based task flows embedded within page regions •  Task flows with event producer and consumers can be saved in ADF libraries
  45. 45. 45 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Contextual Events #1 Parent View ParentViewPageDef View Port View Port Region 1 Region 2 ViewPageDef ViewPageDef 1 2 Event Map Raise Event
  46. 46. 46 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent View ParentViewPageDef View Port View Port Region 1 Region 2 ViewPageDef ViewPageDef Contextual Events #2 2 1 Event Map Raise Event
  47. 47. 47 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Parent View ParentViewPageDef View Port View Port Region 1 Region 2 ViewPageDef ViewPageDef Region 3 View Port Contextual Events #3 1 23 Event Map Raise Event
  48. 48. 48 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Contextual Events •  Discoverability –  Event producer and event receiver •  Documentation •  Event payload –  What type of object is it? –  What is in a payload? •  Developer "skill-up" Challenges
  49. 49. 49 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Program Agenda •  Task Flow Call Options •  Region Interaction Recipes –  Shared Data Control –  Input Parameter –  Region Events –  Other •  Contextual Events •  Exercises
  50. 50. 50 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Exercise #1 •  The corporate architecture board is asked to suggest a solution for implementing master-detail behavior between two regions •  The application requirement is to coodinate the content displayed in the region such that one shows customer information and the other the selected customer's orders •  Further the requirement is that the view shows the master-detail behavior upon its initial rendering •  Changing the customer displayed in the parent (customer) region should immediately show the associated orders is response Parent-Child Relationship Between Regions
  51. 51. 51 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Exercise #1 Parent-Child Relationship Between Regions Parent View Customer View Customer - Orders View
  52. 52. 52 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Exercise #2 •  The requirement is for a task flow in a region to be able to hide / show components in the parent view •  The use case that needs to be implemented is to conditionally hide / show (default) a panel accordion Help the Team
  53. 53. 53 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Exercise #2 Hide/Show Components From a Region Parent View RegionCustomer Orders Pending Shipments Payments Conditionally Hide&Show Accordion Questions?
  54. 54. 54 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Conclusion •  Keep it simple! Contextual events is powerful but not needed in many cases •  Don't make any assumption in a task flow about the environment the task flow executes in and how it is called •  Document task flow requirements for input parameters and return values •  Use task flow templates
  55. 55. 55 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Further Reading •  ADF Region Interaction Functional Pattern –  http://www.oracle.com/technetwork/developer-tools/adf/adfregioninteraction-155145.html •  Contextual Events Introduction –  http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html •  Contextual Events: Callback pattern –  http://www.oracle.com/technetwork/developer-tools/adf/learnmore/ regionpayloadcallbackpattern-1865094.pdf •  Master- commander: reusable contextual event solution –  http://www.oracle.com/technetwork/issue-archive/2012/12-nov/o62adf-1867716.html •  Parent view initializing region navigation –  http://www.oracle.com/technetwork/developer-tools/adf/learnmore/ externaltrainnavigationpattern-1845645.pdf
  56. 56. 56 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

×