Using state-engine-as-sca-component-final

download Using state-engine-as-sca-component-final

of 47

  • date post

    15-Jan-2015
  • Category

    Technology

  • view

    2.447
  • download

    1

Embed Size (px)

description

Integrate a state engine (Apache Commons SCXML) as a Spring Component in Oracle SOA Suite 11g. It shows some "advanced" use cases for the Spring Component in SOA Suite 11g.

Transcript of Using state-engine-as-sca-component-final

  • 1. Using State-Engine as an SCA Spring component in SOA Suite 11g OOW 2010 Guido Schmutz, Technology Manager / Partner Trivadis AG 23.09.2010, San Francisco

2. Introduction

  • Guido Schmutz
    • Working for Trivadis for more than 13 years
      • leading and independent IT service company operating in Germany, Austria and Switzerland
    • Oracle ACE Director for Fusion Middleware and SOA
    • Co-Author of different books
    • Consultant, Trainer Software Architect for Java, Oracle, SOA and EDA
    • More than 20 years of software development experience
    • Contact:[email_address]
    • Blog:http://guidoschmutz.wordpress.com/

SOA Suite 11g Spring Component / Apache Commons SCXML 3. About Trivadis

  • Swiss IT consulting company
    • 13 locations in Switzerland, Germany and Austria
    • ~ 540 employees
  • Key figures 2008
    • Services for more than 650 clients in over 1600 projects
    • Over 150 service level agreements
    • More than 5000 training participants
    • Research and development budget:CHF 6.0 Mio. / EUR 3.6 Mio.

4. Idea for this session

  • Test what you can really to with the Spring Component
    • A bit more than just another HelloWorld sample
    • Test Drive it with a more complex use case
  • Integrate an existing implemementation (Apache Commons SCXML library) into SOA Suite as an Spring Component
    • By that show that a state engine offers another (sometimes better?) approach for documenting (business) processes
  • Just a Proof of Concept for myself !!
  • Have a sexy presentation topic for OOW 2010 ;-)

SOA Suite 11g Spring Component / Apache Commons SCXML 5. Result

  • Not successfull !
  • Issues with the classloader when trying to initiate the Commons SCXML (ClassNotFoundException)!
  • Im talking to the Oracle Development to see how to solve that!

SOA Suite 11g Spring Component / Apache Commons SCXML 6. Summary

  • There can be issues with the classloader
  • Make sure that you test what you want to integrate right upfront
  • So this is it !???
  • Of course not, just changed my topic slightly and I will present some interesting use cases with the Spring Component in SOA Suite 11g and in a 2nd part the Apache Commons SCXML library!

SOA Suite 11g Spring Component / Apache Commons SCXML Lessons learnt:Do not create sexy and fancy abstracts just toget accepted to OOW ;-) Or make sure before that its somehow achievable.... 7. SOA Suite 11g Spring Component / Apache Commons SCXML OOW 2010 Guido Schmutz, Technology Manager / Oracle ACE Director Partner Trivadis AG 23.09.2010, San Francisco 8. Agenda

  • Spring Component of SOA Suite 11g
    • Introduction
    • Hello World
    • Advanced Use Cases
  • State Machine and Apache Commons SCXML
    • What are State Machines
    • What is Apache Commons SCXML

SOA Suite 11g Spring Component / Apache Commons SCXML Data are always part of the game. 9. SOA Suite 11gR1 PS2 Architecture Oracle Restricted and Confidential Unified Runtime BPMN Policy Manager Optimized binding Human Workflow (+AMX, AG, Orgn) Business Rules Oracle Service Bus Common JCA-based connectivity infrastructure Repository EM console +BPMN Screens BAM B2B Mediator Workspace Process Portal (WC spaces) MS OfficeBPM Studio (with Business and IT views) Shared BPMN Model Business ViewBPA BPMN 2.0,BPEL Rich End User Interaction Web based customization Process Composer BPEL Process Analytics Proc Cubes Spring 10. The Spring component

  • Officially introduced with SOA Suite 11g PS2
  • Allows to publish Java Interfaces implemented by Spring beans as a service that can be used inside a composite application
  • By that
    • part of the logic required in a SOA composite can be easily implemented in Java an used like any other service component
    • a Spring Ban can be reused within the composite and even outside the composite either as an EJB or as a Web Service
  • Additionally the Java beans in the Spring Context component can call services exposed by other Service components and Adapter bindings
    • Java bean can retrieve records from a database table using the DB adapter

SOA Suite 11g Spring Component / Apache Commons SCXML 11. Agenda

  • Spring Component of SOA Suite 11g
    • Introduction
    • Hello World
    • Advanced Use Cases
  • State Machine and Apache Commons SCXML
    • What are State Machines
    • What is Apache Commons SCXML

SOA Suite 11g Spring Component / Apache Commons SCXML Data are always part of the game. 12. Hello World Step 1 TheHelloWorldImplPOJO used inside a Spring component SOA Suite 11g Spring Component / Apache Commons SCXML Lessons learnt:Make sure to compile classes before wiring! 13. Hello World Step 2

  • Add theGreetingProviderstrategy interface to provide an extended greeting message

SOA Suite 11g Spring Component / Apache Commons SCXML 14. Hello World Step 3

  • Implement the GreetingProvider as aseparate Spring component and wire it tothe HelloWorld component

15. Hello World Step 4

  • Implement theGreetingProvideras a Mediator component and wire it to the HelloWorld component

Lessons learnt:if you delete a wire, the element is also removed 16. Element

  • Declares a Spring bean that SCA exposes as a service
  • Takes the following attributes
    • Name
      • the name of the service (required)
    • Type
      • The fully qualified Java type of the Java class to be exposed as an SCA service (required)
    • Target
      • The bean to be exposed as a service (required)

SOA Suite 11g Spring Component / Apache Commons SCXML 17. Element

  • Declares a Spring bean representing an SCA service external to the Spring application context
  • Takes the follwing attributes
    • Name
      • The name of the reference (required)
    • Type
      • The fully-qualified Java type of the interface or class representing the remote service (required)
    • Default
      • The target bean for the reference if none is specified (optional)

SOA Suite 11g Spring Component / Apache Commons SCXML 18. Callback

  • the concept of callbacks does not exist in the spring framework
  • For Oracle SOA Suite a callback is specified as a 2nd port type forinterface.wsdlor a 2 ndJava name forinterface.java
  • The spring metadata has only sca:services and sca:references and no way to specify a callback
  • To design a callback with spring, you must provide sca:services and sca:references with a specific name
    • create asca:serviceandsca:referenceusing naming conventions ofsomeServiceandsomeServiceCallback
    • Oracle SOA Suite recognizes this convention and creates a callback

SOA Suite 11g Spring Component / Apache Commons SCXML 19. Agenda

  • Spring Component of SOA Suite 11g
    • Introduction
    • Hello World
    • Advanced Use Cases
  • State Machine and Apache Commons SCXML
    • What are State Machines
    • What is Apache Commons SCXML

SOA Suite 11g Spring Component / Apache Commons SCXML Data are always part of the game. 20. Use Case 1: Accessing the Spring Context

  • Use Case : Want to access/lookup another bean from the spring context
  • Idea:Implement the Lifecycle Interface

SOA Suite 11g Spring Component / Apache Commons SCXML Lessons learnt:Only a BeanFactory and not an ApplicationContext is created! 21. Use Case 2: Groovy Script

  • Use Case:Want to use the Spring Dynamic Language Support to execute a Groovy Script
  • Idea:use thetag and reference the script and put the external libraries inSCA-INF/libof the SOA project

SOA Suite 11g Spring Component / Apache Comm