Documente Academic
Documente Profesional
Documente Cultură
Asynchronously Invoking the ODI Scenario from the BPEL Process with Callback
Purpose
This tutorial walks you through the steps that are needed to manage a long-running Oracle Data Integrator (ODI) Scenario from the BPEL Process by invoking the ODI scenario asynchronously using callbacks. This demonstrates a more advanced approach by wrapping the ODI scenario with a Java service to manage the asynchronous communication with the BPEL process.
Time to Complete
Approximately 1 hour and 30 minutes
Topics
This OBE tutorial covers the following topics: Overview Scenario Verifying the Prerequisites Creating a New Application in JDeveloper and Deploying the ODI Wrapper Service to the Oracle Application Server Creating a New BPEL Process Updating the BPEL Process Interface Creating a Partner Link Representation of the ODIInvokerService Creating BPEL Preferences to Dynamically Update Process-Level Values Assigning the ODIStarterWebservice Input Values Encrypting and Setting the Password for the Callback Receiving the Asynchronous Reply Catching Possible Remote Faults Setting Default Input for Invoking the Process Deploying Your BPEL Project Testing the Process Summary
Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, the response time may be slow depending on your Internet connection.) Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step. The screenshots will not reflect the specific environment that you are using. They are provided to give you an idea of where to locate specific functionality in Oracle Data Integrator.
Overview
ODI provides a synchronous and asynchronous Web services interface for applications to invoke ODI scenarios out of the box. Currently, ODI can execute a Web service
asynchronously, but when the Web service is completed, it cannot reference back to the ODI job and signal that it completed successfully or failed. The callback reference allows ODI to call a Web service asynchronously and the Web service then knows where to call back ODI when the job is finished, to signal the outcome of the job. If a BPEL business process uses this interface to invoke a large, long-running load, it is likely that the synchronous invocation will time out before the
ODI load is complete. In this example, you deploy a Java Web service (ODIInvokerService) as an intermediary between BPEL and ODI. BPEL invokes the Java service and passes the ODI scenario details. The Java service then invokes the ODI load through the ODI API. When the load is complete, the Java service asynchronously calls back the BPEL instance through the BPEL PMs Java API, or by changing a parameter within the invocation of the Web service. The callback is performed using WS addressing. Thus, BPEL can asynchronously interact with long-running ODI loads. The Java service is built generically so that any ODI scenario can be called from any Web service process.
Scenario
Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for performing database management and integration tasks on various resources within the organization. In particular, Linda is responsible for data loading, transformation, and validation. She needs to manage long-running Oracle Data Integrator (ODI) scenarios from BPEL processes. If the BPEL business process uses this interface to invoke a large, long-running load, the synchronous invocation will time out before the ODI load is complete. For that reason, Linda makes a decision to invoke the ODI scenarios asynchronously using callbacks. Back to Topic List
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
1/70
09/07/12
Oracle Database 10g XE
From the Search By drop-down list, select Product or Family and enter odi. 5. Click Go to download. The Axis2 1.2 framework. To install this, perform the following steps:
1. 2. 3. 4. 1. 2.
Go to http://metalink.oracle.com. Log in with your username and password. Click the Patches and Updates tab, and then click Simple Search.
Go to http://www.mirrorgeek.com/apache.org/ws/axis2/1_2/axis2.war and download axis2.war to C:\temp. Deploy the axis2 application to OC4J using the following command: java -jar admin_client.jar deployer:oc4j:opmn://localhost:6004/as1013/home oc4jadmin oracle1 -deploy -file c:\temp\axis2.war -deploymentName axis2 -contextRoot /axis2.
3. 4.
Access the Axis2 page by using the URL http://localhost:8888/axis2/axis2-web/index.jsp. Log in using admin as the Username and axis2 as the Password.
The system should include the following configuration: odi-public-ws.aar must be deployed in Axis2. Use the Upload Service link on the Axis2 admin page to upload this file (download from here). The ODI Master and Work repository must be created. You can refer to the steps from here. The xml, xtd, and csv files for the examples must be available. For example, the GEO_DIM.xml file that is included with this sample has much data and is approximately 8 MB to demonstrate using a moderately sized XML file with ODI and BPEL. You can download the complete set of demo/xml files from here. The schema (ODI_STAGE) for the target tables of the exercise and a data server and physical schema for this schema must be available within the ODI Topology Manager. To do this, perform the following steps: Start the Oracle Database 10g XE Administrative Console. Log in using system as the Username and oracle1 as the Password. From the Enterprise Manager Console, select Administration > Database Users > Create Users. Provide the username as ODI_STAGE and password as oracle1. Select the DBA check box and click Create. Note that the ODI_STAGE user is created. Select Start > All Programs > Oracle > Oracle Data Integrator > Topology Manager to open the ODI Topology Manager. Scroll down the pane at the bottom left to click the Physical Architecture tab. At the top-left corner, under the Physical Architecture pane, click "+" to expand Technologies > Oracle. Right-click Oracle and select Insert Data Server. The Data Server: new Window appears. Enter the name as Local_XE, Instance / dblink (Data Server) as XE, User as ODI_STAGE, and password as oracle1. Next, click the JDBC tab. For the JDBC Driver value, click the Browse button and select Oracle JDBC Driver from the Name drop-down list. Click OK. For the JDBC Url value, click the Browse button and select jdbc:<hostname>:<port>:<sid>. Click OK. Populate the values as per your environment details. Click Test, Test again, and then click OK. Click OK in the Data Server: new window. Under the Physical Architecture pane, click "+" to expand Technologies > Oracle > Local_XE. In the Physical Schema: Local_XE.Schema window, under the Definitions tab, select ODI_STAGE from the Schema (Schema) drop-down list and ODI_STAGE from the Schema (Work Schema) drop-down list. Click the Context tab. Click Add context. Select Global from the Context drop-down list and set Logical Schema as ODI_STAGE. Click OK. This example uses a number of supplied files and the sources, which are located in the OBE_LABS directory. Download the OBE_LABS.zip file from here and extract them into your machine in the same directory as JDeveloper (for example: G:\OBE_LABS). If not done before, start the services and components for Database 10g XE, Oracle Data Integrator 10g (10.1.3.4), and Oracle SOA Suite 10g. It is required that you complete the OBE titled Developing an ODI XML Transformation That Can Be Executed Within a BPEL Process before attempting this OBE. It is also recommended that you complete the OBE titled Creating an ODI Error Hospital That Uses the BPEL Human Workflow . Back to Topic List
Creating a New Application in JDeveloper and Deploying the ODI Wrapper Service to the Oracle Application Server
In this part of the example, you deploy the Java Wrapper Service, ODIInvokerService, to the Oracle Application Server. To create a new application and deploy the ODI wrapper service to the Oracle Application Server, perform the following steps: 1. Start JDeveloper by clicking jdeveloper.exe in G:\jdevStudio10131. Alternatively, use the SOA Suite JDeveloper shortcut on the desktop. If a dialog box opens that asks if you would like to migrate from a previous version of JDeveloper, click No. In the Applications Navigator on the left, right-click Applications and select New Application.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
2/70
09/07/12
2. In the window that opens, enter BPEL2ODIAsync in the Application Name field. Click OK.
3. In the Create Project window that appears, click Cancel. The BPEL2ODIAsync application appears in the Applications Navigator.
4. Select File > Open. Browse to the G:\ODIInvokerService_generation2 directory and select the ODIInvokerService.jpr file. Click Open and the ODIInvokerService appears in the Applications Navigator. Note: At this point, you have imported the Java Wrapper Service (ODIInvokerService) that acts as the intermediary between BPEL and ODI. It is recommended that you take some time to browse the classes and details of the service to gain an understanding of how it works. Note that the Java application contains two interfaces: a synchronous Web service interface (ODIAsyncStarterWebService) and a stand-alone Java interface (odi-async-standalone.jar). You will be invoking the Web service interface, which requires to pass callback information to call back the correct BPEL instance via the BPEL API and the ODI information to invoke the correct ODI scenario via the ODI API.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
3/70
09/07/12
6. To configure the library locations that will be used at run time, right-click the ODIInvokerService in the Applications Navigator and select Project Properties. In the window that opens, select Libraries from the Explorer on the left. From the Libraries list, select the Orabpel.jar library and click Edit. On the Edit Library Definition window, highlight the current Class Path value and click Remove.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
4/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
5/70
09/07/12
7. Highlight Class Path: and click Add Entry. Browse to your SOA_HOME/bpel/lib directory (E:\SOASuite10131\bpel\lib) and select orabpel.jar (if you get this library from another location, ensure that it is the same version as your installed SOA Suite). Click Select. On the Edit Library Definition window, ensure that the Deployed by Default check box is selected and click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
6/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
7/70
09/07/12
8. Similarly, from the Libraries list, select the Orabpel-common.jar library and click Edit. In the window that appears, highlight the current Class Path value and click Remove. Highlight Class Path: and click Add Entry. Browse to your SOA_HOME/bpel/lib directory (E:\SOASuite10131\bpel\lib) and select orabpelcommon.jar (if you get this library from another location, ensure that it is the same version as your installed SOA Suite). On the Edit Library Definition window, ensure that the Deployed by Default check box is selected and click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
8/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
9/70
09/07/12
9. On the Project Properties page, make sure that Export is selected for all the libraries that you edited and click OK. From the Applications Navigator, right-click ODIInvokerService and select Rebuild.
10. To deploy the Java service, ensure that you have a connection configured in JDeveloper to your application server, and that it is up and running. In the Applications Navigator, expand Applications > BPEL2ODIAsync > ODIInvokerService > Resources. Right-click WebServices.deploy and select Deploy to > your application server connection (for example, SoademoApplicationServer as shown
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
10/70
09/07/12
11. To verify that the service is deployed and accessible, open Application Server Control in a browser (http://localhost:8888/em/). Log in using your administrator credentials (User name: oc4jadmin and Password: welcome1). On the Enterprise Manager page, select the oc4j container to which you deployed ODIInvokerService (Home JVMs). On the OC4J Home page, click the Applications tab. On the Applications tab, under default, locate and select the odi-webservice application.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
11/70
09/07/12
12. On the odi-webservice page, click the Web Services tab, and then click the Test Service button.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
12/70
09/07/12
13. On the new page, retain the default URL and click Test Web Service. Click the Test Service button. The ODIAsyncStarterWebservice page appears. It contains an HTML form to invoke ODIInvokerService as well as links to the WSDL service definition and documentation. Click the Service Description link. In JDeveloper, save your work by selecting File > Save All. Note: Do not close the last page that you opened as you need it to copy the WSDL URL location in the next section. At this point, you do not test the service but you can see the input fields that are used to call the ODI scenario, and then call back to the BPEL process. The ODIINvokerService is now deployed and ready to run.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
13/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
14/70
09/07/12
2. On the BPEL Project Creation Wizard screen, name the project AsyncODICall and ensure that Asynchronous BPEL Process is selected. Click Next. Click the Flashlight icon next to the Input Schema Element field. Browse to your OBE_LABS directory and select ODIService.xsd. Click Open.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
15/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
16/70
09/07/12
3. In the Type Chooser window, expand Imported Schemas > ODIService.xsd and select ODIProcessRequest. Click OK.
4. Click the Flashlight icon next to the Output Schema Element field. In the Type Chooser window, expand Imported Schemas > ODIService.xsd and select ODIProcessResponse. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
17/70
09/07/12
5. Click Finish on the BPEL Project Creation Wizard screen. Your new AsyncODICall project opens in the main JDeveloper window. Save your project (select File > Save All).
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
18/70
09/07/12
To update the BPEL process interface, perform the following steps: 1. In the Application Navigator on the left, expand BPEL2ODIAsync > AsyncODICall > Integration Content and double-click AsyncODICall.wsdl to open it. In the AsyncODICall.wsdl file, click the Switch View button at the top left. With the AsyncODICall.wsdl file open in the main pane, locate the Structure pane (you may need to click View > Structure). Expand definitions and right-click Messages. Select Insert Message. In the window that appears, name the message ODIInvokerServiceResponseMessage. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
19/70
09/07/12
2. Right-click ODIInvokerServiceResponseMessage and select Insert inside message - ODIInvokerServiceResponseMessage > http://schemas.xmlsoap.org/wsdl/ > part. In the window that appears, name the part payload. Select the Reference Type to be element. Enter ns1:ODIInvokerServiceResponse in the Part Type field. Click OK.
3. Similarly, in the Structure pane, expand definitions and right-click Messages. Select Insert Message. In the window that appears, name the message ODIInvokerServiceFaultMessage. Click OK. Right-click the ODIInvokerServiceFaultMessage and select Insert inside ODIInvokerServiceFaultMessage >http://schemas.xmlsoap.org/wsdl > part. Name the part payload. Select the Reference Type to be element. Enter ns1:ODIInvokerServiceFault in the Part Type field. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
20/70
09/07/12
5. Under Port Types, select and right-click AsyncODICall. Select Insert inside AsyncODICall > http://schemas.xmlsoap.org/wsdl/ > operation. In the window that appears, name the operation onODIResult. Select One Way from the Operation Type drop-down list. Select client:ODIInvokerServiceResponseMessage from the Input drop-down list and click OK. A new operation appears under initiate.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
21/70
09/07/12
6. Again under Port Types, select and right-click AsyncODICall. Select Insert inside AsyncODICall > http://schemas.xmlsoap.org/wsdl/ > operation. In the window that appears, name the operation onODIError. Select One Way from the Operation Type drop-down list. Select client:ODIInvokerServiceFaultMessage from the Input drop-down list and click OK. A new operation appears under initiate.
7. Verify that your AsyncODICall.wsdl has the structure as shown below. Save your project (select File > Save All) and close the AsyncODICall.wsdl file. Click the AsyncODICall.bpel file tab and click the green check mark at the top of the page. This should refresh the BPEL process with the changes that you just made (you may have to close and reopen the BPEL file for the changes to take effect).
Note: You have now updated the BPEL interface by creating two new operations: onODIResult and onODIError.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
22/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
23/70
09/07/12
2.
From the Partner Link Type drop-down list, select ODIAsyncStarterWebservice_PL. From the Partner Role dropdown list, select ODIAsyncStarterWebservice_Role. Leave the other fields with the defaults and click OK. The ODIAsyncStarterWebservice Partner Link appears in your process diagram.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
24/70
09/07/12
3.
From the Components Palette at the right, select Process Activities from the drop-down list, and then drag the Invoke activity onto your process between the receiveInput and callbackClient activities. Drag one of the arrows from the new Invoke activity onto the ODIAsyncStarterWebservice Partner Link.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
25/70
09/07/12
4.
In the Edit Invoke window, name the activity Invoke_ODI. Click the Magic Wand icon next to the Input Variable field. In the Create Variable window, name the variable startOdiPlan_InputVariable. Click OK.
5.
Click the Magic Wand icon next to the Output Variable field. In the Create Variable window, name the variable startOdiPlan_OutputVariable. Click OK. Click OK in the Edit Invoke window. Your process diagram should look as shown below. Save your project.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
26/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
27/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
28/70
09/07/12
2.
In the Property Value box, enter 1. From the Encryption drop-down list, select Plain Text. Click the Create icon and repeat the preceding steps for the preferences in the following table. You should have your Deployment Descriptor Properties as shown in the following screenshot. Click OK. Note: Some of the property values are specific to your environment. The values here are generally correct if you have performed a basic SOA installation. Check your values. Property Name java.naming.provider.url OC4JUser Credentials Platform Property Value opmn:ormi://localhost:6003:home/orabpel oc4jadmin welcome1 ias_10g Encryption Plain Text Plain Text Encrypt on server on deploy Plain Text
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
29/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
30/70
09/07/12
2. Double-click the new Assign_1 activity. Click the General tab and name the activity Assign_ODIValues. Click the Copy Operation tab and from the Create drop-down list, select Copy Operation.
3. In the window that opens, in the From column, expand Process > Variables > inputVariable > payload > ODIProcessRequest > ODI_Info. In the To column, expand Process > Variables > startOdiPlan_InputVariable > parameters > StartOdiPlanElement > OdiInformationDTO_1. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
31/70
09/07/12
4. Now set the preferences from the last section. From the Create drop-down list, select Copy Operation. A new dialog box appears. In the From column, from the Type drop-down list, select Expression. Click the Xpath Expression Builder button at the top-right of the From column.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
32/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
33/70
09/07/12
5. In the Expression Builder window, under the Functions heading, select BPEL Xpath Extension Functions from the drop-down list. From the updated list, select getPreference and click the Insert Into Expression button. The Expression window now contains ora:getPreference(). Change this to ora:getPreference("retryCount"), where retryCount is the name of one of the preferences that you set earlier. Click OK.
6. In the To column, expand Process > Variables > startOdiPlan_InputVariable > parameters > StartOdiPlanElement > CallbackInformationDTO_2 > retryAttempts. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
34/70
09/07/12
7. Repeat the above steps (that created the retryCount copy rule from a preference) to create copy rules for the other preferences. The From and To fields are listed in the following table. Your Assign activity with the six copy rules should now match the following screenshot. From ora:getPreference("java.naming.factory.initial") ora:getPreference("java.naming.provider.url") ora:getPreference("OC4JUser") ora:getPreference("Platform") To jndiInitialCtxFactory jndiURL user jndiPlatform
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
35/70
09/07/12
You still need to create eight more copy rules. For each row in the following table, create a copy rule, select Expression in the From column and enter the corresponding value from the following table. In the To column expand Process > Variables > startOdiPlan_InputVariable > parameters > StartOdiPlanElement > CallbackInformationDTO_2 and select the value that matches the value from the table. Your copy operation should now have 14 copy rules inside it and look similar to the following screenshot. Click OK. From string("callback.bpel") string("onODIResult") string("onODIError") ora:getProcessURL() ora:getDomainId() ora:getProcessId() ora:getProcessVersion() ora:getConversationId() To callbackHandlerType callbackSuccessOperationName callbackErrorOperationName SOAPUrl domainName processName revision conversationID
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
36/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
37/70
09/07/12
2. In the Code Snippet field, cut and paste the code provided below. To save your project, select File > Save All.
/ *T h ef o l l o w i n gc o d ea p p e n d st h eC r e d e n t i a l sp r e f e r e n c e w i t ht h ei n s t a n c ec o n v e r s a t i o nI D , t h e ne n c r y p t sa n d a s s i g n st ot h eO D I I n v o k e r S e r v i c ei n p u tm e s s a g e . * / S t r i n gp w=( S t r i n g ) g e t P r e f e r e n c e ( " C r e d e n t i a l s " ) ; t r y{ S t r i n ge n c r y p t e d P W= c o m . c o l l a x a . c u b e . u t i l . C X P a s s w o r d U t i l s . e n c r y p t ( p w+" | | "+g e t C o n v e r s a t i o n I d ( ) ) ; a d d A u d i t T r a i l E n t r y ( " C r e d e n t i a l sE n c r y p t e d " ) ; s e t V a r i a b l e D a t a( " s t a r t O d i P l a n _ I n p u t V a r i a b l e " , " p a r a m e t e r s " , " / n s 1 : s t a r t O d i P l a n E l e m e n t / n s 1 : C a l l b a c k I n f o r m a t i o n D T O _ 2 / n s 1 : p w " ,e n c r y p t e d P W ) ; }c a t c h ( E x c e p t i o ne ){ e . p r i n t S t a c k T r a c e ( ) ; a d d A u d i t T r a i l E n t r y ( " E n c r y p t i o nf a i l e d :"+e . g e t M e s s a g e ( ) ) ; j a v a x . x m l . n a m e s p a c e . Q N a m eq n a m e=n e w j a v a x . x m l . n a m e s p a c e . Q N a m e ( " h t t p : / / b p e l . o r a c l e . c o m / " ," E n c r y p t i o n F a i l u r e " ) ; t h r o wn e wc o m . o r a c l e . b p e l . c l i e n t . B P E L F a u l t( q n a m e ) ; } a d d A u d i t T r a i l E n t r y( " A d d e de n c r y p t e dc r e d e n t i a l ss u c c e s s f u l l y " ) ;
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
38/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
39/70
09/07/12
2. Double-click the message branch at the extreme left of the Pick activity. In the window that appears, click the Flashlight icon next to the Partner Link field. Expand Process > Partner Links > client. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
40/70
09/07/12
3. From the Operation drop-down list, select onODIResult. Click the Magic Wand icon next to the Variable field. Name the variable OnMessage_onODIResult and click OK. Click OK in the OnMessage Branch window.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
41/70
09/07/12
4. Double-click the remaining (right) message branches of the Pick activity. In the window that appears, click the Flashlight icon next to the Partner Link field. Expand Process > Partner Links > client. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
42/70
09/07/12
5. From the Operation drop-down list, select onODIError. Click the Magic Wand icon next to the Variable field. Name the variable OnMessage_onODIError and click OK. Click OK in the OnMessage Branch window.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
43/70
09/07/12
6. Double-click the onAlarm branch. Change Time from 1 day to 1 hour (or whatever time is appropriate for your load to complete) as shown below. Click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
44/70
09/07/12
7. Expand all three branches. From the Components Palette, drag an Assign activity into all the three branches as shown below.
8. Open Assign_1 in the first (onODIResponse) onMessage branch. Create new copy rules to map the following variables and expressions to the output variable as shown in the following table (refer to the examples of screenshots below).
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
45/70
09/07/12
From Type Variable
Variable
Expression Expression
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
46/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
47/70
09/07/12
9. Click the General tab and name the activity Assign_ODIResponse. Click OK.
10. Double-click to open Assign_2 in the second (onODIError) onMessage branch. Create new copy rules to map the following variables and expressions to the output variable as shown in the following table. Your Assign_2 activity should look similar to the following screenshot. Click the General tab and name the activity Assign_ODIError. Click OK. From Type From To
Variable
OnMessage_onODIError > OutputVariable > Payload > ODIProcessResponse Payload >ODIInvokerServiceFault> > odiPlan odiPlan
Variable
Variable
OutputVariable > Payload > ODIProcessResponse> result OutputVariable > Payload > ODIProcessResponse> ConversationId
Expression
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
48/70
09/07/12
11. Open the Assign_3 activity in the third onAlarm branch. Create new copy rules to map the following variables and expressions to the output variable as shown in the following table. Your Assign_3 activity should look similar to what is shown below. Click the General tab and name the activity Assign_TimeOut. Click OK. From Type Expression From 'Timeout waiting for ODI to complete load' To OutputVariable > Payload > ODIProcessResponse > result
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
49/70
09/07/12
Expression
Expression
ora:getContentAsString(bpws:getVariableData('inputVariable', OutputVariable > Payload > 'payload', ODIProcessResp onse > odiPlan '/ns2:ODIProcessRequest/ns2:ODI_Info'))
12. Verify that your process diagram matches the following image. Click the Validate Process icon refresh and validate your process. Save your project (File > Save All). at the top of the process diagram to
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
50/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
51/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
52/70
09/07/12
3. Click the Magic Wand icon next to the Fault Variable field to create a new variable. Enter RemoteFaultVar as the variable name and click OK. Click OK in the Catch Branch window.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
53/70
09/07/12
4. Expand the Catch activity. From the Components Palette at the right, drag an Invoke activity onto the diagram inside the empty catch branch. Double-click the new Invoke activity.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
54/70
09/07/12
5. Name the activity Invoke_Callback. Click the Flashlight icon next to the Partner Link field. Select client and click OK.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
55/70
09/07/12
6. Click the Magic Wand icon next to the Input Variable field. Name the new variable ErrorOutput. Click OK. Click OK in the Invoke activity window.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
56/70
09/07/12
7. From the Components Palette, drag an Assign activity into the Catch branch above the Invoke_Callback activity. Double-click the new Assign activity to open it. Create new copy rules to map the following variables and expressions to the ErrorOutput variable as shown in the following table. From Type Variable From RemoteFaultVar > summary To ErrorOutput > Payload >ODIProcessResponse > result ErrorOutput > Payload >
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
57/70
09/07/12
Expression
Expression
ora:getContentAsString( ErrorOutput > Payload > bpws:getVariableData('inputVariable', ODIProcessResponse > odiPlan 'payload','/ns2:ODIProcessRequest/ns2:ODI_Info'))
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
58/70
09/07/12
8. Verify that your Assign activity looks as shown below. Click the General tab and name the activity Assign_CallbackError. Click OK. Save your project. Your process diagram should now match the following image.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
59/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
60/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
61/70
09/07/12
1.
2.
Click the Create icon and select defaultInput from the drop-down list. Click OK.
3.
Copy the the XML code provided below and paste it in the Property Value field. Click OK. Save your project. < s o a p : E n v e l o p ex m l n s : s o a p = " h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / e n v e l o p e / " > < s o a p : H e a d e r / > < s o a p : B o d yx m l n s : n s 1 = " h t t p : / / x m l n s . o r a c l e . c o m / O D I S e r v i c e " > < n s 1 : O D I P r o c e s s R e q u e s t > < n s 1 : O D I _ I n f o >
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
62/70
09/07/12
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
63/70
09/07/12
2. In the logging window at the bottom of the page, click the Apache Ant - Log tab. Verify that Build Successful is displayed in green when the process has finished deploying. Note: If you see any errors and/or your process fails to deploy, revisit the above steps to correct the errors.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
64/70
09/07/12
2. Select your AsyncODICall process in the list of processes at the left. Click the Descriptor tab. On this tab, you can view and set the preferences that you created in the earlier steps. Review and update any of these values if they are not correct.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
65/70
09/07/12
3. Return to the Initiate tab. From the Operation drop-down list, select initiate. Ensure that your ODI agent is running and your ODI scenario is ready to be invoked. Click the Post XML Message button to start the process. When the page refreshes, click the Visual Flow link to view the process execution.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
66/70
09/07/12
4. Click the Invoke_ODI activity to see the synchronous response from ODIInvokerService and verify that it has received the request successfully. Close the Invoke_ODI activity window.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
67/70
09/07/12
5. Click the Refresh View link . This refreshes the page to receive the asynchronous callback when the load is complete. Open the callbackClient activity to see the result of the execution. Open ODI Operator and verify that your ODI scenario was invoked and successfully completed.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
68/70
09/07/12
Summary
In this lesson, you learned how to: Verify the Prerequisites Create a New Application in JDeveloper and Deploy the ODI Wrapper Service to the Oracle Application Server
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
69/70
09/07/12
Create a New BPEL Process Update the BPEL Process Interface Create a Partner Link Representation of the ODIInvokerService Create BPEL Preferences to Dynamically Update Process-Level Values Assign the ODIStarterWebservice Input Values Encrypt and Set the Password for the Callback Receive the Asynchronous Reply Catch Possible Remote Faults Set Default Input for Invoking the Process Deploy your BPEL Project Test the Process
Back to Topic List Place the cursor over this icon to hide all screenshots.
oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135//odiscenario_bpelcallback.htm
70/70