Tuesday, November 19, 2019

How to Find Business Event and Create Subscriptions


·   In this blog we are considering the lookup code insert event for demonstration.


     1. Navigate to Responsibility: Workflow Administrator >> Administrator Workflow >> Business Events


















2. All seeded events will start with ‘oracle.apps.’  then next we need to provide the application short name on which we want to create subscription.     
     3. In our case its ‘fnd’ as lookup will be register with application ‘Application Object Library’
·    4. We are taking event named oracle.apps.fnd.lookup.code.insert which will trigger when we insert some code in the lookup.
·    5. Search the event name ‘oracle.apps.fnd.lookup.code.insert by typing in the Name field














6.  Click on Create Subscription button.











 7. The System field will get populated with default name, if not click on search button and select appropriate name.

 8. You must specify the source type of the events to which the subscription applies. Events can have the following source types:
    • Local--The subscription applies only to events raised on the subscribing system.
    • External--The subscription applies only to events received by an inbound agent on the subscribing system.
    • Error--The subscription applies to only to errored events dequeued from the WF_ERROR queue or the WF_JAVA_ERROR queue.
     9. The phase number for a subscription controls whether the subscription is executed immediately or is deferred. The Event Manager treats subscriptions with a phase number of 100 or higher as deferred subscriptions. Subscriptions with a phase number from 1 to 99 are executed immediately.

10.  Defining the Action for a Subscription
         Subscription processing can include the following types of processing

Action Type
Description
Custom
Execute custom business logic
Invoke REST Service
Invoke REST Service from BES Subscription
Invoke SOAP Service 
Invoke SOAP Service from BES Subscription
Launch Workflow
Launch the workflow specified in the subscription
Receive Trading Partner Message
Receive a message from your trading partner
Send to Agent
Send the event to the agent specified in the subscription
Send Notification
Send a notification using standard or your own message templates
Send Trading Partner Message
Generate a message and send the message to your trading partner



    11. In our case we are calling custom package function, so we select Action type as Custom.



























12. We can call below types of Functions
o   Java function.
o   PLSQL function.
o   Workflow.

       13.  In our example we are calling the PLSQL function named ‘xx_event_subscription_pkg event_subscription_func’.

14. 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.
    • In--Inbound communication to the system. The agent receives messages in a specific protocol and presents them to the system in a standard format.
    • Out--Outbound communication from the system. The agent accepts messages from the system in a standard format and sends them using the specified protocol.
     15. Enter Owner Name and Owner Tag with event application owner usually it will be application short name.
    16. In our case its fnd.
    17. Then click on Apply button, that will save the subscription.

















   18. In the mentioned package function, we are inserting the event name, sequence number and sysdate in to the table ‘xx_test_event_subscription_tbl’.

   19. So, whenever we insert and record in to the lookup we should see record in this custom table.





















20. Insert the record in lookup then query the custom table, you can see record inserted in that table.



Oracle Business Events

Business Event

Business Event is an occurrence of a business activity which has some significance.

Business event service leverages the Oracle Advanced Queuing (AQ) infrastructure to communicate between application systems.

Example: The activity of creating a purchase order (PO) is a business event; likewise approving PO, receiving goods against a PO, matching a PO receipt with invoice is a business Event.

When we ship confirm the delivery, when sales order line status changes, line closed.
Employee creation, assignment update, GL period close, FA asset creation, FA asset retire etc are examples of business event.


Subscription

Subscription is an activity to be performed on occurrence of a Business Event.

Example: - If you would like to send an email notification to some set of users when a PO receipt is created then you can subscribe to PO Receipt related Business Event and trigger a workflow notification from the subscription to send email.


Uses of Business Event System 

1. 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.

2. 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

3. 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.

4. Business event-based workflow processes.
You can develop sophisticated workflow processes that include advanced routing or processing based on the content of business events.

5. Customization of packaged applications in a non-invasive manner.
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.

Architecture