1 how java and bpel join forces how java and bpel join forces what every java developer should know...

42
1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006 Thursday 15th june

Upload: noah-glenn

Post on 12-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

1How Java and BPEL join forces

How Java and BPEL join forces

What every Java developer should know about BPEL

Lucas Jellema (AMIS)

NL-JUG’s J-Spring 2006

Thursday 15th june

Page 2: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

2How Java and BPEL join forces

Overview

Introduction of Service Oriented Architecture and BPEL (Business Process Execution Language)

Calling BPEL Services from Java Applications When, Why and How?

Invoking Java based Services from a BPEL Process When, Why and How?

Workflow Tasks picked up and performed by Java applications Human Workflow and Complex Automated Workflow

Conclusions

Page 3: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

3How Java and BPEL join forces

The SOA principles

Attitude, Way of thinking No individual, stand-alone applications Instead:

• Implementations of business processes• composition of services• Optional: execution in a container

Reuse of services Loosely coupled Standardized

interfaces Central management

facilities

Page 4: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

4How Java and BPEL join forces

Services in various shapes

Library (dll, jar) EJB URL RSS feed Portlet SOAP WebService Database View ….

If it exposes a clear, standardized interface

Page 5: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

5How Java and BPEL join forces

Timemachine….?

Are we back in 2000 => 1995 => 19990 => …..?What is new? Why is this such a hype?

Page 6: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

6How Java and BPEL join forces

SOA in 2006

Standards!

Industry-wide, supported by major vendors and governing bodies

Page 7: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

7How Java and BPEL join forces

SOA in 2006: Standards

XML Interfaces & protocols

From CORBA, DCOM, RMI to JMS, JCA and most importantly SOAP Web Services

Internet & HTTP Cross Technology Bridges

Apache WSIF, SOAP WebServices, Adapters in MOM, ESB and BPEL

Formal service specification using WSDL Tool and Programming-language support

IDEs, Frameworks, Libraries, Browsers Infrastructures

BPEL Container, Enterprise Service Bus, Web Service Management

Page 8: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

8How Java and BPEL join forces

Service Oriented Architecture Benefits

Money Lower IT development costs due to high level of

reuse Cost reduction through less manual action in

business process execution Time

Shorter time to market of business processes Quicker execution of business processes

Quality Higher quality systems through reuse of proven

components and services Better process execution because of better

interfaces and reduced humanual intervention

Page 9: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

9How Java and BPEL join forces

Overview

Introduction of Service Oriented Architecture and BPEL (Business Process Execution Language)

Calling BPEL Services from Java Applications When, Why and How?

Invoking Java based Services from a BPEL Process When, Why and How?

Workflow Tasks picked up and performed by Java applications Human Workflow and Complex Automated Workflow

Conclusions

Page 10: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

10How Java and BPEL join forces

Java application is looking for a 360 degrees customer view

CRM

CRMOLD

JCAFiles

FINANCIAL

Oracle EBS API

CREDIT

EJB

ORDERS

PL/SQL

SocioSysSOAP

Java Application

Page 11: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

11How Java and BPEL join forces

Challenges

The number of technologies to interface with Skills required Complexity of resulting code

The number of data structures and formats The very real danger of changes

Moving service endpoints Changing Service APIs

Reusing the “360 degrees Customer profile” service

Monitor (trace, audit, debug) service execution

Page 12: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

12How Java and BPEL join forces

SOA-style approach:Create a BPEL Service as intermediary

Note: could also be done using an Enterprise Service Bus!

Java Application CRM

CRMOLD

JCAFiles

FINANCIAL

Oracle EBS API

CREDIT

EJB

ORDERS

PL/SQL

SocioSysSOAP

Page 13: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

13How Java and BPEL join forces

Calling BPEL Service from Java

Calling a SOAP WebService For example using Apache AXIS, JAX-RPC

Calling a remote Enterprise Java Bean (Session Bean) from another JVM Generic Java API

Making a local (intra JVM) call using the local interface Generic Java API

Page 14: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

14How Java and BPEL join forces

The BPEL CustomerProfileService

CRMCRMOLD

JCAFiles

FINANCIAL

Oracle EBS API

CREDIT

EJB

ORDERS

PL/SQL

SocioSys

SOAP

Page 15: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

15How Java and BPEL join forces

Testing the BPEL CustomerProfileServicefrom the BPEL Console

Page 16: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

16How Java and BPEL join forces

Testing the BPEL CustomerProfileServicefrom the BPEL Console

Page 17: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

17How Java and BPEL join forces

Testing the BPEL CustomerProfileServicefrom the BPEL Console

Page 18: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

18How Java and BPEL join forces

Calling BPEL Service from a Java Application using RMI and BPEL Session Bean

Java Application is local client That invokes a (remote) service

• possibly In a different JVM

Application Server

Oracle BPEL PMServer

IDeliveryService Session Bean

Local JVM

RMI Port

Java Application

...invoke BPEL Service;...

Page 19: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

19How Java and BPEL join forces

Java Application Calling BPEL Service

Page 20: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

20How Java and BPEL join forces

Java Application Calling BPEL Service (2)

Oracle BPEL PMServer

IDeliveryService Session Bean

RMI Port

Page 21: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

21How Java and BPEL join forces

Putting a Faces on a BPEL Service

Create a Java Client GUI or a Java Web Application that exposes the BPEL Service

Using Java Server Faces – ADF Faces in Oracle JDeveloper 10.1.3 Create BPEL WebService DataControl from WSDL Create new JSF JSP page Drag & Drop UI Components

based on DataControl Run

Page 22: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

22How Java and BPEL join forces

Overview

Introduction of Service Oriented Architecture and BPEL (Business Process Execution Language)

Calling BPEL Services from Java Applications When, Why and How?

Invoking Java based Services from a BPEL Process When, Why and How?

Human Workflow Tasks Putting a (Java Server) Face on Web Services and

SOA

Conclusions

Page 23: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

23How Java and BPEL join forces

Calling Services from a BPEL Process

A BPEL Process is typically a combination of XML data manipulation Simple flow logic Loop, Decision Point, Wait,… Service Calls

Services can be implemented in virtually

any technology invoked through a

substantial number of protocols and adapters• HTTP, EJB, JCA, JMS, Oracle Apps, Email, FTP, File, Fax,

SMS, Java (WSIF), …

CRM

CRMOLD

JCAFiles

FINANCIAL

Oracle EBS API

CREDIT

EJB

ORDERS

PL/SQL

SocioSys

SOAP

Page 24: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

24How Java and BPEL join forces

Implement Business Process in a SOA

We will see a shift from ‘developing applications’ to ‘implementing business processes’

Business processes are implemented as a chain of service calls with some orchestration on top

Services do most of the actual work Providing and processing data from enterprise stores Calculations, Validations and Conversions Reporting and Interacting

A large portion of the functionality required by business processes is already available In existing (legacy) applications In a plethora of technologies, including Java

Exposing existing functionality as reusable service is key

Page 25: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

25How Java and BPEL join forces

SOA and Java Services

Reusable functionality implemented in Java can have one or more of several interface styles public method on POJO Servlet EJB SOAP WS

A BPEL Process can invoke each of these interface styles

A BPEL Process can act as wrapper for Java based Services Service (URL and Protocol) Virtualization

Page 26: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

26How Java and BPEL join forces

Calling Java Services from a BPEL Process

Call a SOAP WebService And wrap the Java service as a WebService

Call a Java Service wrapped with a WSIF binding For either EJB, Servlet/Http and plain (local) Java

Use exec tag to execute (local) Java code <bpelx:exec> to execute a snippet of Java code The snippet can invoke Entity and Session EJBs Not part of BPEL standard

Page 27: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

27How Java and BPEL join forces

Calling the Java Service through WSIF JavaBinding

POJO PriceCalculator

BPEL Process GetPriceQuote Needs to call PriceCalculator

for getting the base price May add some discounting

logic…

Page 28: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

28How Java and BPEL join forces

The WSIF-WSDL file for the PriceCalculator

Describes the Service details for consumers What:

Where:

Mapping WSDL/Java:

Page 29: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

29How Java and BPEL join forces

Include PriceCalculatorService in the BPEL GetPriceQuote Process

Create PartnerLink Browse for WSIF WSDL

From here on there is nodifference between Java& WSIF based servicesand other services

Note: the Java Classes need to be available on the BPEL PM Server

Page 30: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

30How Java and BPEL join forces

Running the GetPriceQuote BPEL Process

Page 31: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

31How Java and BPEL join forces

Composing a more complex BPEL Process:The ProcessOrder Service

The ProcessOrder service takes an order for a specific customer gets a price quote from the GetPriceQuote service gets the customer profile from the

CustomerProfileService awards a discount depending on the CustomerStatus processes the order straight into the Orders Database returns the total price for the order

1

2

3

4

5

6

Page 32: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

32How Java and BPEL join forces

The ProcessOrder Service

CRMCRMOLD

FINANCIAL

CREDIT

ORDERSSocioSys

GetPriceQuote

CustomerProfileService

ProcessOrderorders

123

4

5

6

5

3

2

Page 33: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

33How Java and BPEL join forces

Overview

Introduction of Service Oriented Architecture and BPEL (Business Process Execution Language)

Calling BPEL Services from Java Applications When, Why and How?

Invoking Java based Services from a BPEL Process When, Why and How?

Workflow Tasks picked up and performed by Java applications Human Workflow and Complex Automated Workflow

Conclusions

Page 34: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

34How Java and BPEL join forces

BPEL Processes and Human Workflow

Many Business Process require a form of humanual activities choose, approve, confer, communicate

BPEL Processes often contain such humanual steps in addition to automated service calls

A User Interface is typically required for the human workflow steps Email to notify Worklist to presents the outstanding tasks (Web) User Interface to inspect the task details, perform the

required operations and complete the task

Java Web Applications are very well suited for providing this Humanual Task User Interface

Page 35: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

35How Java and BPEL join forces

Workflow extension of the ProcessOrder Service

If order total is over 10k and the customer status is GOLD, let’s try to negotiate a deal Start workflow in which a human needs to negotiate a

deal, update the total price and complete the workflow An email is sent for notification of the employee to

start working on the deal-task A Java Web UI is used to present the task details and

allow update of Total Price and Task Status When the Workflow completes, the ProcessOrder

process resumes, possibly with an updated TotalPrice

Page 36: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

36How Java and BPEL join forces

ProcessOrder BPEL Process with Workflow

Page 37: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

37How Java and BPEL join forces

Very slightly modified Generic Oracle BPEL PM Worklist Application

Page 38: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

38How Java and BPEL join forces

Programmatic access to BPEL Workflow

Our Java Application can implement the interface for (human) workflow activities in BPEL processes Java GUI (Swing), Java Web App, Java WebService can

invoke the WorkList Service

Application Server

Oracle BPEL PMServer

IDeliveryService Session Bean

Local JVM

RMI Port

Java Application

...- Invoke remote WorkList Service;- Get Tasks- Execute Task and Update Worklist...

Page 39: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

39How Java and BPEL join forces

Programmatically Accessing the WorkList Service

Page 40: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

40How Java and BPEL join forces

Programmatically Accessing the WorkList Service

Page 41: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

41How Java and BPEL join forces

Overview

Introduction of Service Oriented Architecture and BPEL (Business Process Execution Language)

Calling BPEL Services from Java Applications When, Why and How?

Invoking Java based Services from a BPEL Process When, Why and How?

Workflow Tasks picked up and performed by Java applications Human Workflow and Complex Automated Workflow

Conclusions

Page 42: 1 How Java and BPEL join forces How Java and BPEL join forces What every Java developer should know about BPEL Lucas Jellema (AMIS) NL-JUG’s J-Spring 2006

42How Java and BPEL join forces

Conclusions

SOA in general and BPEL in particular promote reuse, loosely coupling, business agility

Java Applications can easily invoke BPEL Services Through RMI or SOAP WS

BPEL Process and call Java based services Through WSIF (POJO, EJB, Http/Servlet) or SOAP

WS

Java Applications can provide the User Interface for Humanual steps in BPEL Processes

Java and BPEL – a good team!