Thursday, 19 December 2013

Fundamentals of Oracle AIA

Few weeks back I had to understand the oracle's AIA for our new project, since I am from OSB background relating to AIA was not a big task. When I was referring to blogs and oracle documents I made my notes which can help anyone to understand the basics..

Q. What is an AIA ?

Ans- Application Integration Architecture is oracle's set of best practices to integrate various systems/applications using SOA Suite middleware.
AIA is a complete integration solution for orchestrating agile, user-centric business processes across enterprise applications.

Q. What is foundation pack ?

Ans- If we have jdev installed in our machine we can easily download AIA foundation pack, by using help->softwareupadate (Update center).
Foundation pack basically contains the framework to build  AIA specific(concept wise) services ABCS. when we create ABCS using foundation pack, framework by default will create the skeleton of the service including error handling framework, thus reducing the manual effort.

Steps to install foundation pack in JDev- 

-Update JDeveloper with the SOA Suite Composite Editor plug-in from the Update center.

-Update JDeveloper with AIA Service Constructor plug-in from the Update center.
- Apply Freemarker 2.3.15 or higher needed by AIA Service Constructor.
       Download Freemarker template engine from
       Put freemarker.jar (extracted from the downloaded zip file) in the jdeveloper/jdev/lib folder.

Q. What is canonical model ?
Ans-  A model which is in the simplest form possible based on a standard, application integration (EAI) solution. Most organizations also adopt a set of standards for message structure and content (message payload). The desire for consistent message payload results in the construction of an enterprise or business domain canonical model common view within a given context. (Source wiki)

Q. Terminology and building blocks?

Ans - 
EBO -EBOs are enterprise business objects based on the canonical object model. Reusable components representing a business object such as Sales Order, Party, Item, Customer etc. The Enterprise Business Objects are delivered as XML Schema Definition (XSD) files.

EBM - The Enterprise Business Message (EBM) defines the elements that are used as messages in service

operations. The EBM payload is a restricted view of the EBO content and it includes only the
content necessary to perform the specific operation. The Web Services accept EBMs as input and
return EBMs as output.

EBS -Enterprise Business Services (EBSs) are the foundation blocks in AIA. EBS represents the 
application independent web service definition for performing a business task.

ABM - An ABCS can be requester-specific or provider-specific. A requester ABCS accepts the request from the client application through a client-specific Application Business Message (ABM) and returns the response to the client application through a client-specific ABM.

The image is described in the surrounding text
ABCS -  Application business connector service is basically a service which speaks to any application can be CRM, BRM etc.
ABCS can be of two types requester or provider. Requester ABCS is the one which requests/calls other application EBS. And Provider ABCS is the one which which gets the request from other application's EBS.

The ABCS is responsible for the coordination of the various steps that are provided by several services, including:
 -Validation (if any)
 -Transformations - message translation, content enrichment, and normalization
 -Invocation of application functions
 -Error handling and message generation
Let's say application A wants send some updates to application B. Then first application A's requester ABCS will have the application request(ABM) this ABCS will transform its request to another application specific request(EBM) then sends it to EBS. EBS when gets the request depending on the requirement it transforms the incoming request (EBM) to a particular application specific request(ABM) and the sends it application B's provider ABCS.

The image is described in the surrounding text

All images copied from oracle documentaion

Q. What is PIP ?

Ans- Oracle's AIA has PIPs for various domains like communication, which can help in reducing the manual effort and customer can directly focus on their requirement instead of focusing on the basic design and integration part. Pre integration packs or Pre built packages are the set of processes/services/delivarebles which when installed/deployed on SOA suite can directly integrate various systems like CRM, BRM, E-BS.

All we need to provide is the connection details to PIP and it will connect/integrate to the systems.

Oracle with their partners have come up with various PIPs, which can save lot of design and development time.

Here are few commonly used PIP in the current industry:
  • Siebel CRM Integration Pack for Oracle Order Management
  • Agile Product Lifecycle Management Integration Pack for Oracle E-Business Suite
  • Oracle Design to Release Integration Pack for Agile Product Lifecycle Management and JD Edwards Enterprise
  • Agile Product Lifecycle Management Integration Pack for SAP
  • Oracle Customer Master Data Management Integration Option for Oracle E-Business Suite
  • Siebel CRM Integration Pack for i-flex FLEXCUBE Account Originations
  • Siebel Call Center Integration Pack for Oracle Adverse Event Reporting System
  • Oracle Application Integration Achitecture for Communications
  • Oracle Primavera to the Oracle E-Business Suite
  • Oracle CRM On Demand to Oracle’s JD Edwards World

Q. AIA Extensions?

Ans- As we know AIA PIP comes with pre built integration pack, so once its installed/deployed we have integrated various systems. But as we know each customer/client/company will have their own requirement that depends on the customers they are serving.

To fulfil the customization needs as per the client we need to  update the ABCS, EBS, EBO this is called AIA Extension.

In AIA extension, we can extend all the components i.e. ABCS, EBS, EBM, EBO as per our requirement.

Extending ABCS - 

Extending EBS/EBM/EBO -

Oracle AIA facilitates the extension of delivered Enterprise Business Objects (EBOs) to accommodate the introduction of industry-specific and customer-specific needs.

Extending ABCs -

Q. what is CAVS?

Ans- The Composite Application Validation System (CAVS) is a framework that provides a structured approach to test integration of Oracle Application Integration Architecture (AIA) services. The CAVS includes test initiators that simulate web service invocations and simulators that simulate service endpoints.
In the context of AIA, where there is a sequence of service invocations; spanning Application Business Connector Services (ABCSs), Enterprise Business Services (EBSs), Enterprise Business Flows (EBFs), and participating applications; the CAVS test initiators and simulators enable a layered testing approach. Each component in an integration can be thoroughly tested without having to account for dependencies by using test initiators and simulators on either end.

The CAVS provides value as a testing tool throughout the integration development life cycle:

Quality assurance

Source -

Q. Versions available ?

Ans - 

AIA Version History and Tech Stack Implementation:

  • First stable version was 2.x series i.e 2.1, 2.2, 2.3, 2.4 and 2.5
  • AIA 2.x versions was deployed on SOA 10g  i.e OAS 10gR3 or Weblogic Server 9.2
  • Oracle service registry for SOA or Aqualogic service registry for Weblogic were mandatory components for 2.x series.

AIA 11g R1 :

  • Latest AIA release for Fusion Middleware Stack.
  • Weblogic 10.3 is the core base stack for deployment.
  • Deployed on SOA 11g R1 ( which intern can install only on Weblogic 10.3
  • Use of service registry is optional, where as this was mandatory for AIA 2.x release.
  • Powered by Fusion Middleware 11g

Q. When to use OSB for AIA?
Ans-  If the ABCS needs to manage the state in the integration layer or to implement an asynchronous request-response message exchange pattern, then you should leverage BPEL technologies.
When to go for OSB AIA implementation   - 

  Completely stateless - there is absolutely no need to persist any state in the integration layer

  Short-lived processes
 Synchronous responses from downstream services or applications in case of flows involving federated queries
 No inter-dependencies between messages

Link Referred  -

Q. When to use Mediator?

Ans- As Oracle Service Bus does not have the same capabilities as that of Oracle Mediator with
respect to processing of messages in an ordered manner even if they arrive in an unordered
In situations where the ordered processing of messages does matter we should use Mediator.

Resequencing in Oracle Mediator -

Link  -

In the Oracle AIA asynchronous message exchange pattern, participating applications push messages to the

Oracle AIA layer where they are processed in a store-and-forward fashion.

In this message exchange pattern, there is a need to process messages pertaining to the same object instance in the same

sequence in which they are generated. The Resequencer in Oracle Mediator helps to maintain correct processing sequence.

The sequencing is done based on the sequencing strategy selected. The mediator provides us with three types of resequencers:

Standard Resequencer

FIFO Resequencer
BestEffort Resequencer

Q. Can  Mediator be used as ABCS ?

Ans- The ABCS can be implemented in two ways:
The first approach is to make complete use of components that are built using Oracle Fusion Middleware technologies to make up the ABCS.
The service is implemented as a Mediator service or a BPEL process. This Mediator service or BPEL process performs the tasks required
The second approach is to build the transformation services, to a large extent, as part of the participating application.
This approach can be taken when the participating application's technology stack has the infrastructure to perform the transformations. However, a lightweight ABCS still must perform the translations related to cross-reference details.
In many situations, a single action cannot be mapped to a single API or operation in the provider application. The provider application might have very fine-grained operations and might also require that transaction management be handled by calling applications. In this case, the provider-side ABCS probably has a chatty conversation with the server application. The provider-side ABCS is also responsible for state management.

This type of ABCS can be implemented using only BPEL technologies and not through Mediator services.

Q. What if we can not rollback the whole transaction?
Ans- Sometimes an automatic correction of data or a reversal of what has been done in requester service is needed. The typical scenario is one in which an error occurs in the transaction and the transactions cannot be rolled back.In these situations, the requester application can implement the compensation service operation and pass the name of the service operation to the provider ABCS. The provider ABCS invokes this compensation service operation if there are errors. There may be a requirement to implement a compensating service for the requesting service.
For more info refer BPEL basics mentioned flow.

Q. What is an error handling framework in AIA?

Some basics of BPEL:

Q. Difference between Pick and receive activity ?

Ans- Pick enables BPELs to implement event-based business logic that forces the process to wait until an event occurs. Pick enables BPELs to wait for message event(s) that are defined
on onMessage or time condition alarm event(s) that are defined on

onAlarm. Pick activity have one or more onMessage and onAlarm activities where as in receive it contain only one
Receive:°° Part of the BPEL default template°° Waits for a client to make a request or processes asynchronouscallback responses from external services

Q. Error handling framework in BPEL ?

Ans- Fault handlers in BPEL are similar to try/catch clauses in modern programming languages such as Java. A fault policy configured with the fault management framework overrides any fault handling defined in catch activities of scope activities in the BPEL process. The fault management framework can be configured to rethrow the fault handling back to the catch activities.

Q.  Partner link ?

Ans - Web services from external party in BPEL terminology called Partner Link. Partner link is external Web services that perform specific tasks and return value as XML.

Q. Transaction rollback ?

Ans -Basically in synchronous transactions, whole flow comes under one transaction, so even the failure occur at last stage will lead to rollback the whole transaction.

But for asynchronous all the callouts can be seprate transactions..

Thus for rollback to work properly we need to set global transaction settings and few settings to make sure all the transactions are covered in one
transaction, thus can be rollbacked completely.
Steps -
1) Configure all BPEL processes with bpel.config.transaction=required in composite.xml.
2) Modify the generated WSDL file for the AQ or JMS adapter and add an output message, making it synchronous.
 Instead of going with Synchronous adapter, we can use – oneWayDeliveryPolicy to sync.

3) Configure the AQ or JMS adapter with jca.retry.all=true in composite.xml.

4) Use an XA data source.

Their is one more scenario, where we can not completely rollback the whole transaction. In this case we need to use

Compensation service feature where can call this service to undo all the tasks which were done in the failed transaction.
Link Referred -

# To update the Composite wsdls to MDS follow the below steps.

1. FTP the WSDLs to AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary

2. Update the UpdateMetaDataDP.xml in aia_instances/AIA_DEV/config with the path composite wsdls placed in AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary
3. Set the env variables. /aia_instances/AIA_DEV/bin/
4. Run the ant script UpdateMetaData.xml in /AIA11.

5. Check whether the Build Sucessful.Refresh the MDS in JDev and check the new wsdl in AIAMetaData/AIAComponents/ApplicationConnectorServiceLibrary


#Useful Links:

BPEL sample program -

creating FIle based MDS -
Deploying your canonical data model to MDS-

working example -

fault maangement -

Just a Thought - 

After going through BPEL, Mediator, OSB, Human Task Flow, Business rules, I get lot of confusion as when to use what, I know most of you will not agree and will think in your mind that each has ther own use.

I agree but somehow I believe these all serve one purpose that is to integrate.
 I believe all of this confusion can be avoided and all these products/technologies can be clubbed into one.

Like Mediator and OSB - both of them provide similar capabilities,yes there are few basic differences in terms of performance and all.

But I feel these two products exist and are not clubbed into one just because of one reason. OSB was acquired from BEA ALSB, and mediator was Oracle's ESB.

These are two differenct product with same purpose.

Similarly BPEL, is for orchestration and choreography it has dehydration feature, it can directly call humanwork flow. But what is the need for all these features having only in BPEL.

Can't we have just one tool let's say E(Enterprise)-BPEL which will have same terminology throughout and will have all the features of BPEL, OSB, Mediator and can be used as per the need.

I know ther can be arguments like it be very heavy and can have performance impact.. Yes it can but these issues can be resolved if taken seriusly by Oracle.

- All are my own silly views - Sunny

Thursday, 5 December 2013

New Company ...New Experience

Well Finally I have arrived in this new space....
Was never sure, how will I keep up the pace....
Last 3 weeks having lunch alone..
Reading, laughing and writing in my own zone
No one is here to give me company, Never thought it would be too hard to make one frnd
when I know I am capable of making many....
Seems like I have grown up, with ego and attitude
and probably that's the reason of my solitude...
Somehow I am feeling I am enjoying this,
becoz once this is gone I wud have nothing to miss...
So much we desire, so much we accomplish,
and still we want more.. this means we are greedy and selfish...
I am trying hard to make myself happy and satisfied,
and will continue to do so..letc how it goes,
will write again, till then its adios amigos.....

Tuesday, 22 October 2013

My Last day in My First company

While chatting with my Frnd .. I realized that my last day in my first company is just a week away...
Will definitely miss this place :( issi ke sath 6 saal ka sath khatam hua

kabhi kabhi lagta hai lyf itni fast kyu chalti hai
thoda ruk ruk ke kyu nahi chalti
kyu nahi kuch waqt de deti apno ke sath bitaane ka
kyu nahi kuch waqt de deti dosto se dosti nibane ka
kyu nahi ham waqt ke kadar kar paate hai
kyu bas future ke peeche bhaage jate hai
kyu bas lagta hai kuch pana hai
kyu bas lagta hai har kisi se age badna hai
jaise jaise bade ho rahe hai..
lyf ko thoda thoda samaj rahe hai
par dar yahi hai late na ho jaye
bache khuche dost bhi bas kho na jaye
abb koshish yahi raheti hai ki dheere dheere chalna hai
kyunki abb samaj liya .. jo aaj hai wo kal na hai

Thursday, 19 September 2013

Groovy - Putting object in a Map and iterating over it

import jxl.*
import jxl.write.*

//to read from excel
Workbook excelFile= Workbook.getWorkbook(new File("c:\\Testing\\test.xls"));
Sheet sheet = excelFile.getSheet(0)

//declaring map
def getTestDataMap = [:]
rows = sheet.getRows();
for( tc_row in 1..rows-1){
Cell testCase = sheet.getCell(0,tc_row);
Cell customerId = sheet.getCell(1,tc_row);
Cell productId = sheet.getCell(2,tc_row);
Cell productStatus = sheet.getCell(3,tc_row);
Cell propertyName = sheet.getCell(4,tc_row);
Cell propertyValue = sheet.getCell(5,tc_row);
String testCaseNumber = testCase.getContents();

getTestDataMap.put(testCaseNumber,new GetOperationBO(testCaseNumber: testCase.getContents(),customerIdData:customerId.getContents(),productIdData: productId.getContents(),productStatusData:productStatus.getContents(),propertyNameData:propertyName.getContents(),propertyValueData:propertyValue.getContents()))


// iterating
for ( e in getTestDataMap ) {
GetOperationBO getOperationBO = new GetOperationBO();
    getOperationBO.testCaseNumber = e.key
    getOperationBO = e.value getOperationBO.testCaseNumber getOperationBO.customerIdData getOperationBO.productStatusData

class GetOperationBO {

String testCaseNumber
String customerIdData
String productIdData
String productStatusData
String propertyNameData
String propertyValueData

Tuesday, 17 September 2013

Reading/Writing from Excel in soap UI using groovy

Dowload jexcelapi_2_6_12 and put it in ext folder of soap ui .. .restart SOAP UI.. create one sample xls and paste the below code in soap ui...

import jxl.*
import jxl.write.*

//to read from excel
Workbook excelFile= Workbook.getWorkbook(new File("c:\\Testing\\myfile.xls"));
Sheet sheet = excelFile.getSheet(0)
Cell a1 = sheet.getCell(0,0) a1 // getCell(row,column) -- place some values in myfile.xls
Cell b2 = sheet.getCell(1,1)  // then those values will be acessed using a1, b2 & c3 Cell.
Cell c2 = sheet.getCell(2,1)
String s1 = c2.getContents(); s1

// To write in excel
WritableWorkbook workbook1 = Workbook.createWorkbook(new File("c:\\Testing\\myfile.xls"))
WritableSheet sheet1 = workbook1.createSheet("Worksheet Number 1", 0)
Label label = new Label(0, 1, "some data to put");

Disclaimer-- code copied from various blogs :)

Monday, 16 September 2013

Calling Java method from jar in soap UI:

1. Put the required jars in soapUI-3.5\bin\ext folder...
2. First restart SOAP UI and then execute the  code snippet....

-- sample  code---
import com.ssh.*

// Class present in the jar which is loaded from ext
GetLogs transactionLog = new GetLogs();

// sample method to call
transactionLog.getLogs("sample string");


When I was calling java method from soap UI.. initially I was getting null pointer exception for few minutes I was wondering how to go forward as there were no logs displayed.. then as we know to debug any application log is the solution..In case if anyone is getting any exception or unexpected response we can always check soapui and soapui-errors files in soapUI-3.5\bin .... Hope it helps....

Thursday, 12 September 2013

Java Example to ssh to Unix box

I looked around for the sample code to connect to the unix box... I could find lot of examples but very few with private keys...and  found bit difficult to understand.
After spending some time.. I could found few examples to suit my requirement... so thought it might be helpful for someone else also...
I Referred conversion of private key from this link -
Make sure you save the keys in .ssh format..

Here it goes---

package com.ssh;


import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelShell;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;

public class ConnectionTest {
public static void main(String[] arg) {
try {
JSch jsch = new JSch();

KeyPairGenerator keyPairGenerator = KeyPairGenerator
keyPairGenerator.initialize(2048, new SecureRandom());
// PrivateKey privateKey =
// keyPairGenerator.genKeyPair().getPrivate();

StringWriter writer = new StringWriter();
// PEMWriter pemWriter = new PEMWriter(writer);

// pemWriter.writeObject(privateKey);

String privateKeyStr = writer.toString();

String user = "urusername";
String host = "ip address of the box u r trying to connect";
// ogre
// String host = "";
int port = 22;
String privateKey = "key in ssh format";
String passphrase = "ur key's passphrase";
// jsch.addIdentity(privateKey);
jsch.addIdentity(privateKey, passphrase);

System.out.println("identity added ");
// addIdentity(String,bytearrayof ssh format file,null,byte array of
// passphrase file)
Session session = jsch.getSession(user, host, port);
System.out.println("session created. " + session);

java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setPassword("ur password");
System.out.println("before session connect");
System.out.println("session connected.....");

Channel channel = session.openChannel("shell");

InputStream in = channel.getInputStream();
OutputStream out = channel.getOutputStream();

((ChannelShell) channel).setPtyType("vt102");

byte[] tmp = new byte[1024];

out.write(("ls" + ";exit").getBytes());

while (true) {

while (in.available() > 0) {
int i =, 0, 1024);
if (i < 0) {
// System.out.println("[debug] breaking at i < 0");
String buffer = new String(tmp, 0, i);
String results = "";
// results.add(buffer);
// System.out.println("[debug]" + buffer);

System.out.println("result - " + buffer);
if (buffer.contains("REMOTE JSH COMMAND FINISHED")) {
System.out.println("[debug] breaking at finished");
if (channel.isClosed()) {
// System.out.println("[debug] breaking at isClosed");
} catch (Exception e) {


// commented sftp code ...

* Channel channel = session.openChannel("sftp");
* channel.setInputStream(; channel.setOutputStream(System.out);
* channel.connect(); System.out.println("shell channel connected....");
* ChannelSftp c = (ChannelSftp) channel;
* String fileName = "D:/localfile.txt/test.txt";
* c.put(fileName, "./in/"); c.exit(); System.out.println("done");
* } catch (Exception e) { System.err.println(e); }


Hope it helps :)

To copy the file and then delete from the unix box.. following code can be used--
Here, the session is the same variable which is created in the above code.. and logfileName is the file which needs to be copied...

public static void getLogBySftp(Session session, String  logFileName) throws JSchException, SftpException
Channel channel = session.openChannel("sftp");
channel.setInputStream(; channel.setOutputStream(System.out);
channel.connect(); System.out.println("shell channel connected....");

//Channel channel = session.openChannel("sftp");
       ChannelSftp sftpChannel = (ChannelSftp) channel;
       System.out.println("Directory:" + sftpChannel.pwd());
       System.out.println("Directory after cd:" + sftpChannel.pwd());
       //sftpChannel.get( transactionId+".xml");
       System.out.println("xml file name  - "+logFileName);
       sftpChannel.get(logFileName, logFileName);