You are on page 1of 44

Create required database views

Create two views as below in APPS for DEPT and EMP tables which are in SCOTT schema.(Please make
sure that the privileges granted to APPS to access these tables)

CREATE VIEW EMP_XML_V AS SELECT * FROM SCOTT.EMP;

CREATE VIEW DEPT_XML_V AS SELECT * FROM SCOTT.DEPT;

Create data definition for source (database table)


Open XML Gateway Message Designer
Click on File->New->Data Definition
Enter source data definition name, description and select definition type as Database

Enter Database connection details

Select required views

Select the columns from the selected tables

Define the table hierarchy

Click on Finish button


Save the definition by clicking on Save button.

Create data definition for Target (XML)


Open XML Gateway Message Designer
Click on File->New->Data Definition
Enter source data definition name, description and select definition type as XML

Enter XML Standard, XML file name, XML Root Element, DTD File Name and Run time location of the
DTD.
Enter the actual details instead of the values shown in the example.

Click on finish button.


Change the level tags item type to Level.

Click on save button to save the target data definition


Create message map between Source (Database ) and Target (XML)
Open XML Gateway Message Designer
Click on File->New->Transaction Map
Enter message map name and description

Select Source Data Definition

Select Target Data Definition

Click on Finish Button.


Click on Level Mapping tab.
Map the levels by dragging the source level to target level.

Click on Element Mapping tab.


Map the elements by dragging the source element onto target element

Create function on the target definition


Right click on Target Root element (DEPARTMENT in this example) and select Actions menu option.

In the popup screen select Create Global Variable. You must create these global variables with exact name for
all messages you want to develop.
Enter the following values.
Global Variable Name: TRANSACTION_TYPE
Variable Data Type: VARCHAR2

Create another global variable


Enter the following values.
Global Variable Name: PARAMETER1
Variable Data Type: VARCHAR2

Create another global variable


Enter the following values.
Global Variable Name: TP_ID
Variable Data Type: NUMBER

Create another global variable


Enter the following values.
Global Variable Name: TP_SITE_ID
Variable Data Type: NUMBER

Create another global variable


Enter the following values.
Global Variable Name: TP_TYPE
Variable Data Type: VARCHAR2

Create another global variable


Enter the following values.
Global Variable Name: TRANSACTION_SUBTYPE
Variable Data Type: VARCHAR2

Now Create an Action on Source data definition levels. This is to create a where clause on each level to
retrieve the data for specified object (like for a specific department in this example).
Right click on first level (DEPT_XML_V) and select Actions menu option.
Select Append Where Clause database function.
Enter the where condition as below.
Where Clause: and deptno = :ecx_parameter1
Bind Variable: ecx_parameter1
Bind Value: Select PARAMETER1 from global variables

Right click on second level (EMP_XML_V) and select Actions menu option.
Select Append Where Clause database function.
Enter the where condition as below.
Where Clause: and deptno = :ecx_parameter1
Bind Variable: ecx_parameter1
Bind Value: Select PARAMETER1 from global variables

Save the message map.


Load the DTDs and Message Map into XML Gateway Repository
Transfer DTDs and Message Map into server directory in BINARY mode.
For example into ont/xml directory.
Load the main DTD using the following command
java oracle.apps.ecx.loader.LoadMap apps <apps password> <servername/ip address>: < database port no> :
<database SID> <Message Map file name>
Example:
java oracle.apps.ecx.loader.LoadMap apps apps 192.168.139.184:1531:TRG DEPT.xgm
Load the message map using following command
java oracle.apps.ecx.loader.LoadDTDToClob apps <apps password> <servername/ip address>: < database
port no> : <database SID> <DTD Name> <Root Element> <DTD Directory>
Example:
java oracle.apps.ecx.loader.LoadDTDToClob apps apps 192.168.139.184:1531:TRG DEPT.dtd
DEPARTMENT ont/xml

Create Workflow Process for the event subscription


Open Workflow Builder
Select File->Quick Start Wizard
Enter the values for New Item Type and Process.

New process will be created with specified details.


Now add XML Gateway Standard item type to the new workflow process.
Click on file open and select Database radio button and provide database connection details.

Select XML Gateway Standard from the item type list.

XML Gateway Standard item type will be opened in another store. Select XML Gateway Standard item type
from that store and drag it into item type that you created.

Close the store opened for XML Gateway Standard workflow type by clicking on the store and selecting File>Close Store menu option.
Right click on the Attributes and select New Attribute option.
Create a new attribute with following details. The internal name should be same as specified in the
example.

Please note that the default value for transaction type is defaulted to DEPT in this example. Please
specify the actual transaction type that you create.
Right click on the Attributes and select New Attribute option.
Create a new attribute with following details. The internal name should be same as specified in the
example.

Please note that the default value for transaction subtype is defaulted to CREATE in this example. Please
specify the actual transaction subtype that you create.
Right click on the Attributes and select New Attribute option.

Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Please note that the default value for event name is defaulted to sierra.apps.hz.dept.create in this
example. Please specify the actual event name that you create.
Right click on the Attributes and select New Attribute option.
Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Right click on the Attributes and select New Attribute option.


Create a new attribute with following details. The internal name should be same as specified in the
example.

Now double click on the Department Creation XML Generation process. Another window will open with
diagram of the process. Arrange both windows side by side.

Click on Start node and delete the node.


Click on XML Gateway Standard item type
Select Events->Generic Receive Event and drag it into diagram window.

Right click on Generic Receive Event and select Properties option.


Click on Node tab and select Start in the Start/End column.

Click on Event Details tab and set the item attribute values for Event Name, Event Key and Event Message
fields

Click on OK button.
Click on XML Gateway Standard item type and select Functions->Send Document

Drag Send Document function into work flow diagram window. Place it between Generic Receive Event and
End nodes.

Left Click on Generic Receive Event hold the button and move the mouse on to Send document node to create
transition between Generic Receive Event node and Send Document node. Repeat the above process to create
transition between Send Document node and End node.

Right click on Send Document node and select Properties menu option.
Select Node Attributes tab and set the following node attribute values.
Node Attribute Name
Transaction Type
Transaction Sub Type
Document Id
Party Site Id
Party Id
Parameter1
Parameter2
Parameter3
Parameter4
Parameter5
Send Mode
Message Id
Party Type

Attribute Type
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Item Attribute
Constant
Constant
Item Attribute

Value
ECX Transaction Type
ECX Transaction Subtype
Event Key
ECX Party Site ID
ECX Party ID
ECX Parameter1
ECX Parameter2
ECX Parameter3
ECX Parameter4
ECX Parameter5
Immediate
XML Document ID
ECX Party Type

Click on OK button.
Click on File->Save to save the workflow into database.
Create Customer to define as trading partner
Select Receivables responsibility and select Customers->Standard menu option.
Enter customer details and address details. Define the address as Primary Sold To and define EDI Location
(Enter a meaningful EDI Location code for the created customer) as shown in the example.

Defining Transaction
Switch responsibility to XML Gateway and select Define Transactions menu option
Enter the Transaction Type, Transaction Sub Type, Description, XML Standard code, Direction, External
Transaction Type and External Transaction Subtype as shown in the example.
Define the transaction type, Transaction subtype, External Transaction Type and External Transaction
Subtype depending on the transaction you are creating.

Defining trading partner


Select Define Trading Partners menu option.
Define the trading Partner as following.
Header
Trading Partner Type: Select Customer
Trading Partner Name: Select the customer that you created in the previous step
Trading Partner Site: Select the address that you defined as Primary Sold To site
Company Admin Email: Enter the admin email address
Details
Transaction Type: Select the transaction type that you created in the previous step. Transaction Subtype,
Standard Code, External Transaction Type, External Transaction Subtype and Direction will be defaulted from
transaction type definition.
Map: Select the Message Map you created
Connection/Hub: Direct
Protocol Type: HTTPS
Username: Enter the username for the target system
Password: Enter the password for the target system
Protocol Address: Enter the protocol address of the target system
Source Trading Partner Location Code: Enter the EDI Location entered in the customer address
Destination Trading Partner Location Code: Enter the EDI Location entered in the customer address

Defining the Event

Login as SYSADMIN or other user who has workflow administrator role assigned.
Change the responsibility to Workflow Administrator Web Applications.
Select Administrator Workflow->Business Events menu option.
Click on Create Event.
Enter the in Name, Display name, Description, Owner name, and Owner tag fields.
Click on Apply button to save the event definition

Defining the Event Subscription


Login as SYSADMIN or other user who has workflow administrator role assigned.
Change the responsibility to Workflow Administrator Web Applications.
Select Administrator Workflow->Business Events menu option.
Click on Subscription tab which is at top left corner of the screen.
Click on Create Subscription button.
Enter the values in the following fields.
System: Select the local system
Source Type: Local
Event Filter: sierra.apps.hz.dept.create
Phase: 10
Status: Enabled
Rule Data: Message
Action Type: Select Launch Workflow from the list
On Error: Stop and Rollback
Click on Next button.
Workflow Type: Select the workflow type created for this event
Workflow Process: Select the workflow process created for this event
Priority: High
Owner Name: Sierra

Owner Tag: Sierra


Click on apply button.

Raising Event

Raise the event by using the following SQL code.


Please change the code where ever specified in RED with your transaction details.
DECLARE
l_parameter_list
l_item_key

wf_parameter_list_t := wf_parameter_list_t();
NUMBER;

BEGIN
SELECT OE_XML_MESSAGE_SEQ_S.nextval
INTO l_item_key
FROM dual;
wf_event.AddParameterToList(p_name=>
'ECX_PARAMETER1',
p_value=>
TO_CHAR(10), -- Primary Key
p_parameterlist=> l_parameter_list);
wf_event.AddParameterToList(p_name=>
'ECX_PARTY_ID',
p_value=>
to_char(79290), --Customer Party Id
p_parameterlist=> l_parameter_list);
wf_event.AddParameterToList(p_name=>
'ECX_PARTY_SITE_ID',
p_value=>
to_char(49285), --Party Site Id
p_parameterlist=> l_parameter_list);
wf_event.AddParameterToList(p_name=>
'ECX_TRANSACTION_TYPE',
p_value=>
'DEPT', -- Transaction Type
p_parameterlist=> l_parameter_list);
wf_event.AddParameterToList(p_name=>
'ECX_TRANSACTION_SUBTYPE',
p_value=>
'CREATE', --Transaction Sub Type
p_parameterlist=> l_parameter_list);
wf_event.AddParameterToList(p_name=>
'ECX_DOCUMENT_ID',
p_value=>
l_item_key,
p_parameterlist=> l_parameter_list);
wf_event.raise(
p_event_name => 'sierra.apps.hz.dept.create',
p_event_key => l_item_key,
p_event_data => NULL,
p_parameters => l_parameter_list
);
l_parameter_list.DELETE;
COMMIT;
END;
/
Viewing the Event Details

Login as SYSADMIN or other user who has workflow administrator role assigned.
Change the responsibility to Workflow Administrator Web Applications.
Select Administrator Workflow->Status Monitor
Enter the workflow type internal name and click on GO button

Select the workflow process by clicking on Select radio button and click on Status Diagram button.

The following workflow process diagram will appear which shows the status of the process.

Viewing the generated XML stored in the Outbound Agent (ECX_OUTBOUND)


Login as SYSADMIN or other user who has workflow administrator role assigned.

Change the responsibility to Workflow Administrator Web Applications.


Select Oracle Applications Manager->Workflow Manager
The following screen will appear. Click on Agent Activity URL at the bottom center of the screen.

The following screen will appear. Click on radio button next to ECX_OUTBOUND to select the agent and
click on Search Agent Entry Details.

The following screen will appear. Click on Go button. The list of transactions will be shown in the details
section. Click on View XML link to see the XML generated for that transaction.

Viewing the XMLs sent through Oracle Transport Agent (OTA)

Login as SYSADMIN or other user who has workflow administrator role assigned.
Change the responsibility to Workflow Administrator Web Applications.
Select Transaction Monitor->Transaction Monitor.
The following screen will appear.

Click on Outbound Messages radio button. Enter the transaction type, Transaction Subtype, Party Type and
select the date range. Click on GO button

The following screen will appear.

Click on the Document Id URL of a transaction. The following screen will appear.

Click on the View XML button. The following screen will appear.

You might also like