Friday 10 February 2017

HOW TO USE THE JAVA EMBEDDING IN ORACLE BPEL


      The Java Embedding activity allows us to add activities in a BPEL process in which we can write a Java snippet using standard JDK libraries, the BPEL APIs, custom and 3rd party Java Classes included in JAR files in deployed SCA composites (in SCA-INF/lib directory) and Java Classes and libraries available on the Classpath for the SOA Suite run time.


I will show the creation of the Hello World of Java Embedding – a very simple BPEL process that has a string as an input and a string as output. This simple process contains a Java Embedding activity that uses Java to:
  • Write a line of log output to the console
  • Set the name for the composite instance
  • Access the name element in the input parameter
  • Set the value on the output parameter
  • Write an entry in the BPEL audit trail
1.Create a SOA project "JavaEmbedPro"





2.Create a  synchronous Bpel "JavaEmbedBpel"




3.Open the Bpel editor and intialize the output for  the BPEL.





4.Drag and drop the Java Embedding under Oracle Extensions in the BPEL editor.




5.The code in the Java Embedding activity is the following:


                           

6.The XMLElement class used in this snippet is not part of the standard JDK APIs. Therefore, this class has to be imported in the BPEL process, using a special import element:

<import location="oracle.xml.parser.v2.XMLElement" importType="http://schemas.oracle.com/bpel/extension/java"/>





7.Snippet uses a number of the API methods available for use in Java Embedding:
  • getVariableData() - to access variables in BPEL process
  • setVariableData – to set the value on variables
  • addAuditTrailEntry() – add an entry to the audit trail
  • getPreference() – access preference (property)
  • setCompositeInstanceTitle() - set the title that is displayed in the EM FMW Console
  • getInstanceId( ) -get value of Unique ID associated with this BPEL process instance
  • setStatus(), setTitle(), setCreator – set meta data on process instance
  • setIndex() - set up to 6 index variables that can be used to query process instances through the BPEL API
8.Now we can deploy and test the process


Input Payload




Output Payload

















3 comments:

  1. Your Blog was Very Helpful to Corporate Business.PDF Signer

    ReplyDelete
  2. Very nice Blog. This blog is very informative and very useful for me to know about the benefits of digital signatures.Bulk PDF Signer

    ReplyDelete
  3. This blog post really help me to understand so many things and it's full of information. We provide Digital Signature Software

    ReplyDelete