Monday, April 11, 2011

Polymorphic VO


Polymorphic VO is one of the interesting feature for ADF business components , you can define parent-child hierarchy in Entity objects and can use single VO on base EO to retrieve diff childs .

Steps :
1. Create Base EO like Persons EO
-Keep attrs relevent to Person and remove others
-Select the discriminator check box for person_type and give default as 'PERS'

2. Create SubTypes
- Create EmployeeEO and extends it from Persons EO
- add additional columns from Table [Salary]
- override discriminator  column give default as 'Employee'

- Create CustomerEO and extends it from Persons EO
- add additional columns from Table [Credit Limit]
- override discriminator  column give default as 'Cust'

3. Polymorphic VO

- Create VO based on base EO
- After selecting the base EO , select subtypes and select the other two EO's


Now the hierarchy is complete and you have Polymorphic VO that can represent diff EO types.

You will see following code in VO :
  <AttrArray Name="EntityImports">
    <Item Value="project1.EO.CustomerEO"/>
    <Item Value="project1.EO.EmployeeEO"/>
  </AttrArray>

This shows the types of entities it can refer to.

Rest Support from OSB


Couple of times we need to call Rest based services like HTTP Post from OSB/SOA layer, as of now there is no well defined adapter for this. Most of the times we end up using POJO for this.The HTTP adapter provided in SOA is quite basic and doesnt generally fits the requirement like when calling services with complex input data like multi-mime etc.
Here is steps that can be followed , however its completely driven by the requirement and need to be customized accordingly.
Use case :
- HTTP Post service that has to be called
- Input is multi mime and handshake is through the boundary defined
- No ssl or any other security need.

Steps:
1. Create a Business service in OSB
Service Type : Messaging Service
Request/Response Message Type   : Text
Protocol  : html
Endpoint URI  : http://mysupplier/serviceendpoint/
HTTP Request Method  : POST

Test this with your multimime input from test console,
pass the input in body and Content-Type: multipart/form-data; boundary=scm-shipping-oracle;utf-8

2. Create proxy based on the business service .
Service Type : Messaging Service
Request/Response Message Type   : Text
Protocol  : html

Test this with your multimime input from test console ,
pass the input in body and Content-Type: Content-Type: multipart/form-data; boundary=scm-shipping-oracle;utf-8

- You can add alert here to display the body and attachment data

3. Create another proxy to call the proxy created in previous step, I added this to put customization logic and to not

disturb the proxy->Buss service route created in previous step.

In message flow :
- Set Transport Headers for outbound request
Content-Type: Content-Type: multipart/form-data; boundary=scm-shipping-oracle;utf-8

- Add Java callout to read the attachment data , the java callout must return org.apache.xmlbeans.XmlObject
- add replace for attachment with the java callout output [replace entire node]
- While responding can add another java callout to write the attachment , can use xs:string($attach_resp) to cast attachment to string.

This all is done.

4. Now to call this from bpel can add a proxy based on wsdl that calls the proxy created in 3rd step.

This works !!

State Caching , coherence


For SOA Domain if HA is needed , set the following properties in the weblogic server startup argument.

-Dtangosol.coherence.wka1=apphost1vhn1 -Dtangosol.coherence.wka1.port=<port1>
-Dtangosol.coherence.wka2=apphost2vhn1  -Dtangosol.coherence.wka2.port=<port1>
-Dtangosol.coherence.localhost=apphost1vhn1 -Dtangosol.coherence.localport=<port1>

Fusion Applications the New Age ERP


http://www.oracle.com/us/products/applications/fusion/index.html

Looks great to me , and yeah proud to be part of its Development .