Skip Headers
Oracle® Fusion Applications Developer's Guide
11g Release 1 (11.1.3)

Part Number E15524-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

46 Cross Family Business Event Subscription Pattern

This chapter describes what to do when you require your SOA composite to subscribe to a business event published on another Oracle SOA Suite cluster.

When to implement: When you require your SOA composite to subscribe to a business event published on another Oracle SOA Suite cluster.

Design Pattern Summary: The Event Delivery Network (EDN) infrastructure supports business event publishing and subscription within a single Oracle SOA Suite cluster. To propagate a business event from one Oracle SOA Suite cluster to another, you must build a mediator-to-mediator bridge. The bridge queues the event message in a global aqueue from the Oracle SOA Suite cluster. The Oracle SOA Suite cluster publishes the event and then dequeues the event message from the Oracle SOA Suite cluster that subscribes to the event.

Involved components:

46.1 Introduction to the Recommended Design Pattern

You can use business event publishing and subscription for asynchronous, loosely-coupled integration between two components such as an Oracle ADF UI application and a SOA composite. In most cases, the two components to be integrated are within the same family, and the same Oracle SOA Suite cluster is used to both raise and subscribe to the event. However, in some cases component integration goes across domains. This pattern is used to implement business event propagation from one Oracle SOA Suite cluster to another.

46.2 Potential Approaches

There are two other possible approaches to this use case.

46.3 Example

CRM Subscribes to Event Published by HCM

HcmUsersSpmlComposite deployed in the HCM SOA cluster publishes a post-processing event to report the success or failure of the process of creating a new user or assigning roles to a user. In order for CRM to perform additional actions based on the user request, the post-processing event must be propagated from HCM to CRM.

Table 46-1 lists the HCM composite components and values.

Table 46-1 HCM Composite Components and Values

Composite Components Values

Publishing Product

Per

Subscribing Product

Hz

Owning Product

Hz

XFamilyPub composite name

FoundationPartiesPerToHzXFamilyPubComposite

XFamilySub composite name

FoundationPartiesHzXFamilySubComposite

Recipient/Consumer

FoundationPartiesPerToHz

SOA workspace

CrmCommonSoa.jws


Financials Subscribes to CRM Event

When the ImportPartyData event is raised in the customer or supplier import program in TCA, the Financials PartyImportForTCALocService service must be invoked. The service creates a tax profile for a party which must be involved in financial transactions.

HCM Subscribes to Event Published by CRM

The resource directory feature in CRM raises the ActiveLdapRequestEvent event to make an LDAP request for provisioning the abstract role and security roles for newly provisioned user accounts to existing resources. Without processing these requests, resources will not be able to login to the resource directory used to maintain resource information such as phone numbers, email addresses, mail addresses, and so on. The HcmUsersSpmlComposite deployed to the HCM Oracle SOA Suite cluster subscribes to the event and processes the request.

Table 46-2 lists the CRM composite components and values.

Table 46-2 CRM Composite Components and Values

Composite Components Values

Publishing Product

Hz

Subscribing Product

Per

Owning Product

Hz

XFamilyPub composite name

FoundationPartiesHzToPerXFamilyPubComposite

XFamilySub composite name

FoundationPartiesPerXFamilySubComposite

Recipient/Consumer

FoundationPartiesHzToPer

SOA workspace

CrmCommonSoa.jws


The sample code for this use case can be downloaded from Oracle SOA Suite samples.

46.4 How to Subscribe to a Cross-Family Business Event

To support cross-family event subscriptions, a global aqueue resides in the Oracle Fusion Applications schema to enqueue messages from one Oracle SOA Suite cluster and dequeue to another Oracle SOA Suite cluster. The messages contain information about the event as well as the publisher's identity and application context information.

In addition to the aqueue, this pattern includes an XFamilyPub composite deployed to the Oracle SOA Suite cluster which publishes the cross-family event, and an XFamilySub composite deployed to the Oracle SOA Suite cluster which subscribes to the cross-family event. The XFamilyPub composite contains a mediator and an Aqueue adapter configured for the enqueue operation. The mediator subscribes to the event, transforms the event information and payload and enqueues a message to the Aqueue with the recipient set to the family subscribing to the event. The XFamilySub composite contains an Aqueue adapter configured for the dequeue operation with itself specified as the recipient. The mediator dequeues the message, filters the message based on the Namespace and LocalName elements in the message, transforms the payload and raises the event locally.

46.4.1 Before You Begin

Your installation of Oracle JDeveloper must include the following database objects, Oracle WebLogic Server configurations and so on:

  • Make sure that the database object ACR_XFAMILY_EVENT_Q is defined in the FUSION schema. Verify that the database object exists by navigating to the Database Navigator in Oracle JDeveloper, defining a connection to the FUSION schema and double-clicking Queues.

  • In Oracle WebLogic Server, define the data source JDBC/ApplicationDBXA. Verify this configuration by running the Oracle WebLogic Server Console and navigating to Data Sources.

  • In Oracle WebLogic Server, define a JDBC/XFamilyEventAqueue AqAdapter connection pool. Verify this configuration by running the Oracle WebLogic Server console and navigating to Domain Configurations > Your Deployment Resources > Deployments > AqAdapter > Configuration > Outbound Connection Pools. The connection pool JDBC/XFamilyEventAqueue should display.

46.4.2 Determining the Composites to Be Defined

Following are the components to be defined for the pattern:

  • Publishing product: The publisher product is the product that publishes the event.

  • Subscribing product: The subscriber product is the product that subscribes to the event.

  • Owning product: The owning product is the product that owns the XFamilyPub and XFamilySub composites.

The product team requiring the cross-family subscription owns both the XFamilySub and XFamilyPub composites. This pattern assumes the composites are defined at the product level. It is also possible to define the XFamilySub and XFamilyPub at the family level instead.

Determine whether an XFamilySub or XFamilyPub composite has been defined for your product. If they have not been defined, then follow these guidelines for naming the XFamilySub and XFamilyPub composites. The naming guidelines help make cross-family event composites easily identifiable and self-descriptive.

These composites can reside in any LBA in your product.

Composite Naming Conventions

The composite names must adhere to the following guidelines:

  1. Start with the LBA short name. You can define the composite in any LBA.

  2. For the subscribing and publishing composites, respectively, do the following:

    • Add <Subscribing product> if not included in LBA short name. Use the product short name as defined in Oracle Fusion Setup. Use B2B if the subscriber is a composite deployed to the Setup SOA cluster for B2B.

    • Add <Publisher product>To<Subscriber product> so that the name is self-descriptive. Use the product short name as defined in Oracle Fusion Setup.

  3. Identify the purpose of the composite.

    • For a subscribing composite, add XFamilySub to the name.

    • For a publishing composite, add XFamilyPub to the name.

  4. End with Composite.

XFamilySub

A product can have more than one XFamilyPub composite.

Using the naming conventions specified in Composite Naming Conventions, the sample composite name is as follows:

  • FinInfrZxXFamilySubComposite. In this example, the LBA short name is FinInfr and the Zx product subscribes to the cross-family event.

XFamilyPub

A product can have more than one XFamilyPub composite. There should only be one XFamilyPub composite for each publisher product and subscriber product combination.

Using the naming conventions specified in Composite Naming Conventions, sample composite names are as follows:

  • FinInfrHzToZxXFamilyPubComposite. In this example, the LBA short name is FinInfr and the Zx product subscribes to an event published by the Hz product.

  • FinInfrPerToZxXFamilyPubComposite. In this example, the LBA short name is FinInfr and the Zx product subscribes to the event published by the Per product.

46.4.3 Determining the Aqueue Message Recipient

A recipient or consumer is specified in the Aqueue Adapter defined in the XFamilyPub and XFamilySub composites. The recipient in the XFamilyPub is used to indicate which Aqueue Adapter should receive the enqueued message. The consumer in the XFamilySub is used to identify the Aqueue Adapter. For example, if the XFamilyPub specifies ZX as the recipient for the enqueued message, then the XFamilySub with the consumer set to ZX dequeues the message from the aqueue.

The recipient is the name of the XFamilyPub composite without the suffix XFamilyPubComposite, in the format <LBA short name><Publisher product>To<Subscriber product>.

For example:

  • FinInfrHzToZx for FinInfrHzToZxXFamilyPubComposite

  • FinInfrPerToZx for FinInfrPerToZxXFamilyPubComposite

  • PrcInfrPoToB2B for PrcInfrPoToB2BXFamilyPubComposite

46.4.4 Defining an XFamilyPub Composite

This step defines the composite which subscribes to an event on a remote family's Oracle SOA Suite cluster and enqueues a corresponding message in the ACR_XFAMILY_EVENT_Q aqueue.

  1. In the owning team's SOA workspace, create an empty composite with the name determined in Section 46.4.2.

  2. Drag and drop an Aqueue Adapter to the right swim lane of your composite and define the adapter as follows.

    1. In the Service Name field, enter a service name for the Aqueue Adapter.

    2. Define a connection for your Oracle Fusion Middleware schema and enter JNDI name eis/AQ/XFamilyEventAqueueInterface.In the Interface field, define the operation and schema.

    3. For the operation type, select the Enqueue radio button. In the Operation Name field, enter Enqueue.

    4. For the queue name, enter FUSION as the database schema and ACR_XFAMILY_EVENT_Q for the queue name.

    5. On the Queue Parameters page, enter the recipient as defined in Section 46.4.3.

    6. On the Message page, enter oramds:/apps/oracle/apps/common/acr/events/FusionXFamilyEvent.xsd for the URL and FusionXFamilyEvent for the schema element. To access FusionXFamilyEvent.xsd from MDS, take the following steps.

      Click the search icon next to the URL field.

      In the Type Chooser dialog box, select Import Schema File.

      Click the search icon next to the URL field.

      At the top of the SOA Resource Browser window, select the Resource Palette.

      Under IDE Connections, navigate to SOA-MDS > SOA-MDS connection Name > oracle > common > acr > events > FusionXFamilyEvent.xsd and click OK.

      In the Import Schema File window, uncheck Copy to Project and click OK.

      In the Type Chooser window, select FusionXFamilyEvent and click OK.

  3. Drag and drop a mediator to your composite and name it EnqueueMediator. Select Define Interface Later as the template and click OK. Double-click the EnqueueMediator component.

  4. For each event to which your family subscribes, define a routing rule in the mediator. Click add button next to Event Subscriptions and select the business event to which you want to subscribe on the remote Oracle SOA Suite cluster. Reference the EDL file from MDS, and do not copy the file in your composite.

    1. Add a static routing rule and click the Service button. Select References > EnqueueEventMessage > Enqueue.

    2. Create a transformation XSL file by clicking the transformation icon in the routing rule and selecting Create New Mapper File.

    3. In the column on the right, right-click msg_out:Namespace. Select Set Text > Enter Text, and specify the event namespace.

    4. In the column on the right, right-click msg_out:LocalName. Select Set Text > Enter Text, and specify the event local name.

    5. In the Component Palette, from XSL Constructs, drag and drop copy-of to themsg_out:Payload element on the far right column of the XSL design tab.

      In the Copy-of Type dialog, select Replace the children of the selected node with the results of the copy-of. If an error message displays to the right of the copy-of element, you can ignore it.

    6. In the far left column, select the element just below <sources>. Drag-and-drop the element to the copy-of in the far right column in the XSL design tab. Once you complete this step, the error icon that displayed in the previous step disappears.

    Example 46-1 shows a sample XSL file.

    Example 46-1 Sample XSL File

    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
      <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
      <mapSources>
        <source type="XSD">
          <schema location="../xsd/bulkImportEvents.xsd"/>
          <rootElement name="batchInfo"namespace="http://xmlns.oracle.com/apps/crm/hz/bulkImport/
            FoundationBulkImportEventsComposite"/>
        </source>
      </mapSources>
      <mapTargets>
        <target type="WSDL">
          <schema location="../EnqueueEventMessage.wsdl"/>
          <rootElement name="FusionXFamilyEvent"
            namespace="http://xmlns.oracle.com/apps/common/acr/events"/>
        </target>
      </mapTargets>
      <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.2.0(build 100216.1000.2230) AT [MON APR 26 14:00:00
        PDT 2010]. -->
    ?>
    <xsl:stylesheet version="1.0"
                    xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.
                    services.functions.Xpath20"
                    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.
                    service.common.functions.MediatorExtnFunction"
                    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.
                                  services.functions.ExtFunc"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:med="http://schemas.oracle.com/mediator/xpath"
                    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
                    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.
                                tip.xref.xpath.XRefXPathFunctions"
                    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                    xmlns:ns0="http://xmlns.oracle.com/apps/crm/hz/bulkImport/
                               FoundationBulkImportEventsComposite"
                    xmlns:ora="http://schemas.oracle.com/xpath/extension"
                    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.
                                  tip.adapter.socket.ProtocolTranslator"
                    xmlns:msg_out="http://xmlns.oracle.com/apps/common/acr/events"
                    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/aq/XFamilyEventPattern/
                    FinInfrHzToZxXFamilyPubComposite/EnqueueEventMessage"
                    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                    exclude-result-prefixes="xsi xsl xsd ns0 plt wsdl msg_out tns xpath20 bpws mhdr
                    oraext dvm hwf med ids xdk xref ora socket ldap">
      <xsl:template match="/">
        <msg_out:FusionXFamilyEvent>
          <msg_out:Namespace>
            <xsl:text disable-output-escaping="no">http://xmlns.oracle.com/apps/crm/hz/bulkImport/
              FoundationBulkImportEventsComposite</xsl:text>
          </msg_out:Namespace>
          <msg_out:LocalName>
            <xsl:text disable-output-escaping="no">ImportPartyData</xsl:text>
          </msg_out:LocalName>
          <msg_out:Payload>
            <xsl:copy-of select="/ns0:batchInfo"/>
          </msg_out:Payload>
        </msg_out:FusionXFamilyEvent>
      </xsl:template>
    </xsl:stylesheet>
    
  5. In the routing rule, define an assign statement to copy the context from the apps.context.header property into the ApplicationContext element in the aqueue message. The Assign Value window is shown in Figure 46-1.

    Use the Expression builder to generate an expression for the To region. Select Variables > out > FusionXFamilyEvent > msg_out:FusionXFamilyEvent > msg_out:ApplicationContext, click Insert into Expression and then click OK.

    Figure 46-1 Define an Assign Statement

    Define an assign statement.

    The mediator source code is shown in Example 46-2.

    Example 46-2 Mediator Source Code

    <assign>
       <copy target="$out.FusionXFamilyEvent/msg_out:FusionXFamilyEvent/msg_out:ApplicationContext"
             value="$in.property.apps.context.header"
             xmlns:msg_out="http://xmlns.oracle.com/apps/common/acr/events"/>
    </assign>
    
  6. Open the composite.xml file and search for the following line.

    <binding.jca config="EnqueueEventMessage_aq.jca"/>
    
  7. Replace the binding.jca element with the code shown in Example 46-3.

    Example 46-3 Replace the JCA Binding

    <binding.jca config="EnqueueEventMessage_aq.jca">
       <property name="jca.subject.xpath">/msg_out:FusionXFamilyEvent/msg_out:Subject</property>
       <property name="jca.subject.nslist">xmlns:msg_out=
                      "http://xmlns.oracle.com/apps/common/acr/events"</property>
    </binding.jca>
    
  8. Add standard fault policies to the composite just above the <component> elements in the composite.xml file, as shown in Example 46-4.

    Example 46-4 Add Fault Policies to the composite.xml File

    <property name="oracle.composite.faultPolicyFile">
       oramds:/apps/oracle/apps/fnd/applcore/soa/fault/fault-policies.xml</property>
    <property name="oracle.composite.faultBindingFile">
       oramds:/apps/oracle/apps/fnd/applcore/soa/fault/fault-bindings.xml</property>
    

46.4.5 Defining an XFamilySub Composite

This step defines the composite which will dequeue messages from ACR_XFAMILY_EVENT_Q and raise the event locally in your family's SOA cluster.

To define an XFamilySub composite:

  1. In the owning team's SOA workspace, create an empty composite with the XFamilySub composite name determined in Section 46.4.2, "Determining the Composites to Be Defined."

  2. Drag and drop an Aqueue Adapter onto the left swim lane of your composite and provide the following values in the definition. When specifying the Messages URL, you will be referencing oramds. Ensure you have a SOA-MDS defined which points to fusionapps/soa_shared/soa-infra before proceeding.

    1. In the Service Name window, enter the name DequeueEventMessage in the Service Name text field.

    2. In the Service Connection window, define a connection for the Oracle Fusion Middleware schema. For the JNDI name, enter eis/AQ/XFamilyEventAqueue. For the XA Data Source, accept the default value.

    3. In the Adapter Interface window, accept the default selection Define from operation and schema (this is specified later).

    4. In the Operation window, select Dequeue for the operation type. In the Operation Name text field, accept the default value of Dequeue.

    5. In the Queue Name window, select the database schema and enter a queue name.

      From the Database Schema dropdown list, select Fusion.

      In the Queue Name field, enter ACR_XFAMILY_EVENT_Q.

    6. In the Queue Parameters window, specify the aqueue message recipient as defined in Section 46.4.3, "Determining the Aqueue Message Recipient."

    7. In the Messages window, select the message schema URL and the relevant schema element.

      In the URL field, browse for the message schema URL.

      From the Schema Element dropdown list, select FusionXFamilyEvent.

  3. Drag and drop a mediator component onto your composite using the Define Interface Later template, and name it DequeueMediator.

    Draw a wire between the aqueue adapter and mediator, as shown in Figure 46-2.

    Figure 46-2 Connect the Mediator to the Aqueue Adaptor

    Connect the mediator to the aqueue adaptor.
  4. For each cross family event to which your family subscribes, define a static routing rule in the mediator.

    1. Add a routing rule to raise the event by clicking on the add icon and the Event button. Use oramds to reference the EDL file rather than copying the EDL file into your composite.

    2. Add a filter expression to the rule to select the aqueue messages with the namespace and local name that match the event.

      For example, if the namespace of the event is http://xmlns.oracle.com/apps/crm/hz/bulkImport/FoundationBulkImportEventsComposite and the local name is ImportPartyData, then the following filter is defined, as shown in Example 46-5.

      Example 46-5 A Filter Expression for the Mediator Rule

      (($in.FusionXFamilyEvent/msg_out:FusionXFamilyEvent/msg_out:Namespace = "http://xmlns.oracle.com/apps/crm/hz/bulkImport/FoundationBulkImportEventsComposite")
      and ($in.FusionXFamilyEvent/msg_out:FusionXFamilyEvent/msg_out:LocalName = "ImportPartyData"))
      
    3. Create a transformation XSL file. Click the transformation icon, select Create New Mapper File, and click OK.

    4. In the Component Palette, expand the XSLT Constructs tab. Drag and drop the copy-of construct onto the XSLT file column on the element directly under the <target> element.

    5. In the Copy-of Type dialog, select Replace the selected node with the results of the copy-of.

    6. From the source column, drag and drop the msg_out:Payload onto the copy-of element in the XSLT file column.

    7. In the source tab, add a /child:node() element after <xsl:copy-of select="/msg_out:FusionXFamilyEvent/msg_out:Payload>.

      The XSL file should look similar to that shown in Example 46-6.

      Example 46-6 XSL File

      <?xml version="1.0" encoding="UTF-8" ?>
      <?oracle-xsl-mapper
        <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
        <mapSources>
          <source type="WSDL">
            <schema location="../DequeueEventMessage.wsdl"/>
            <rootElement name="FusionXFamilyEvent"
                 namespace="http://xmlns.oracle.com/apps/common/acr/events"/>
          </source>
        </mapSources>
        <mapTargets>
          <target type="XSD">
            <schema location="../xsd/bulkImportEvents.xsd"/>
            <rootElement name="batchInfo"
                 namespace="http://xmlns.oracle.com/apps/crm/hz/bulkImport/
                 FoundationBulkImportEventsComposite"/>
          </target>
        </mapTargets>
        <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.2.0(build 100216.1000.2230) AT [MON APR 26 15:28:04
             PDT 2010]. -->
      ?>
      <xsl:stylesheet version="1.0"
                      xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/oracle.
                                     tip.pc.services.functions.Xpath20"
                      xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                      xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.
                      service.common.functions.MediatorExtnFunction"
                      xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.
                                    tip.pc.services.functions.ExtFunc"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                      xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                      xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/aq/XFamilyEventPattern/
                                 FinInfrZxXFamilySubComposite/DequeueEventMessage"
                      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                      xmlns:med="http://schemas.oracle.com/mediator/xpath"
                      xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                      xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
                      xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.
                                  tip.xref.xpath.XRefXPathFunctions"
                      xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                      xmlns:ns0="http://xmlns.oracle.com/apps/crm/hz/bulkImport/
                                 FoundationBulkImportEventsComposite"
                      xmlns:ora="http://schemas.oracle.com/xpath/extension"
                      xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.
                                    ProtocolTranslator"
                      xmlns:msg_out="http://xmlns.oracle.com/apps/common/acr/events"
                      xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                      exclude-result-prefixes="xsi xsl tns plt xsd wsdl msg_out ns0 xpath20 bpws 
                                    mhdr oraext dvm hwf med ids xdk xref ora socket ldap">
        <xsl:template match="/">
          <xsl:copy-of select="/msg_out:FusionXFamilyEvent/msg_out:Payload/child::node()">
            <?oracle-xsl-mapper-position ns0:batchInfo?>
          </xsl:copy-of>
        </xsl:template>
      </xsl:stylesheet>
      
    8. In the routing rule, define an assign statement to copy the context from the ApplicationContext element in the aqueue message into the apps.context.header property, as shown in Figure 46-3.

      Figure 46-3 Defining an Assign Statement to Copy the Context

      Assign statement to copy the context.
  5. In the composite.xml file, replace the line <binding.jca config="EnqueueEventMessage_aq.jca"/> with the code shown in Example 46-7.

    Example 46-7 Replacing the binding.jca Element

    <binding.jca config="EnqueueEventMessage_aq.jca">
       <property name="jca.subject.xpath">/msg_out:FusionXFamilyEvent/msg_out:Subject</property>
       <property name="jca.subject.nslist">xmlns:msg_out=
                      "http://xmlns.oracle.com/apps/common/acr/events"</property>
    </binding.jca>
    
  6. Add standard fault policies to the composite, as shown in Example 46-8.

    Example 46-8 Adding Standard Fault Policies

    <property name="oracle.composite.faultPolicyFile">
       oramds:/apps/oracle/apps/fnd/applcore/soa/fault/fault-policies.xml</property>
    <property name="oracle.composite.faultBindingFile">
       oramds:/apps/oracle/apps/fnd/applcore/soa/fault/fault-bindings.xml</property>
    

46.5 Verifying the Deployment

You can verify the deployment of the use case by confirming that the event was successfully raised by checking the Event Delivery Network database log.

46.5.1 How to Verify the Deployment of the XFamilyPub Composite

To verify the deployment of XFamilyPub composite:

  1. Deploy the XFamilyPub composite to the SOA cluster which receives the cross family business event.

  2. Raise the cross family business event. Before integrating with Oracle ADF, you can raise a business event by invoking the following PL/SQL code in the Oracle Fusion Applications schema.

    1. Replace the parameters to initialize_session with the appropriate GUID and user.

    2. Replace hcm_edn_publish_event with the relevant event name, such as fin_edn_publish_event or crm_edn_publish_event, and so on.

    3. Replace the business event content.begin with the relevant business event.

    Example 46-9 shows sample PL/SQL code used to raise a business event.

    Example 46-9 Raise a Business Event by Invoking the PL/SQL Code

    fnd_global.initialize_session('F58679122D280FD03AD1198A55EFC6BF', 'Abraham.Mason');
    
    hcm_edn_publish_event('/oracle/apps/hcm/users/publicModel/entity/events/edl/LdapRequestEO',
         'ActiveLdapRequestEvent',
    
             '<business-event xmlns="http://oracle.com/fabric/businessEvent"
                   xmlns:ns="/oracle/apps/hcm/users/publicModel/entity/events/edl/LdapRequestEO">'||
    
                        '<name>ns:ActiveLdapRequestEvent</name>'||
    
                        '<content>'||
    
                        '<ActiveLdapRequestEventInfo xmlns="/oracle/apps/hcm/users/publicModel/
                              entity/events/schema/LdapRequestEO">'||
    
             '<LdapRequestId>'||
    
                '<newValue value="5"/>'||
    
                '<oldValue value="5"/>'||
    
             '</LdapRequestId>'||
    
          '</ActiveLdapRequestEventInfo>'||
    
                        '</content>'||
    
                        '</business-event>');
    
    commit;
    
    end;
    
    /
    
  3. Confirm the event was raised on the SOA cluster that raises the cross-family business event by navigating to http://<SOA SERVER>:<SOA PORT>/soa-infra/events/edn-db-log.

  4. Confirm the event name space, name, identity, payload and context matches the event raised via the PL/SQL API.

    1. In Fusion Applications Control, verify that an instance of the composite is running.

    2. Verify that a message is being enqueued (ensure the XFamilySub composite is not deployed) by looking at the contents of the FUSION.ACR_XFAMILY_EVENTS_QT table. The body of the message displays in the USER_DATA column. For example:

      select user_data from fusion.acr_xfamily_event_qt;

46.5.2 How to Verify the Deployment of the XFamilySub Composite

You can use Fusion Applications Control to verify that the composite is running.

To verify the deployment of XFamilySub composite:

  1. Deploy the XFamilySub composite to the SOA cluster that subscribes to the cross-family event.

    The composite should pick up the message in the aqueue.

  2. In Fusion Applications Control, verify that an instance of the composite is running.

  3. Confirm the event was raised on the SOA cluster that subscribes to the cross-family business event by navigating to http://<SOA SERVER>:<SOA PORT>/soa-infra/events/edn-db-log.

  4. Confirm the event namespace, name, identity, payload and context matches the event raised via the PL/SQL API.

46.6 Troubleshooting the Use Case

If you encounter any issue with the ACR_XFAMILY_EVENT_Q aqueue, first run the following select statements in the FUSION schema to confirm the privileges for FUSION_RUNTIME are correct and to confirm that the queue is configured for enqueuing and dequeuing. You can use the FUSION_READ_ONLY user to execute these statements.

46.6.1 Privileges to FUSION_RUNTIME

To confirm the necessary privileges are granted to FUSION_RUNTIME, run the statement shown in Example 46-10.

Example 46-10 Confirming Privileges Granted to FUSION_RUNTIME

SELECT GRANTEE, OWNER, GRANTOR, PRIVILEGE, GRANTABLE, TABLE_NAME FROM DBA_TAB_PRIVS
WHERE TABLE_NAME like 'ACR_XFAMILY_EVENT%';

The statement should return the following results. Ensure SELECT, UPDATE, ENQUEUE, and DEQUEUE privileges are returned, as shown in Example 46-11.

Example 46-11 Results Returned

GRANTEE         OWNER    GRANTOR    PRIVILEGE   GRANTABLE  TABLE_NAME
-------         ------   --------   ---------   ---------  ----------
FUSION_RUNTIME  FUSION   FUSION     SELECT      NO         ACR_XFAMILY_EVENT_QT
FUSION_RUNTIME  FUSION   FUSION     UPDATE      NO         ACR_XFAMILY_EVENT_QT
FUSION_RUNTIME  FUSION   FUSION     ENQUEUE     NO         ACR_XFAMILY_EVENT_Q
FUSION_RUNTIME  FUSION   FUSION     DEQUEUE     NO         ACR_XFAMILY_EVENT_Q

If any of these privileges are not defined in your environment, run the appropriate command listed in Example 46-12.

Example 46-12 Granting Relevant Privileges

GRANT SELECT ON FUSION.ACR_XFAMILY_EVENT_QT TO FUSION_RUNTIME;

GRANT UPDATE ON FUSION.ACR_XFAMILY_EVENT_QT TO FUSION_RUNTIME;
 
execute DBMS_AQADM.GRANT_QUEUE_PRIVILEGE('ENQUEUE', 'ACR_XFAMILY_EVENT_Q', 'FUSION_RUNTIME', FALSE);
 
execute DBMS_AQADM.GRANT_QUEUE_PRIVILEGE('DEQUEUE', 'ACR_XFAMILY_EVENT_Q', 'FUSION_RUNTIME', FALSE);

46.6.2 Aqueue enabled for Enqueuing and Dequeuing

To confirm ACR_XFAMILY_EVENT_Q is enabled for enqueuing and dequeuing, run the statement shown in Example 46-13.

Example 46-13 Confirming ACR_XFAMILY_EVENT_Q Is Enabled for Enqueuing and Dequeuing

select * from sys.dba_queues where queue_table like '%ACR_XFAMILY_EVENT%';

This statement should return the results shown in Table 46-3. Confirm that the ENQUEUE_ENABLED and DEQUEUE_ENABLED columns are set to YES for ACR_XFAMILY_EVENT_Q.

Table 46-3 Results When Confirming ACR_XFAMILY_EVENT_Q Is Enabled for Enqueuing and Dequeuing

OWNER

FUSION

FUSION

NAME

ACR_XFAMILY_EVENT_Q

AQ$_ACR_XFAMILY_EVENT_QT_E

QUEUE_TABLE

ACR_XFAMILY_EVENT_QT

ACR_XFAMILY_EVENT_QT

QID

3851358

3851357

QUEUE_TYPE

NORMAL_QUEUE

EXCEPTION_QUEUE

MAX_RETRIES

5

0

RETRY_DELAY

0

0

ENQUEUE_ENABLED

YES

NO

DEQUEUE_ENABLED

YES

NO

RETENTION

0

0

USER_COMMENT

 

exception queue

NETWORK_NAME

   

If the queue is not enabled for enqueue or dequeue, run the command shown in Example 46-14.

Example 46-14 Enabling the Queue for Enqueuing or Dequeuing

dbms_aqadm.start_queue(queue_name => 'ACR_XFAMILY_EVENT_Q');

46.6.3 AQ_INVALID_QUEUE_TYPE

If you encounter the error message, shown in Example 46-15, take the following steps.

Example 46-15 AQ_INVALID_QUEUE_TYPE Error

{{Error during invoking 1-way operation "Enqueue" on target service "EnqueueEventMessage"
Exception occured when binding was invoked. Exception occured during invocation of
JCA binding: "JCA Binding execute of Reference operation 'Enqueue' failed due to:
AQ_INVALID_QUEUE_TYPE. Unable to obtain the correct queue type. Queue does not
exist or not defined correctly. Drop and re-create queue. ". The invoked JCA
adapter raised a resource exception. Please examine the above error message
carefully to determine a resolution.  }}

This error indicates that FUSION_RUNTIME does not have the appropriate privileges to enqueue messages in the aqueue. Take the steps described in Section 46.6.1, "Privileges to FUSION_RUNTIME."