Top Banner
69
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Business Events on R12 and 11i
Page 2: Business Events on R12 and 11i

Agenda:

•Overview of Business Events

•Components of Business Events

•Oracle 12i

Business Event CreationBusiness Event Subscription Creation

Examples:

Testing Business Event From FrontendCode snippets for reference

•Oracle 11i

Business Event CreationBusiness Event Subscription Creation

Examples:

Testing Business Event From FrontendCode snippets for reference

Page 3: Business Events on R12 and 11i
Page 4: Business Events on R12 and 11i

Overview of Business Events

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 informationSending event information to a workflow processSending event information to other queues or systems

Page 5: Business Events on R12 and 11i

Overview of Business Events (Continued)

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.

Page 6: Business Events on R12 and 11i
Page 7: Business Events on R12 and 11i

Business Event System Includes:

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.

Page 8: Business Events on R12 and 11i

Business Event System Includes (Continued):

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.

Page 9: Business Events on R12 and 11i
Page 10: Business Events on R12 and 11i

Creating Custom Business Event :Oracle Applications Login Page

2. Password

1. User Name

3. Click on Login

Page 11: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications Selecting Responsibility

1. Select (Click on) Responsibility “Workflow Administrator Web (New)”

Page 12: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications Selecting Menu

1. Select (Click on) Menu “Business Events”

Page 13: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Create Event”

1. Click on “CreateEvent”

Page 14: Business Events on R12 and 11i

1. Business Event Name

2. Business Event Display Name

3. Business Event Description

4. Business Event Status

5. Business Event Application Owner Name

6. Business Event Application Owner Short Name

Creating Custom Business Event (Continued):Oracle Applications “Providing Event Details”

7. Click onApply

Page 15: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Searching Created Business Event”

1. Click onGo

Page 16: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”

1. Click onSubscription

Page 17: Business Events on R12 and 11i
Page 18: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”

1. Click onCreate

Subscription

Page 19: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

1. Click on Maginfying GlassIcon to Search for System

Name.

Page 20: Business Events on R12 and 11i

1. Click on Go

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

Page 21: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

1. Click on Quick Select

Page 22: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

2. Click on Maginfying GlassIcon to Search for Action

Type.

1. Set Phase less than 100,For synchronous Business

Event and above for Deferred.

Page 23: Business Events on R12 and 11i

2. Click on Go

1. Write 'Send to Agent'

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

Page 24: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

1. Click on Quick Select

Page 25: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(First Page)

1. Select as required

2. Click on Next

Page 26: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(Second Page)

1. Click on Maginfying GlassIcon to Search for Out Agent.

Page 27: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(Second Page)

2. Click on Go

1. Write 'WF_BPEL_QAGENT'

Page 28: Business Events on R12 and 11i

1. Click on Quick Select

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(Second Page)

Page 29: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(Second Page)

1. Select as required

Page 30: Business Events on R12 and 11i

Creating Custom Business Event (Continued):Oracle Applications “Creating Subscription for Business Event”(Second Page)

2. Click on Apply

1. Give Application Short Name as required

Page 31: Business Events on R12 and 11i
Page 32: Business Events on R12 and 11i

1. Give Business Event Name

2. Click on Go

Testing Custom Business Event:

Page 33: Business Events on R12 and 11i

1. Click on Test Icon

Note1(Please refer to next page)

1. Click on Test Icon

Note2(Please refer to next page)

Testing Custom Business Event (Continued):

Page 34: Business Events on R12 and 11i

Testing Custom Business Event (Continued):Explaining Note1 and Note2

Note1: If a business event has subscription then it can not be deleted before itssubscription is deleted.If a business event has subscription then subscription icon will look like .

Note2: If a business event doesn't have subscription then it can be deleted.If a business event doesn't have subscription then subscription icon will look like .

Page 35: Business Events on R12 and 11i

1. Event name defaults

2. Put a unique event key

1. Event name defaults

3. Put parameter name in LabelAnd Value in Value (optional)

4. To generate Event DataPut Write XML or

Upload XML. If Write XMLIs chosen then write XML tag

In XML Content.

Testing Custom Business Event (Continued):

Page 36: Business Events on R12 and 11i

1. Upload XML is chosen

2. Browse to select “.xml”file

3. Click on Upload XML File to Upload selected file.

Testing Custom Business Event (Continued):

4. Click on Raise in PLSQL,to test the Business Event

with Parameters/Event Data

Page 37: Business Events on R12 and 11i

Testing Custom Business Event (Continued):Data Checking whether Business Event is Raised

If a business event has action type Send to Agent and Out to Agent is WF_BPEL_QAGENT.Then a BPEL Listener should be there otherwise business event will not be successfully raised.

To check whether a Business Event has been raised a new entry will be created in WF_BPEL_QTAB table.

To check for the same run the following query before and after raising business event throughTest option.

Select count(1) from apps.wf_bpel_qtab;

Role:AQ_ADMIN role: This role is required to dequeue the WF_EVENT_MSG from Oracle AQ

Grants:

• Enqueue and dequeue messages• Enqueue any queue• Dequeue any queue• Unlimited tablespace

Page 38: Business Events on R12 and 11i
Page 39: Business Events on R12 and 11i

Business Event Code Snippets:

declare---------------------------------- Local Variable Declaration-------------------------------l_eventdata clob;l_parameter_list apps.wf_parameter_list_t;l_param apps.wf_parameter_t;l_message varchar2(10);l_parameter_index NUMBER := 0;l_event_key VARCHAR2(30);l_param_val VARCHAR2(30) := NULL;------------------------------------------ Start of procedure----------------------------------------beginl_parameter_list:= apps.wf_parameter_list_t();--Instantiate Table Typel_param := apps.wf_parameter_t(NULL,NULL);--Intialize Table Type-----------------------------------------------Set Parameter value to the Event Parameter---------------------------------------------l_param_val := 'TEST';--Give custom logic-----------------------------------------------Add the value to the Event Parameter, do for all parameters---------------------------------------------l_param := apps.wf_parameter_t(NULL,NULL);--Intialize Table Typel_parameter_list.EXTEND;--Extend Table Type to incorporate new entryl_param.setname('PARAMETER_NAME');--Parameter Namel_param.setvalue(l_param_val);--Parameter Valuel_parameter_index := l_parameter_index + 1;--Increment Table Indexl_parameter_list(l_parameter_index) := l_param;--Assign Parameter List

CONTINUED...

Page 40: Business Events on R12 and 11i

Business Event Code Snippets (Continued):

---------------------- Get Event Data--------------------l_eventkey := get_event_key();--Write Custom Logic to get Event key---------------------- Raise the Event with Parameters--------------------wf_event.raise( p_event_name => 'xxfusn.pim.to.fusion.customerTest',--Event name p_event_key => l_event_key,p_parameters => l_parameter_list);

---------------------- Else Get Event Data--------------------l_eventdata := get_event_data();--Write Custom Logic to get Event data---------------------- Else Raise the Event with Event Data--------------------wf_event.raise( p_event_name => 'xxfusn.pim.to.fusion.customerTest',--Event namep_event_key => l_event_key,p_event_data => l_eventdata,p_parameters => l_parameter_list);

commit;

end;

Page 41: Business Events on R12 and 11i
Page 42: Business Events on R12 and 11i

Creating Custom Business Event in 11i

Navigation: Workflow Administrator Business Events Create Event

Details of the business event are given below.

Page 43: Business Events on R12 and 11i
Page 44: Business Events on R12 and 11i

Add a custom subscription to a business Event

Business Event Name xxdba.giea.to.fusion

Navigation

Workflow Administrator Business Events Enter event name in Search field Click on “Go”

Page 45: Business Events on R12 and 11i

Detailed Steps of creating event subscription

1) Add a custom subscription

Note: An event subscription is a registration indicating that a particular event is significant to a particular system. An event subscription specifies the processing to perform when the triggering event occurs.

System Source System (Example - MDEV1.CIDC.CUMMINS.COM for MDEV1) where the Business Event Subscription will be executed

Source Type Local

Event Filter xxdba.giea.to.fusion

Source Agent [email protected]

Phase 3 (Subscription with a phase 1- 99 are run synchronously , 100 and above are deferred)

Status Enabled

Rule Data Message

Action Type Send To Agent

On error Skip to next

Page 46: Business Events on R12 and 11i

Add a custom subscription (Continued) - Screenshot

2) Click on Next to Add the Rule Function

Page 47: Business Events on R12 and 11i

Detailed Steps of creating event subscription

2) Click on Next to add the Rule Function

Note: The Rule Function controls the behavior of the subscription. Provide a Java Class name (<Package>.<Class>) for Java Rule Function and a PL/SQL stored procedure (<Package>.<Function>) for PL/SQL Rule Function. .

Out Agent [email protected]

To Agent

Priority High

Additional Options

Owner Name XXDBA

Owner Tag XXDBA

Customization Level User

Description

Page 48: Business Events on R12 and 11i

Add the Rule Function (Continued) - Screenshot

2) Click on Next to Add the Rule Function

Page 49: Business Events on R12 and 11i

Detailed Steps of creating event subscription

3) Click on Apply to complete the Subscription creation process

Page 50: Business Events on R12 and 11i
Page 51: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

1) Create an empty BPEL process

Create an empty BPEL process named ‘BusinessEventSubscriptionTest’ as follows.

Page 52: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

2) Configure Oracle Application Adapter for Business Event Subscription

Do the following steps to configure the Oracle Application Adapter

1) Drag and drop the Oracle Application Adapter Service in the BPEL designer from component palette.

Page 53: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

Configure Oracle Application Adapter for Business Event Subscription (Continued)

2) Provide Service Name (‘TestBusinessEventSub’) and Click on ‘Next’ button

Page 54: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

3) Drag Provide a database connection from the dropdown as follows.

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 55: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

4) Select Other Interfaces- > Outbound link in the Oracle Application Module Browser

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 56: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

5) Select ‘xxdba.giea.to.fusion’ Business Event from the list and click ‘OK’.

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 57: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

6) Select Click on the Next button.

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 58: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

7) Select ‘Any Schema’ radio button and the Press Next. (As input schema to this service is unknown we are specifying in as ‘Any Schema’

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 59: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

8) Select ‘Press ‘Finish’ button

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 60: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

9) Now the partner link gets created for the service. Press ‘OK’ button.

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 61: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

10) Drag and drop a ‘receive’ activity from the Component palette .

Configure Oracle Application Adapter for Business Event Subscription (Continued)

Page 62: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

Configure Oracle Application Adapter for Business Event Subscription (Continued)

11) Configure the ‘receive’ activity as below. Click on the ‘Create Instance’ check box.

Page 63: Business Events on R12 and 11i

Creating Business Event Subscription Service in BPEL

Configure Oracle Application Adapter for Business Event Subscription (Continued)

12) Now BPEL process is created. Save and deploy the process in a proper SOA server..

Page 64: Business Events on R12 and 11i
Page 65: Business Events on R12 and 11i

Trigger the Business Event from Oracle Application

1) From the Oracle Application program (PL/SQL stored procedure) following piece of code can be executed to fire the Business Event. Content of the ‘p_event_data’ attribute will be used for further processing of the information in the BPEL process.

Page 66: Business Events on R12 and 11i

Trigger the Business Event from Oracle Application (Continued)

2) As and when the above code block gets executed in will instantiate the BPEL process that we have already designed.

3) You can view the xml that’s received by the BPEL subscription service in instance->audit tab

Page 67: Business Events on R12 and 11i

Trigger the Business Event from Oracle Application (Continued)

4) Following is the sample inbound xml that BPEL process received by subscribing the Business Event.

Page 68: Business Events on R12 and 11i
Page 69: Business Events on R12 and 11i