What You May Need to Know About Wrapping Java Code as a SOAP Service How to Embed Java Code Snippets into a BPEL Process with the bpelx:exec Tag

13-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite extensionActivity bpelx:exec language=java [CDATA[XMLElement elem = XMLElement getVariableDataoutput, payload; String t = elem.getTextContent; elem.setTextContentt + , set by java exec 2;]] bpelx:exec extensionActivity . . . sequence process For information on using this activity, see Section 13.4, Using Java Embedding in a BPEL Process in Oracle JDeveloper.

13.2.5 How to Use an XML Facade to Simplify DOM Manipulation

You can use an XML facade to simplify DOM manipulation. Oracle BPEL Process Manager provides a lightweight Java Architecture for XML Binding JAXB-like Java object model on top of XML called a facade. An XML facade provides a Java bean-like front end for an XML document or element that has a schema. Facade classes can provide easy manipulation of the XML document and element in Java programs. You add the XML facade by using a createFacade method within the bpelx:exec statement in the .bpel file. Example 13–5 provides an example: Example 13–5 Addition of XML facade bpelx:exec name= ... [CDATA ... Element element = ... ElementgetVariableDatainput,payload,loanApplication: Create an XMLFacade for the Loan Application Document LoanApplication xmlLoanApp= LoanApplicationFactory.createFacadeelement; ...

13.2.6 How to Use bpelx:exec Built-in Methods

Table 13–1 lists a set of bpelx:exec built-in methods that you can use to read and update scope variables, instance metadata, and audit trails. Table 13–1 Built in Methods for bpelx:exec Method Name Description Object lookup String name JNDI access long getInstanceId Unique ID associated with each instance String setTitle String title String getTitle Title of this instance String setStatus String status String getStatus Status of this instance void setCompositeInstanceTitleString title Set the composite instance title Incorporating Java and Java EE Code in a BPEL Process 13-5

13.2.7 How to Use Java Code Wrapped in a Service Interface

Not all applications expose a service interface. You may have a scenario in which a business process must use custom Java code. For this scenario, you can: ■ Write custom Java code. ■ Create a service interface in which to embed the code. ■ Invoke the Java code as a web service over SOAP. For example, assume you create a BPEL process service component in a SOA composite application that invokes a service interface through a SOAP reference binding component. For this example, the service interface used is an Oracle Application Development Framework ADF Business Component. The high-level instructions for this scenario are as follows. To use Java code wrapped in a service interface: 1. Create an Oracle ADF Business Component service in Oracle JDeveloper. This action generates a WSDL file and XSD file for the service. 2. Create a SOA application that includes a BPEL process service component. Ensure that the BPEL process service component is exposed as a composite service. This void setIndex int i, String value String getIndex int i Six indexes can be used for a search void setCreator String creator String getCreator Who initiated this instance void setCustomKey String customKey String getCustomKey Second primary key void setMetadata String metadata String getMetadata Metadata for generating lists String getPreference String key Access preference void addAuditTrailEntryString message, Object detail Add an entry to the audit trail void addAuditTrailEntryThrowable t Access file stored in the suitcase Object getVariableDataString name throws BPELFault Access and update variables stored in the scope Object getVariableDataString name, String partOrQuery throws BPELFault Access and update variables Object getVariableDataString name, String part, String query Access and update variables void setVariableDataString name, Object value Set variable data void setVariableDataString name, String part, Object value Set variable data void setVariableDataString name, String part, String query, Object value Set variable data Table 13–1 Cont. Built in Methods for bpelx:exec Method Name Description