66
<Insert Picture Here> Oracle Forms Integration with SOA Dmitry Nefedkin Oracle ISV Migration Center FMW Consultant [email protected]

Oracle Forms Integration with SOA

Embed Size (px)

DESCRIPTION

Oracle Forms Integration with SOA

Citation preview

Page 1: Oracle Forms Integration with SOA

<Insert Picture Here> <Insert Picture Here>

Oracle Forms Integration with SOA

Dmitry Nefedkin

Oracle ISV Migration Center FMW Consultant

[email protected]

Page 2: Oracle Forms Integration with SOA

ISV Migration Center Team

• Who we Are ISV Migration Center Team is a team of senior technical consultants

based in Eastern and Central Europe and represents Oracle's technical investment

for partners.

• Mission Statement Enable partners to rapidly and successfully adopt and

implement Oracle latest technology

• What do we Offer Whether you are selling Oracle technology, building business

solutions, including hosted Internet solutions or providing system integration and

implementation services for Oracle technology, IMC Team can help you succeed.

• How can we assist We offer a wide range of free services for partners such as

one2one assistance, webinars, seminars and hands-on workshops.

ISV Migration Center blog: http://blogs.oracle.com/imc

Contacts:

Ruxandra Radulescu, ISV Migration Center Manager, EE&CIS

[email protected]

Page 3: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 4: Oracle Forms Integration with SOA

Oracle Forms Strategy

• “…There are no plans to desupport Oracle Forms and Reports…” – Oracle Tools Statement of Direction – http://www.oracle.com/technology/products/forms/pdf/10g/Too

lsSOD.pdf

• Clear statement of direction – Upgrade

• Move to the latest versions of Forms to ensure support, certification, use new features

– Integrate

• Use non-Forms technologies when/as the business dictates

• Provide “Forms-like” experience for building with Java technologies

Page 5: Oracle Forms Integration with SOA

Lifetime Support Policy for Fusion Middleware

• http://bit.ly/OFMLifetime

Page 6: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 7: Oracle Forms Integration with SOA

How can Forms be part of your SOA?

• Use recent versions of Oracle Forms

– Possible to integrate existing (or new) Forms applications with

new or existing development using the SOA concepts.

• With its support for Java and its integration into SOA,

Forms provides an incremental approach for

developers who need to extend their business

platform to JEE.

• This allows Oracle Forms customers to retain their

investment in Oracle Forms while leveraging the

opportunities offered by complementing technologies..

Page 8: Oracle Forms Integration with SOA

How can Forms be part of a Service Oriented

Architecture?

Some areas where Forms can be integrated with SOA :

• Use of external services

– Functionality added to call from Forms to Java :

• possible to use Web services and BPEL processes.

That’s the topic of the presentation

• Exposure of Oracle Forms business logic to the outside world

– Moving Forms code out of Forms into a place where it can be reused by other applications.

Detailed explanation of this approach is of the scope of the presentation

Page 9: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 10: Oracle Forms Integration with SOA

Calling out from Oracle Forms

Use of external services

• Oracle Forms can call out to Java on the server.

• Oracle Forms can make use of Java beans on the

client side and its native screen widgets can be

customized with custom Java code (PJC).

• We are concerned here with the functionality of calling

out to Java code residing on the server.

– With that functionality, Oracle Forms is able to call all kinds of

external services such as Web services and be part of a

BPEL process flow.

Page 11: Oracle Forms Integration with SOA

• The Java Importer is incorporated into the Forms

Builder:

– takes a class as an input

– creates a PL/SQL package that acts as a wrapper around

the Java class, making it possible to call Java code from a

PL/SQL trigger or function/procedure.

Calling out from Oracle Forms: calling Java code

Page 12: Oracle Forms Integration with SOA

Calling out from Oracle Forms: calling Java code

and finds all Java classes.

Page 13: Oracle Forms Integration with SOA

Calling out from Oracle Forms: calling Java code

• Using the built-in packages

ora_java and jni, the Importer will take a class definition like the following one and make a wrapper package;

• The package will be created with

the name of the class.

• Each public Java function will have

a corresponding PL/SQL function

and each Java function returning

void will result in a corresponding

PL/SQL procedure

Page 14: Oracle Forms Integration with SOA

Calling out from Oracle Forms: calling Java code

At runtime the class files needs to be accessible to the Forms runtime. Add either the full path to the directory where is the class file or add the full path to the JAR file to the CLASSPATH environment variable in the .env file

Page 15: Oracle Forms Integration with SOA

Calling out from Oracle Forms: web services

What is a Web Service?

WSDL

Web Service (J2EE, PL/SQL,

.NET,C/C++,

Legacy …)

Web Service

Client (J2EE, .NET,

PL/SQL …)

Points to

description

Describes

Service

Finds

Service

Invokes with

XML Messages

SOAP

UDDI

Registry

Points to

service

Page 16: Oracle Forms Integration with SOA

Calling out from Oracle Forms: web services

Basic flow

• Identify an external web service by WSDL

• Generate java proxy client from WSDL

• Package proxy into jar

• Wrap client using

Forms Java Importer

• Call from Forms

Page 17: Oracle Forms Integration with SOA

Calling out from Oracle Forms: web services

Generating a java proxy

Page 18: Oracle Forms Integration with SOA

Calling out from Oracle Forms: web services

Package proxy into a jar file

• Build and test the Web service proxy from within

JDeveloper.

• In order to call the Web service proxy from Forms, the

proxy must be deployed to the file system as a JAR

file

Page 19: Oracle Forms Integration with SOA

Calling out from Oracle Forms: web services

Wrap client using Forms Java Importer

• You can import the proxy class into Forms and call its functions from PL/SQL code. The functions imported from the proxy are listed below:

PACKAGE CurrencyConvertorSoapClient

/* forms.soa.samples.CurrencyConvertorSoapClient */ IS

--

-- DO NOT EDIT THIS FILE - it is machine generated!

--

-- Constructor for signature ()V

FUNCTION new RETURN ORA_JAVA.JOBJECT;

…….

-- Method: myConversionRate (Ljava/lang/String;Ljava/lang/String;)D

FUNCTION myConversionRate(

obj ORA_JAVA.JOBJECT,

a0 VARCHAR2,

a1 VARCHAR2) RETURN NUMBER;

Page 20: Oracle Forms Integration with SOA

Calling out from Oracle Forms: web services

Code to call from Forms

• The myConversionRate function takes two currency symbols and returns a number

• The WHEN-BUTTON-PRESSED trigger code is listed below: declare

myobj ORA_JAVA.JOBJECT;

ex ORA_JAVA.JOBJECT;

begin

myobj := currencyconvertorsoapclient.new();

:block3.rate := currencyconvertorsoapclient.myconversionrate(myobj,:block3.from,:block3.to);

exception

WHEN ORA_JAVA.JAVA_ERROR then

message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);

WHEN ORA_JAVA.EXCEPTION_THROWN then

ex := ORA_JAVA.LAST_EXCEPTION;

message(Exception.toString(ex));

end;

Page 21: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 22: Oracle Forms Integration with SOA

?

BPEL

BPEL Process Manager: Overview

The Orchestrator

Web Service

Java Service

ERP

SAP, Oracle, etc.

User Tasks

Database

Stored Procedures

Portal

J2EE

.NET

Page 23: Oracle Forms Integration with SOA

BPEL Process Manager: Overview

Strengths of BPEL

• Separation of business process definition from

implementation

– Orchestrates services

– Abstracted from changes in services

• Designed for long running processes

• Built-in support for asynchronous interaction

• Fault handling and compensating transactions

• Extensible

• Parallel flows

• Conditional branching

Page 24: Oracle Forms Integration with SOA

BPEL Process Manager: Overview

Based on standards

• Uses and extends the web services model

– WSDL for defining the interface

– XML and WSDL typed variables

– SOAP for communication

• XML Schema for definitions

• XPath for data querying

• XSLT for transformations

• WS-Addressing

Page 25: Oracle Forms Integration with SOA

BPEL Process Manager: Overview

… And open

• Web services / SOAP interface

– The WSDL interface of the BPEL process will be used to start

a new instance of the process from Oracle Forms.

• Public Java API

– Used internally as well

• Example: Console

– Used to query the worklist application from Oracle Forms

Page 26: Oracle Forms Integration with SOA

BPEL by example

start

Customer Service

United Load

end

?

10:00am

1:00am

Get cust info

Send RFQ

Receive quote

Send RFQ

Receive quote

Select best vendor

Star Loan

BPEL Flow

Handle customer data exception

<process>

</process>

<invoke>

<partnerLink>

<switch>

<faultHandlers>

<flow>

</flow>

<partnerLink>

<partnerLink> <receive>

<invoke>

<variable>

<process>

<variables>

<partnerlink>

<sequence>

<invoke>

<flow>

<sequence>

<invoke>

<receive>

</sequence>

<sequence>

<invoke>

<receive>

</sequence>

</flow>

<switch>

<case>

<sequence/>

</case>

<case>

<sequence/>

</case>

<switch>

</sequence>

</process>

Page 27: Oracle Forms Integration with SOA

Assign Tasks

Human

Workflow

Service

Task Complete

BPEL Process

WSDL

Interface

Human Workflow Architecture

Component Services

• Task Management Service

Task data, forms, Attachments

• Task Routing Service

Assignment, Dispatching

• User Metadata Service

Rules, Work queues

• Identity Service

Users, Roles

• Worklist Service

Task query, Reporting

• Notification Service

Email, Wireless

JDeveloper

Task Metadata BPEL Designer

Worklist

Application

Update

Task

Supervisor

Work Assignee

Process Owner

Custom App

Service Consumer

(Non-BPEL)

Java

API

Java POJO / EJB

For Oracle employees and authorized partners only. Do not distribute to third parties.

© 2010 Oracle Corporation – Proprietary and Confidential

Page 28: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 29: Oracle Forms Integration with SOA

Forms – BPEL PM integration: example

• Oracle Forms can take part in a BPEL process flow

as a manual process step or as an initiating step or

both.

• In the following example Forms is going to act both as

an initiator and as a manual process step.

• The process is for a consumer loan. The business

flow diagram below outlines what the process looks

like.

Page 30: Oracle Forms Integration with SOA

Forms – BPEL PM integration: example

Page 31: Oracle Forms Integration with SOA

Forms – BPEL PM integration: example

•When the user clicks the Submit button the Forms application initiates the BPEL process flow described earlier using the BPEL Web Service Interface.

•The process fetches Dave's Social Security Number and then gets his credit rating.

Page 32: Oracle Forms Integration with SOA

Forms – BPEL PM integration: example

• Next - collecting the offers from two

different loan vendors, Star Loans and

United Loans.

– United Loans uses an automated process

– Star Loan uses a manual process that is

implemented using the Forms application.

Page 33: Oracle Forms Integration with SOA

Forms – BPEL PM integration: example

• The loan officer at Star Loan queries the BPEL

process and sees the new request.

– He/she determines the appropriate interest rate and clicks

the Approve button.

– This will kick off the next step of the process where Dave

has the opportunity to select the best offer.

Page 34: Oracle Forms Integration with SOA

Forms – BPEL PM integration: example

• Dave sees the best loan offer in his

application and can select it by

clicking the Accept button. This will

again cause Forms to communicate

with the BPEL server and causes the

process to conclude.

Page 35: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 36: Oracle Forms Integration with SOA

Oracle Business Rules Overview

• True inference rules engine (based on Jess)

• Available and usable independent of Oracle

SOA/BPM

• Tight integration with Oracle SOA/BPM

• Usually positioned and used as part of SOA/BPM

Page 37: Oracle Forms Integration with SOA

Oracle Business Rules Overview

Facts

• Facts are what you run against the rules

– e.g. a loanRequest Fact

• Fact Types

– XML

• e.g. input / output defined on Rule component creation

– Java

• Provides access to Java classes and their methods

Page 38: Oracle Forms Integration with SOA

Oracle Business Rules Overview

Globals

• Like a public static variable in Java

– Constant / modifyable

– e.g. v_carLoanLimit – Upper limit for car loans

Page 39: Oracle Forms Integration with SOA

Oracle Business Rules Overview

Dictionary / Ruleset / Rule

• Rules live in Rulesets

• Rulesets live in Dictionaries

– Rulesets are the container for Rules and Decision tables

• Dictionaries are the containers for all Rule artifacts

– can be linked to each other

– e.g. Dict1 and Dict2 both linked to DictCommon to share

common functions

Page 40: Oracle Forms Integration with SOA

Oracle Business Rules Overview

IF / THEN Rules

Page 41: Oracle Forms Integration with SOA

Oracle Business Rules Overview

Decision Tables If CurrentDate.date = During Sale and

CustomerOrder.vipStatus = Platinum or Silver and CustomerOrder.totalAmount >= 700

Then Discount = 15 and status = APPROVED

Set of Values or Ranges to compare with

List of Values or Ranges

Resolve overlap between R1 and R3 by overriding R3 with R1

Page 42: Oracle Forms Integration with SOA

Business Rules in SOA Composite Different Usage Scenarios

Stand Alone

From Human Task

From BPEL

Page 43: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 44: Oracle Forms Integration with SOA

Forms - OBR integration: example

In the following example Forms is going to use Oracle Business Rules to check the Age of the requestor of a Loan.

Page 45: Oracle Forms Integration with SOA

Forms - OBR integration: example

• When the user clicks the Submit button the Forms

application calls the Decision Service using a Web

Service proxy to execute a Rule.

Page 46: Oracle Forms Integration with SOA

Forms - OBR integration: example

If the Rule result is «Accepted» then the Forms application initiates the BPEL process flow described earlier using the BPEL WebService Interface.

Page 47: Oracle Forms Integration with SOA

Forms - OBR integration: example

Page 48: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 49: Oracle Forms Integration with SOA

Oracle BI Publisher Overview

Simplified Report Maintenance

Separate query, layout, and translation

Report

output

Flexibility

Reduced maintenance

Data Logic

Layout

Translation BI Publisher

Page 50: Oracle Forms Integration with SOA

Report Outputs

XML

Report Templates

Multiple Data Sources

Oracle BI Publisher Overview

Faster Development

• Business users create layouts with

familiar desktop tools

• IT builds data model

Rapid Development

Page 51: Oracle Forms Integration with SOA

Layout Templates

XML

EDI

EFT

Output Formats Destinations

BI Publisher

PDF

HTML

Excel

Power

Point

CSV

Flash

RTF

Email

Printer

Fax

e-Commerce

Repository • Word

• Acrobat

• JDev

Layout Tools

• Excel

• Flex

• Others

Oracle BI Publisher Overview

Multiple output formats & delivery destinations

Web Services

Oracle 10g, Oracle BI EE,

Oracle BI Apps SQL Server

E-Business Suite,

PeopleSoft, JDE

OLAP

XSL

Page 52: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 53: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Create a client for the BIP Web Service

• It is possible to integrate BI Publisher via Web

Services in Oracle Forms

– Create a proxy for the BIP Web Service with Oracle

JDeveloper

• Create a new Generic Application in JDeveloper

• Create a Generic Project

• Create a Web Service Proxy

Page 54: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Create a client for the BIP Web Service

• Choose as your WSDL Document URL the

appropriate URL of your BI Publisher Server:

http://<machine>:<port>/xmlpserver/services/PublicReportService

?wsdl

Page 55: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Create a client for the BIP Web Service

• The Web Service proxy is created

• PublicReportServiceClient.java is

opened in the code Editor

Page 56: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Testing the client for the BIP Web Service

Now we will test the web service.

• In PublicReportServiceClient.java :

– find the line : // Add your code to call the desired methods.

– For example add something like the following code fragment

to call one of your BI Publisher Report and create it in your

prefered output format to the file system.

Page 57: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Testing the client for the BIP Web Service

Page 58: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Testing the client for the BIP Web Service

• C:\temp\test.pdf has been generated :

Page 59: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Calling the BIP report from Forms

• To call the method runReport() from a Forms

application we need some additional code because we

should not: use the method main() from outside, modify

the generated method runReport ().

• There are two conceptual ways to do that:

– write a wrapper class around PublicReportServiceClient.java

– write an additional customized method in

PublicReportServiceClient.java which we will call from outside

• For reasons of simplicity, we’ll go the second way and add a

method in PublicReportServiceClient.java:

public void callRunReport (String reportPath, String username,String

password, String format, String template, String outFile)

Page 60: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Calling the BIP report from Forms

• Deploy the proxy in the jar file

• Expose the necessary classes to Forms Builder

• In the Forms Builder create a new Forms module and import the classes – bip_proxy.proxy.PublicReportServiceClient

– java.lang.Exception

Page 61: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Calling the BIP report from Forms

• The 2 following packages are created :

• Define the application logic in Forms and call the BI

Publisher web service by using the PL/SQL procedure

PublicReportServiceClient.callRunReport()

Page 62: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Calling the BIP report from Forms

The file is generated to Oracle_Forms\forms\webutil on the application server and /webutil/ is a virtual path mapped to Oracle_Forms\forms\webutil.

Page 63: Oracle Forms Integration with SOA

Forms - BI Publisher integration: example

Calling the BIP report from Forms

• Run the Form

Page 64: Oracle Forms Integration with SOA

<Insert Picture Here>

Agenda

• Oracle Forms strategy & support policy

• How can Forms be part of your SOA?

• Calling an external service from Forms

• Integrating Forms and BPEL PM

– Oracle BPEL PM Overview

– Forms – BPEL PM integration: example

• Integrating Forms and Oracle Business Rules

– Oracle Business Rules Overview

– Forms - OBR integration: example

• Integrating Forms and BI Publisher

– Oracle BI Publisher Overview

– Forms - BI Publisher integration: example

• Try it by yourself

Page 65: Oracle Forms Integration with SOA

Try it by yourself

• Oracle ISV Migration Center FMW consultants can

deliver “Oracle Forms Integration with SOA” workshop,

where you can try to develop the samples by yourself on

your laptops and also learn more details on this topic:

– 3 days

– 12 presentations

– 9 labs

Please contact Ruxandra Radulescu

([email protected] ) if you would like to participate

in the workshop.

Page 66: Oracle Forms Integration with SOA

Questions

©2010 Oracle Corporation

Dmitry Nefedkin

Oracle ISV Migration Center FMW Consultant

[email protected]

ISV Migration Center blog: http://blogs.oracle.com/imc