|Oracle Fusion Middleware Adapter for Oracle Applications User's Guide|
11g Release 1 (18.104.22.168.0)
Part Number E10537-03
This chapter covers the following topics:
The Oracle Workflow Business Event System (BES) is an application service that leverages the Oracle Advanced Queuing (AQ) infrastructure to communicate business events between systems. The Business Event System consists of the Event Manager and workflow process event activities.
The Event Manager contains a registry of business events, systems, named communication agents within those systems, and subscriptions indicating that an event is significant to a particular system. Events can be raised locally or received from an external system or the local system through AQ. When a local event occurs, the subscribing code is executed in the same transaction as the code that raised the event, unless the subscriptions are deferred.
Subscriptions can include the following types of processing:
Executing custom code on the event information
Sending event information to a workflow process
Sending event information to other queues or systems
Business events are represented within workflow processes by event activities. By including event activities in a workflow process, you can model complex processing or routing logic for business events beyond the options of directly running a predefined function or sending the event to a predefined recipient.
Each business event represents a ready to use integration or extension point. Oracle E-Business Suite currently ships preconfigured with over 900 business events.
The uses of the Business Event System include:
System integration messaging hubs - Oracle Workflow with the Business Event System can serve as a messaging hub for complex system integration scenarios. The Event Manager can be used to ”hard–wire” routing between systems based on event and originator. Workflow process event activities can be used to model more advanced routing, content–based routing, transformations, error handling, and so on.
Distributed applications messaging - Applications can supply Generate and Receive event message handlers for their business entities. For example, message handlers can be used to implement Master/Copy replication for distributed applications.
Message-based system integration - You can set up subscriptions, which cause messages to be sent from one system to another when business events occur. In this way, you can use the Event Manager to implement point–to–point messaging integration.
Business–event based workflow processes - You can develop sophisticated workflow processes that include advanced routing or processing based on the content of business events.
Non-invasive customization of packaged applications - Analysts can register interesting business events for their Internet or intranet applications. Users of those applications can register subscriptions to those events to trigger custom code or workflow processes.
A business event is an occurrence in an Internet or intranet application or program that might be significant to other objects in a system or to external agents. For instance, the creation of a purchase order is an example of a business event in a purchasing application.
A string that uniquely identifies an instance of an event. Together, the event name, event key, and event data fully communicate what occurred in the event.
A standard Workflow structure for communicating business events, defined by the datatype WF_EVENT_T. The event message contains the event data as well as several header properties, including the event name, event key, addressing attributes, and error information.
A business event modeled as an activity so that it can be included in a workflow process.
A set of additional details describing an event. The event data can be structured as an XML document. Together, the event name, event key, and event data fully communicate what occurred in the event.
A registration indicating that a particular event is significant to a system and specifying the processing to perform when the triggering event occurs. Subscription processing can include calling custom code, sending the event message to a workflow process, or sending the event message to an agent.
If you do not want subscriptions for an event to be executed immediately when the event occurs, you can defer the subscriptions. In this way you can return control more quickly to the calling application and let the Event Manager execute any costly subscription processing at a later time.
An agent is a named point of communication within a system. Communication within and between systems is accomplished by sending a message from one agent to another. A single system can have several different agents representing different communication alternatives. For example, a system may have different agents to support inbound and outbound communication, communication by different protocols, different propagation frequencies, or other alternatives.
Adapter for Oracle Applications is deployed at design-time using Oracle JDeveloper and at run-time using the BPEL Process Manager.
This section discusses the process of configuring Adapter for Oracle Applications to create business event outbound subscriptions. It describes the tasks required to configure Adapter for Oracle Applications using the Adapter Configuration Wizard in Oracle JDeveloper.
Multiple BPEL Processes Consuming the Same Business Event
Please note that Adapter for Oracle Applications can handle multiple BPEL processes consuming the same business event. Adapter for Oracle Applications creates only single subscription for a particular business event regardless of the number of BPEL process consuming it. Internally, this subscription forwards business event message to a multi-consumer AQ. Since each BPEL process is an unique consumer for the event, when the message is placed in the queue, all BPEL processes are notified. Therefore, as a user you do not need to create a separate subscription for each BPEL process. All you need to do is to create the service for the event, and Adapter for Oracle Applications will take care of message delivery to each BPEL process.
For example, if there are three BPEL processes (BPEL1, BPEL2, and BPEL3) that want to consume the same business event (such as BE1 event). For each BPEL process, you create a service for the BE1 event using Adapter for Oracle Applications. Adapter for Oracle Applications in turn creates a single subscription for all the three BPEL processes - BPEL1, BPEL2, and BPEL3. This subscription puts BE1 event message in multi-consumer AQ.
At run time, when a BE1 event is raised, since the subscription is applicable to all the three BPEL processes, all these three deployed BPEL processes will be activated and would receive the same BE1 event message.
BPEL Process Scenario
Take a PO XML Raise business event as an example.
When a purchase order is created and approved, a purchase order approved business event oracle.apps.po.evnt.xmlpo is raised. The subscription to this event is created in the background to listen to the business event and get event details. The event data will be passed through BPEL process activities and then written in XML file as an output file.
If the BPEL process is successfully executed after deployment, you should get the same purchase order information from the output file once a purchase order is approved.
Prerequisites to Configure Outbound Business Events
A valid XML Gateway trading partner must be set up first.
The WF_Deferred Agent Listener must be up and running on the target instance.
The event should be enabled for BPEL to subscribe to it. The event should not be in the disabled mode.
BPEL Process Creation Flow
Based on the PO XML Raise business event scenario, the following design-time tasks are discussed in this chapter:
Create a new BPEL project.
Create a partner link.
Configure a Receive activity.
Add a partner link for the file adapter.
Configure an Invoke activity.
Configure an Assign activity.
To create a new BPEL project
Launch Oracle JDeveloper.
Click New Application in the Application Navigator.
The Create SOA Application - Name your application page is displayed.
The Create SOA Application - Name your application Page
Enter an appropriate name for the application in the Application Name field and select SOA Application from the Application Template list.
Click Next. The Create SOA Application - Name your project page is displayed.
Enter an appropriate name for the project in the Project Name field. For example, GetPOAckBusinessEvent.
The Create SOA Application - Name your project Page
In the Project Technologies tab, ensure that SOA is selected from the Available technology list to the Selected technology list.
Click Next. The Create SOA Application - Configure SOA settings page is displayed.
The Create SOA Application - Configure SOA settings Page
Click Finish. You have created a new application, and an SOA project. This automatically creates an SOA composite.
The Create BPEL Process page is displayed.
The Create BPEL Process Page
Enter an appropriate name for the BEPL process in the Name field. For example, GetPOAckBusinessEvent.
Select Define Service Later from the Template field. Click OK.
An empty BPEL process is created. The required source files including bpel and wsdl, using the name you specified (for example, GetPOAckBusinessEvent.bpel and GetPOAckBusinessEvent.wsdl) and composite.xml are also generated.
An Empty BPEL Process
Configuring an outbound business event requires creating a partner link to allow the outbound event to be published.
This task adds a partner link to the BPEL process. A partner link defines the link name, type, and the role of the BPEL process that interacts with the partner service.
To add a partner link
Click BPEL Services in the Component palette.
Drag and drop Oracle Applications from the BPEL Services list into the right Partner Link swim lane of the process diagram. The Adapter Configuration Wizard Welcome page appears. Click Next.
Enter a service name in the Service Name field. For example, GetPOApprovalEvent.
Enter the Service Name
Click Next. The Service Connection dialog appears.
Specifying a Database Service Connection
You can perform either one of the following options for your database connection:
Note: You need to connect to the database where Oracle Applications is running.
You can create a new database connection by clicking the Create a New Database Connection icon.
How to define a new database connection, see Create a New Database Connection.
You can select an existing database connection that you have configured earlier from the Connection drop-down list.
The Service Connection page will be displayed with the selected connection information. The JNDI (Java Naming and Directory Interface) name corresponding to the database connection appears automatically in the Database Server JNDI Name field. Alternatively, you can specify a JNDI name.
Note: When you specify a JNDI name, the deployment descriptor of the Oracle Applications adapter must associate this JNDI name with configuration properties required by the adapter to access the database.
The JNDI name acts as a placeholder for the connection used when your service is deployed to the BPEL server. This enables you to use different databases for development and later for production.
Note: For more information about JNDI concepts, refer to Oracle Fusion Middleware User's Guide for Technology Adapters.
Once you have completed creating a new connection for the service, you can add a business event by browsing through the list available in Oracle Applications.
For Oracle E-Business Suite Release 12:
If you are connecting to Oracle E-Business Suite Release 12, then the IREP File not present dialog appears indicating that Adapter could not find the Oracle Integration Repository data file corresponding to the database you are connecting in your workspace. Absence of the data file would make browsing or searching of Integration Repository tree considerably slow. You can choose to extract the data file and create a local copy of the Integration Repository data file. Once it is created successfully, Adapter will pick it up automatically next time and retrieve data from your local Integration Repository.
You can select one of the following options:
Click Yes to extract the Integration Repository data file.
Extracting Integration Repository Data File
After the system successfully creates a local copy of the Integration Repository data file, next time when you connect to the database, you will find the IRep Data File field appears in the Operation dialog indicating where your local copy exists with the creation date and time as part of the file name.
Using the Local Integration Repository Data File
Click No to query the Integration Repository data file from the live database you are connecting to display the Integration Repository tree.
Note: It is highly recommended that you create a local copy of the Integration Repository data file so that Adapter will query the data next time from the local copy in your workspace to enhance the performance.
Click Next in the Operation page to open the Oracle Applications Module Browser.
For Oracle E-Business Suite pre-Release 11.5.10:
If you are connecting to a pre-11.5.10 Oracle Applications instance, you must select the interface type in the Adapter Configuration Wizard. Select Workflow Business Event System to proceed.
Click Get Object in the Application Interface dialog to open the Oracle Applications Module Browser.
The Oracle Applications Module Browser combines interface data from Oracle Integration Repository with information about the additional interfaces supported by Oracle Application Adapter, organized in a tree hierarchy.
Oracle Applications Module Browser
The Oracle Applications Module Browser includes the various product families that are available in Oracle Applications. Each product family contains the individual products. Each product contains the business entities associated with the product. Business entities contain the various application modules that are exposed for integration. These modules are grouped according to the interface they provide.
Note: Business Events can be found in the Other Interfaces node, which is at the product family level. For more information, see Using the Oracle Applications Module Browser.
Expand the navigation tree to Product Families > Other Interfaces > Business Events > Outbound. The direction outbound is from the Oracle E-Business Suite perspective, in this case listening to business events from Oracle Applications. Select the appropriate business event, for example, oracle.apps.po.event.xmlpo, and click OK. The Application Interface page is displayed with selected business event.
Adapter Configuration Wizard - Application Interface Page
Click Next in the Application Interface page. The WF Event Schema Definition page for business event payload appears.
You must specify one of the following options to be used for the business event payload:
Note: When you select either the 'No Schema' or 'Any Schema' option, there is no need to further specify the schema information for your business event, and you will proceed to the next step.
If you select the No Schema option, then the payload data would be available in the form of string. This option also allows you to receive non-XML event payload.
If you select the Any Schema option, then XML payload of any schema could be attached to event payload. You should select this option if you know the payload is XML, but not sure of its schema.
If you select the Specify Schema option, then the Schema Location and Schema Element fields become visible. You must specify the location of schema file and then select the schema element that defines the payload of outbound business event.
Selecting Business Event Payload Schema
Select 'No Schema' and click Next.
The Finish page appears indicating that you have finished defining the business event service.
The wizard generates the GetPOApprovalEvent WSDL file corresponding to the oracle.apps.po.event.xmlpo business event service.
The main Create Partner Link dialog appears with the new WSDL file.
Click Apply and then OK to complete the partner link configuration.
Partner Link Information
The partner link is created with the required WSDL settings, and is represented in the BPEL project by a new icon in the border area of the process diagram.
The next task is to configure a Receive activity to receive event details from the partner link that you just configured for the Oracle Application adapter service as an input to the Assign activity.
To configure the Receive activity
In JDeveloper BPEL Designer, click BPEL Services and Components in the Component palette.
Drag and drop Receive from the BPEL activity list into the center swim lane of the process diagram.
Link the Receive activity to the partner link GetPOApprovalEvent that you just created earlier.
Associating the Receive Activity with the Partner Link
The Receive dialog appears.
Configuring the Receive Activity
Enter an appropriate name for the Receive activity.
The Dequeue Operation is automatically selected since the partner link has been configured with an outbound business event.
Specify a Variable to receive the message data from the partner link by clicking the Create icon to the right of the Variable field. The Create Variable dialog box appears.
Click OK to accept the default name.
Click Apply in the Receive dialog, then click OK.
If you are configuring an outbound business event, you need to add another partner link for the file adapter. This allows the outbound business event to write the data to the XML file.
To add a partner link for the file adapter
In JDeveloper BPEL Designer, click BPEL Services in the Component palette.
Drag and drop File Adapter from the BPEL Services list into the right Partner Link swim lane of the process diagram. The Adapter Configuration Wizard Welcome page appears.
In the Service Name page, enter a name for the file adapter service. For example, enter WriteEventData.
Specifying the Service Name
Enter a name for the file adapter service, for example, WriteEventData.
Click Next. The Adapter Interface page appears.
Specifying the Adapter Interface
Select the Define from operation and schema (specified later) radio button and click Next.
In the Operation page, specify the operation type. For example, select the Write File radio button. This automatically populates the Operation Name field.
Specifying the Operation
Click Next to access the File Configuration page.
Configuring the Output File
For the Directory specified as field, select the Logical Name radio button. Enter outputDir as the Directory for Outgoing Files (logical name) and specify a naming convention for the output file, such as EventAck%yyMMddHHmmss%.xml.
Tip: When you type a percent sign (%), you can choose from a list of date variables or a sequence number variable (SEQ) as part of the filename.
Confirm the default write condition: Number of Messages Equals 1.
Click Next, and the Messages page appears. For the output file to be written, you must provide a schema.
Click Browse to access the Type Chooser.
Expand the node by clicking Project Schema Files > APPS_WF_EVENT_T_GetPOApprovalEvent.xsd. Select WF_EVENT_T as the element and click OK.
The selected schema information will be automatically populated in the URL and Schema Element fields.
Populating the Selected Message Schema
Click Next and then Finish. The wizard generates the WSDL file corresponding to the partner link. The main Create Partner Link dialog box appears, specifying the new WSDL file.
Completing the Partner Link Configuration
Click Apply and then OK to complete the configuration and create the partner link with the required WSDL settings for the File Adapter service.
After adding the File Adapter partner link, you need to configure an Invoke activity to associate it with the File Adapter link.
Through the Invoke activity, the business event information can be written to the XML file you specified as the output directory.
To configure the Invoke activity
In JDeveloper BPEL Designer, select BPEL Activities and Components in the component palette.
Drag and drop an Invoke activity into the center swim lane of the process diagram after the Receive activity.
Link the Invoke activity to the WriteEventData File Adapter service.
Associating Invoke with the File Adapter Link
The Invoke activity will send event data to the partner link. The Edit Invoke dialog appears.
Enter a name for the Invoke activity, then click the Create icon next to the Input Variable field to create a new variable. The Create Variable dialog appears.
Select Global Variable, then enter a name for the variable. You can also accept the default name. Click OK to return to the Edit Invoke dialog.
Editing the Invoke Activity
Click Apply and then OK to finish configuring the Invoke activity.
Use the Assign activity to take the output from the Receive activity and to provide input to the invoke activity.
To configure the Assign activity
In JDeveloper BPEL Designer, select BPEL Activities and Components in the component palette.
Drag and drop the Assign activity into the center swim lane of the process diagram, between the Receive activity and the Invoke activity.
Double-click the Assign activity to access the Edit Assign dialog.
Click the General tab to enter a name for the Assign activity. For example, setEventData.
Select the Copy Operation tab, click the 'Plus' sign icon and select Copy Operation from the menu. The Create Copy Operation window appears.
Specifying a Copy Operation Action
In the From navigation tree, select type Variable, then navigate to Variable > Process > Variables > Receive_DEQUEUE_InputVariable > WF_EVENT_T and select ns4:WF_EVENT_T. The XPath field should contain your selected entry.
Defining the Copy Operation
In the To navigation tree, select type Variable, then navigate to Variable > Process > Variables > Invoke_Write_InputVariable > WF_EVENT_T and select ns3:WF_EVENT_T. The XPath field should contain your selected entry.
Click Apply and then OK in the Edit Assign dialog box to complete the configuration of the Assign activity.
Completed Outbound Business Event BPEL Process Project
Click the composite.xml to display the Oracle JDeveloper composite diagram:
Note: Click the Source tab of composite.xml to enter a value for the physical directory outputDir for the reference WriteEventData (such as /usr/tmp).
<property name="outputDir" type="xs:string" many="false" override="may">/usr/tmp</property>
Specifying the Physical Directory for the Property
Oracle JDeveloper Composite Diagram
After designing the BPEL process, you can compile, deploy and test it.
Deploy the BPEL process.
Test the BPEL process.
You must deploy the BPEL process before you can run it. The BPEL process is first compiled, and then deployed to the application server (Oracle WebLogic Server) that you have established the connection.
Before deploying the BPEL process using Oracle JDeveloper, you must ensure the following:
You must have established the connectivity between the deign-time environment and an application server.
For more information, see Configuring the Data Source in Oracle WebLogic Server and Creating an Application Server Connection.
Oracle WebLogic Server has been started.
Before deploying the BPEL process, you need to start the Oracle WebLogic Server that you have established the connection.
If a local instance of the WebLogic Server is used, start the WebLogic Server by selecting Run > Start Server Instance from Oracle JDeveloper.
Once the WebLogic Admin Server "DefaultServer" instance is successfully started, you should find that <Server started in Running mode> and DefaultServer started message in the Running:DefaultServer and Messages logs.
To deploy the BPEL process
Select your BPEL project in the Applications Navigator.
In the Applications Navigator of JDeveloper BPEL Designer, select your BPEL project (such as GetPOAckBusinessEvent) project.
Right-click the project name, and then select Deploy > [project name] > [serverConnection] from the menu that appears.
Deploying the BPEL Process
The BPEL project is compiled and successfully deployed.
Compilation and Deployment Message Logs
Once the BPEL process is deployed, you can manage and monitor the process from the Oracle Enterprise Manager Fusion Middleware Control Console. You can also test the process and the integration interface by manually initiating the process.
To test the BPEL process
Navigate to Oracle Enterprise Manager Fusion Middleware Control Console (http://<servername>:<portnumber>/em). The composite you deployed is displayed in the Applications Navigation tree.
Enter username (such as weblogic) and password and click Login to log in to a farm.
You may need to select an appropriate target instance farm if there are multiple target Oracle Enterprise Manager Fusion Middleware Control Console farms.
From the Farm base domain, expand the SOA > soa-infra to navigate through the SOA Infrastructure home page and menu to access your deployed SOA composite applications running in the SOA Infrastructure for that managed server.
Note: The Farm menu always displays at the top of the navigator. When you expand the SOA folder in the navigator and click the links displayed beneath it, the SOA Infrastructure menu becomes available at the top of the page.
Log on to Oracle Applications with the XML Gateway responsibility.
This is to ensure that the XML Gateway trading partner is set up correctly so that a purchase order can have a valid supplier that has been defined.
Select Define Trading Partner from the navigation menu to access the Trading Partner Setup window.
Enter the header values on the Trading Partner Setup form as follows:
Trading Partner Type: Supplier
Trading Partner Name: For example, Advanced Network Devices
Trading Partner Site: Enter a trading partner site information. For example, 2000 Century Way, Santa Clara, CA 95613-4565
Company Admin Email: Enter a valid email address.
Enter the following trading partner details:
Transaction Type: PO
Transaction SubType: PRO
Standard Code: OAG
External Transaction Type: PO
External Transaction SubType: Process
Connection / Hub: DIRECT
Protocol Type: HTTP
Password: 'welcome'. Password has to be entered twice before moving to next field.
Protocol Address: 'http://appsadapter.sample.com'
Source Trading partner location code: STPLC
Trading Partner Setup Form
Save the trading partner details.
Switch responsibility by selecting the Purchasing, Vision Operations (USA) and select Purchase Order from the navigation menu.
The Oracle Applications Forms open up with the Purchase Order forms.
Create a purchase order with the header values reflecting the trading partner you previously defined in the Purchase Order window:
Supplier: Enter a supplier information, such as 'Advanced Network Devices'.
Site: Select a site information, such as 'SANTA CLARA-ERS'.
On the Lines tab, enter a data row with the following values:
Description: Hard Drive - 8GB
Promised: Enter any future date in the format of dd-mmm-yyyy (such as 23-JUN-2009)
Save your purchase order. The status of the purchase order is 'Incomplete'.
Setting Up a Purchase Order
Click Approve. The Approve Document form appears.
Approving the Purchase Order
Click OK to confirm the approval.
Note: Because the trading partner is set up and valid, the transmission method is automatically set to XML.
The status of the purchase order is now changed to 'Approved'. For future reference, record the value of the PO, Rev field (for example, the PO number 4449 in this case).
Once the purchase order is approved, the business event oracle.apps.po.event.xmlpo is raised.
Use the following steps to ensure that the WF_Deferred Agent Listener is running on the target database.
Log in to Oracle Applications with the System Administrator responsibility.
On the Oracle Applications home page, select the Workflow Administrator Web Applications responsibility. Select Oracle Applications Manager > Workflow Manager from the menu.
Managing Oracle Applications
On the Applications Manager page, click the Agent Listeners icon. The Service Components page appears, containing a list of the installed agent listeners.
Reviewing Agent Listener status
Confirm that the Workflow Deferred Agent Listener is in Running status.
At this time, your deployed your BPEL project is listening for oracle.apps.po.event.xmlpo business event. Please allow 2-3 minutes for the BPEL process to activate after the event is raised.
Go to the directory, for example outputDir (typically under c:\temp) you specified for the write operation. Open the output file (such as EventAck%yyMMddHHmmss.xml), and confirm that the order number is same as that of the approved purchase order.
Confirming the Output Order Number
If you experience problems with your Business Event System integration, you can take the following troubleshooting steps:
Confirm that WF_Listener is up and running.
Ensure that business events are raised only after the BPEL process is deployed.
If the BPEL process is created on one instance of Oracle Applications and deployed on another instance, ensure the following:
WF_BPEL_Q, WF_BPEL_QTab, and WF_BPEL_QAgent should be present on the target database.
A custom subscription for the raised business event should be present on the target database.
If you still experience problems with your integration, you can enable debugging.
You can enable debugging for business events using the BPEL Process Manager.
To enable debugging:
Log into your BPEL Process Manager domain.
Debugging information is output to the log file for your domain. To examine the log file in the BPEL Process Manager, navigate to Home > BPEL Domains > yourdomain > Logs. The log file is yourdomain.log.
Copyright © 2005, 2010, Oracle and/or its affiliates. All rights reserved.