SO-ADF
ODTUG Kaleidoscope 2010
Tuesday, 29th June
Lucas Jellema AMIS, The Netherlands
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
Purpose in life
• ADF: provide user interface for humans to perform tasks that implement process steps
– The front end to many, heterogeneous back end systems including database, cms, dwh/bi, workflow
• SOA (Suite): provide a well defined service interface on processes & integration layers
– Run the encapsulated implementation underneath the service interface
– Promote reuse & flexibility in the moving parts
– SOA == BAD (Business Agility through Decoupling)
Oracle Fusion MiddlewareADF and SOA
ADF Model
RDBMS
EJB & JPA(EclipseLink)
ADF BC
WebService Content Repository
BAMServer
POJO
SOA Suite
MobileADF Faces
Rich Client
JSP, Servlet
Web Service
Desktop
PortletView
Business Services
Enterprise Resources
EDN
Task UI
SDO Entity
Some material used from the book
• Shipping before OOW
– End of August
• On SOA and SOA Suite
• Chapters on
– ADF
– interaction betweenADF and SOA Suite
– Applying SOA concepts to ADF baseddevelopment
St Matthews Hospital Center
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
St Matthews On Line:Request Appointment for Patient
• ADF Faces Web Application for GPs to request a new appointment for a patient
– Invokes the SOA Composite application PatientAppointmentService as WebService
– Response: appointment identifier
• Additionally:
– Request status of appointment (date/time, instructions)
– Cancel apppointment
SOA Composite applicationPatientAppointmentService
getTask… claim okrequest… cancel statusfind…PatientsVw
ADF Model
RDBMS
EJB & JPA(EclipseLink)
ADF BC
WebService-RESTful-SOAP-SCA Composite
Content Repository
BAMServer
POJO
Human Task(SOA Suite Workflow Services)
Mobile-ADF Faces Mobile-Native Mobile Client
ADF Faces
Rich Client
JSP, Servlet
Web Service-RESTful-SOAP-Portlet
Desktop-Swing-MS Office
PatientAppointmentServiceData Control
PatientsServiceData Control
“anything Java can access”
ScheduleAppointmentTaskData Control
Alternative ways to call SOA Composite’s services from ADF
Instead of calling an XML/HTTP/SOAP based WebService
• An ADF Application could use the ADF Binding
– Via RMI, exchanging XML messages
• Or the EJB Binding
– Via RMI, exchanging (serialized) Java objects
• Note: the ADF Binding and the EJB Binding need to have been explicitly exposed
ADF applications with Data Controls consuming Web Services
• WebService Data Control
• WebService Proxy (POJO) published as Data Control
• WebServiceProxy wrappedby ADF BC
– Override doDML, doSelect,…
ADF Model
EJB & JPA(EclipseLink)
ADF BC
WebService-RESTful-SOAP-SCA Composite
POJO
POJO
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
ADF Faces provides User Interface for Human Tasks in SOA Suite
• Human Task is an asynchronous service
– Task details and data payload are the request
– The task outcome and the enriched payload are the response
• The execution of the service is ‘the ghost in the machine’: a human operator
– Who needs a user interface
• The UI is implemented in ADF Faces
The SchedulerService• When an Appointment is requested for a patient
– The PatientAppointmentService is initiated and hits the ‘ScheduleAppointment’ human task
– The task is assigned and appears in the WorklistApplication; the assignees are notified
• When an assignee opens the task in the worklistapplication, the special Task UI opens
– Worklist application embeds the task flow
Default Task Form for Human Task• For human tasks in SOA Composite applications
– A default Task Form can be generated
– With buttons for the supported outcomes
– And Form elements for the payload• Read only and updatable
Specialized Task Flows
• Alternatively: a specialized task flow can becreated for the humantask
Create ADF Task Flow based on Human Task definition
Add Task action binding to page
Configure Task Flow for Human Task component in FMW EM
ADF Faces Web Application X
TaskForm CTaskForm D
SOA Suite
Workflow
ServicesIFRAME
ADF Faces Web Application Y
TaskForm ATaskForm B
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
Introducing Business Activity Monitoring
• Operational Business Intelligence
• Data fed in from many sources:
– RFID sensors, BPEL, Database Triggers, RSS, ODI
• Real Time insight
• Dashboard
• Live updates
• Looking for threshold crossing, exceptions, trends, missing events
• Display visually and turn into alerts & notifications
Introducing Business Activity Monitoring
ADF Application
Embedding real time displays based on BAM Data Control
• Configure connection to BAM Server
• Create BAM Data Control
– Based on Data Objects inActive Data Cache
• Drag & Drop Data Control’scollections & attributes toADF Faces pages
– Just like ADF BC Data Control
– However: BAM Data Control is active
Configuring a ADF Faces 11g Graph based on a BAM Data Control
Live & Real Time dashboard in regular ADF Web Application
• Active Data Service (‘server push’) will pick changes in the BAM Data Control
– Underlying BAM ADC Data Object
• And push them tothe chart (or table)in the ADF page
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
Event Driven Architecture
Dealer
Order
Event Pool
Sales Desk
Marketing
Customer Relations
Shipping
Producer
EventDeliveryNetwork
Consumer
Consumer
Examples of events:
-User clicked on button
-Field was changed
-Record in table is being updated
-Result of query has changed
-Tom posted message on forum
-Order was dispatched
-Customer has changed address
- Patient has died or moved
Examples of event consumers:
-Server side actionListener
-clientListener, onValidateItem triggger
-Database table trigger
-Change Notification Handler
-Activity Stream
-Complex Event Processor
-Synch CRM BPEL process
- SOA Composite application
ADF Faces Web ApplicationPatientAdministration
PATIENTS
Application ModulePatientsService
Entity ObjectPatient
View ObjectPatientsVw
ADF Business
Components
ADF Application for Patient Administration
• One Business Event defined at St. Matthews is the ‘Patient has moved’ event
• Any application, process or service that (first) registers or detects that event should publish it
• The Patient Administration application is one point of origination for this business event
– And therefore should publish it to the EDN
• ADF Business Components has an easy integration with EDN
ADF Faces Web ApplicationPatientAdministration
SOA Suite
EDN
PATIENTS
Application ModulePatientsService
Entity ObjectPatient
View ObjectPatientsVw
ADF Business
Components
PatientHasMoved
Configure ADF BC Entity Objects
Define the Business Events
Consume Event in SOA Suite
And…. Action!!
ADF consuming EDN events
Steps:
• EDN events published on JMS
• ADF Faces application has registered as listener on the JMS queue
– An application scope bean collects events in ‘active data collection’
• ADF Faces page contains Active Table based on the ‘active data collection’
– New EDN events are pushed to the ADF Faces UI
Much more on events…
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
ADF BC providing Data Access service to BPEL processes
• SOA Suite communicates with database through Database Adapter (or AQ Adapter)
– SQL (select, DML), PL/SQL and polling
• Alternatively, Service Data Objects and a Data Access Service can be used
– XML and HTTP based
– Stateful dataset & two-way synchronization
DBAdapter
ADF Faces Web ApplicationPatientAdministration
SOA Suite
EDN
PATIENTS
Application ModulePatientsService
Entity ObjectPatient
View ObjectPatientsVw
(SDO) Web Service
PatientsService
ADF Business
Components
ADF BC, SDO and BPEL
• ADF BC Application Module can be exposed as Service Interface that is SDO enabled
• The SOA Suite ADF BC binding adapter connects to the SDO Service Interface
• BPEL Variables can be based on SDO Entity
– BPEL activity Create Entity does Insert
– BPEL activity Bind Entity does retrieve
– Assign in BPEL results in call to update on SDO
Expose ADF BC Service Interface
Test SDO enabled Service Interface
Using the ADF-BC Binding Adapter
Create SDO Entity based variable in BPEL process
Replace call to Insert Database Adapter option with Create Entity
BPEL activity Bind Entity does ‘select * into BPEL variable’
What SDO will do for us
• When the Entity Variable has been Created or Bound
• Then a link persists between the SDO Service and the BPEL variable
– When the BPEL variable is manipulated, the SDO Service is notified
– When the SDO is changed, the BPEL variable is synchronized
• For example when the ADF BC ViewObject or a database trigger does enrichment/conversion
PATIENTS
Application ModulePatientsService
Entity ObjectPatient
View ObjectPatientsVw
(SDO) Web Service
PatientsService
ADF Business
Components
ADF Faces Web ApplicationOtherPatientAdministration
Application ModuleSpecialPatientsService
Entity ObjectPatient
View ObjectPatientsVw
ADF BusinessComponents
ADF Faces Web Application
PatientAdministration
?
Service Enabled Entity Objects
• ADF BC supports Service Enabled Entity Objects based on ViewObjects in Service Interface of Application Module
• ADF takes care of turning local operations on ViewObject into WebService call to remote ADF service provider
• The consuming application uses ADF BC as always –with some limitations
– No joins in ViewObjects based on service enabled entities
– Separate transactions for service enabled and local entities
Creating a Service Enabled Entity Object
Overview• Position and Role of ADF and SOA Suite
• It’s a case of St Matthews Hospital
• ADF Application leveraging SOA Composite Applications
• ADF Faces provides UI for Human Task
• Leverage the ADF BAM Data Control
• ADF BC feeding business events into EDN
• ADF BC - the new Database Adapter?
– providing advanced database access through SDO
• Some SOA Concepts in ADF application development
SOA and UI – Different Worlds?
• Some services require or interact with a user interface. For instance: BPEL process containing Human Tasks.
• Taking it one step further: some user interfaces can be treated/offered/used like services!
UI Application can be a Service too• Applications can be exposed as a collection of UI
services - user interface components based on data and (data)services
• For example in the form of "portlets" that can be consumed by a Portal product in a mash up
Data
Remember the SOA Concepts?
• Services with standardized Contracts
• Producers and Consumers
• Cross-platform/technology
• Independent development/management of components
• Decoupling
• Events
Applying SOA Concepts to UI:WSRP Portlets
• WSRP Standard: WebService for Remote Portlet
– Exposed by Portlet Container (or Provider)
– Portlet renders its own UI/the content (HTML)
– Contract includes (input) parameters (String or String[]) and events (out, simple payload)
• Called by Portal/Portlet consumer
• Portlets can deal with data manipulation, events, navigation, AJAX and partial refresh
Portlet and Decoupling
• Just like normal web services
– Portlets can be located anywhere(we only need URL for endpoint)
– Portlets can be implemented in any technology – as long as the standards are followed
– The implementation of Portlets can change• as long as the contract (parameters/events) is safe
• Ideally the Portlet uses (style) classes and allows the consumer to apply the stylesheet
Drawing the Analogy
Traditional SOA Components:• Application ( = Consumer)
• Webservices ( = Service + Contract)
• Enterprise Service Bus ( = Service Provider)
• Queues (= Events and Event Listeners)
WSRP Portlet Components:• Portal ( = Consumer)
• WRSP Portlets ( = Service + Contract)
• Portlet Providers ( = Service Provider)
• Produces events for Portal (= Events and Event Listeners)
ADF Task Flows• With Oracle ADF (underlying UI technology of
WebCenter) comes an alternative way to develop UI Services: ADF Task Flows
• ADF Task flows are Portlet-like in many respects: stand alone, independently developable, reusable UI component
• Task Flow = one or multistep view, internal business logic, navigation flow, beans, …
– Communication from and to Task Flows through (contextual) events
Task Flow Contract
• Like Portlets, ADF Task Flows adhere to a Contract (native ADF).
Input:Parameters (initial)EventsNavigation commands
Output(Changed) ParametersEventsNavigation events
Comparing UI Service technologiesPortlet
• Remote
• Cross Technology
• Standards based
• Processing overhead– Slower page rendering
• Design Time and Run Time decoupling– Remote provider has to be up
• Needs portlet consumption framework, e.g. WebCenter– And portlet publication
Task Flow
• Local, native, ADF only
• Shared– Data Controls
– Transaction context
– Skin/Style
– Client side JavaScript & UI
• Rich Contract– Complex parameters
– Events out and in
• With complex payload
– Navigation influence
• Support for customization
Development with Portlets & Task Flows
• The use of Portlets and Task Flows allows for a decoupled way of developing applications
– Teams agree on a contract
– And both work their merry way based on the contract – in fairly insulated manner
• Reuse is possible based on that contract
• Maintenance of Portlet and Task Flow can be independent of consuming applications
– Note: task flow is integrated at design time
74
Summary and Conclusion
• ADF applications can make use of the WebServices exposed by SOA applications
• SOA Composites rely on ADF for
– ADF Faces to provide the UI for Human Tasks
– ADF BC to provide Data(base) access services
• ADF can also: publish events to EDN, expose BAM data, implements Admin UIs for SOA Suite
• Some SOA concepts are best practices in ADF application development too
Resources• Presentation and demos are on our blog
– http://technology.amis.nl/blog
• Contact me at:[email protected]
Top Related