Friday, January 30, 2015

Error: cos-element-consistent: Type of element is inconsistent with another element with the same name in this content model

I was working on the XML schema creation in Oracle Service Bus application, and I got the following issue while building the OSB service project:

Error: cos-element-consistent: Type of element is inconsistent with another element with the same name in this content model."/>

Later I found that some body has updated the schema with same element which is already there with some other type i.e.  I put  this element

<element name="ResponseStatus" type="ResponseStatus_Type" />

"ResponseStatus_Type" is simple type which is defined as follows:

<xsd:simpleType name="ResponseStatus_Type">
    <xsd:restriction base="String_Type">
      <xsd:maxLength value="64"/>
    </xsd:restriction>
  </xsd:simpleType>

Now somebody else defined one more element with same name i,e "ResponseStatus" but different type like this:

<element name="ResponseStatus" type="string" />

Solution

Just remove the one of the definition of the element with same name.

Sunday, November 30, 2014

Oracle BPM 12c: Exception thrown while creating a Business Object (BO) based on external XSD


I was working on  the oracle bpm and creating a bpmn process. while creating a Business Object I am getting an error and is something related to “unable to parse the external xsd”.
Well after that I continues to a bpmn process and create a data object, but in the data association mapping I can’t see all the elements under the root element which in the xsd. As you can see in the figure below:

No elements visible under CustomerBO and requestBMHeader.

This is a known issue in Oracle bpm 12c, you can check here : 
In this page search for : Exception thrown while creating a Business Object (BO) based on XSD

Solution:


Well you can bypass this problem by manually mapping or assigning the value into your BPMN process i.e. Process.bpmn in this example.
Or
You can use the transformation to map the elements.

I think mapping elements using transformation is simple way to do that and I have done using the same and it worked successfully.

Friday, October 31, 2014

Oracle MFT 12c: Getting started with Oracle Manage File Transfer 12c

In large organization sometimes there is a requirement to transfer the files from one location to another location and file in source location is in different format than at destination for example at source destination the file may be .zip and in the destination you have to save in .xml. Oracle Managed File Transfer is one of the utility which provide this functionality and many more.

Oralce MFT Features

  • You can schedule the file transfer.
  • Resubmitting the transfer to redeliver the file.
  • Compression and decompression of file.
  • Encryption and decryption of files.
  • Archiving, renaming and deletion.
  • you can pause and resume the file transfer.
  • Detailed auditing and reports of file transfer.
  • Transfer of files from single source to multiple targets.

Components of Oracle MFT

Oracle MFT Artifacts

There are three main artifacts which are used for Managed File Transfer:

Source: It defines the origin of file i.e. location of the file which is going to picked by MFT server.

Transfer: This artifacts links one source to one or more targets. You can also create the content filters or can perform the actions like encryption/decryption or compresseion/decompression.

Targets: It is the destination location where the transfer put the file or the content.



Embedded Ftp and sFtp server in weblogic

In Oracle MFT 12c these two servers are embedded to weblogic can be used as one of the source artifacts, you need to configure host, port, user access to the directories in the MFT console as shown below:

By default the Ftp server is up and running, the only thing required for the Ftp server is location i.e. you have to pass the source location of files, default location is set to /u01/app/oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/mft/ftp_root/payloads. You can change this location if you want.

Monitoring and Reports

In Oracle MFT you get the separate page view or dashboard to monitor the mft instances. You can closely watch Source, Transfer and Targets instances separately. You can monitor the following things:

  • Success and failure instances for the source, transfer and target. You can also check the frequency of the statistics.
  • Dashboard got the separate error information table, so you can easily locate the error instances.
  • Separate view of active deliveries progress table.
  • Report generation for all or individual deliveries.


References:

http://docs.oracle.com/middleware/1213/mft/MFTUG/mftug_intro.htm#MFTUG269
http://docs.oracle.com/middleware/1213/mft/MFTUG/mftug_monitor.htm#CHDDGDAH


Wednesday, October 29, 2014

Oracle SOA: Sync Read of file in Oracle SOA using File Adapter

I was working on one of the requirement in which we need to read the file in between the Bpel process i.e. File Adapter is not triggering the bpel process but inside the bpel process file adapter is triggered to get the file.
Here in this post I am taking a small example to make you guys understand that what this option in file adapter means.

Scenario

In my example I am using a two file adapters one is writing of file and other is sync read of file. Well writing file adapter I used just to create a xml file so that I don't have to create manually. In the second adapter i.e. Sync Read File adapter I am passing the name of the file that is created by write file adapter. I put the same directory for write and read i.e. "G:\Anshul\SyncRead" and for archiving "G:\Anshul\Archive\SyncRead".

Steps:

  1. Create SOA Application and then SOA project.
  2. Create schema file, I have created Info.xsd.
  3. Drag n drop, File Adapter to reference lane and configure for write operation.
  4. Again drag n drop File Adapter to configure Sync Read File operation

  5. Create Bpel Process and exposed this bpel process as SOAP webservice. 
  6. After that wired all the components and you composite looks like below.
  7. Now Inside the bpel process, assign the filename to write the file and same file name to be passed to Sync Read File adapter. 
  8. Create a local variable i.e. FileNameVar and put the value concat("Info_",ora:getComponentInstanceId,".xml") this is xpath function which generates the file name like Info_10001.xml
  9. Now pass the above file name in Invoke activity of both the file adapter.
  10. Apply the Request/Response transformation to invoke variables.
  11. Save, deploy and test.
You can download the code from here : com.codeconfuse.soa.FileSyncRead

Monday, October 27, 2014

How to uninstall default open jdk in Oracle Linux

When you install linux OS on either virtual machines or physical machines then it comes with open jdk version 1.6 or 1.7 or both (In my case both on oracle linux 6.5). Well this is not a problem but sometimes you required to install the products (OSB, SOA, Weblogic etc.) which is certified with different jdk vendor or version. In that case you are required to remove the open jdk and install the jdk version you required (although you can install the new jdk version without removing older one i.e. you need to set the environment variable JAVA_HOME which is pointing to new jdk).

Here are the steps:

Check JDK installation

Run the command: java -version


Removing JDK

Run the command: yum remove java*

This command will search for all the java version and will show you all the available jdk version and ask for permission if you want to remove Y/N.


Enter 'y' to remove the jdk. After that verify jdk by running the command "java -version", you will get the following out put : bash: /usr/bin/java: No such file or directory


Install the new JDK Version

Go to the following link for how to install jdk on linux


Sunday, October 26, 2014

Oracle SOA 12c: How to create Inline Bpel Subprocess

As from my previous blog post on Getting started with resuable bpel subprocesses, you get some basic idea of resuable subprocesses in Oracle SOA 12c. Here in this blog post I am going to show you how to create a Inline bpel subprocess in your soa composite application.

Scenario:

I am creating a Error handler service in which there two scope in the Error Bpel Process. 
  • Notification scope: In this process email notification is send to the user using the notificaiton service.
  • Logs scope: In this process logs is written in the external file system using the file adapter
Note: Only the scope activity can be converted into subprocess.

Create inline bpel subprocess
  1. Create a soa project in soa application i.e. CommonComponents and in that create a bpel 2.0 process i.e. "ErrorProcess"
  2. In the bpel process, create two scope logs and Alert (notification scope). Now in the log scope call the file adapter to write the logs on to the file system and in Alert scope call the notification service to send email.
  3. Now right click on the scope and select convert to subprocess
  4. After creating subprocess, you can see the subprocess in the components tab.
  5. Drag n drop the inline subprocess where ever you required.
  6. Save, deploy and test the process.


Oracle SOA 12c: Getting started with Resuable BPEL Subprocesses

Previously if any one wants to resuse the BPEL code then one has to build a logic into the separate process and this process is called by invoke activity through webservice in another process. Well we can't say this is the problem or not, but in Oracle SOA 12c there is more efficient way to make BPEL code reusable across the process. One scenario came to my mind is in BPEL process, sometimes you have to "log the messages for monitoring", "send notification to the process owners" etc. and this can be done at multiple times in a process, so calling subprocess is better way than invoking external http service etc.

Here are some of the benefits of Subprocess:

  • Reusability of BPEL code. Now don't have to write same code multiple times, just create subprocess and call that subprocess where ever you want.
  • You don't have to change the logic at multiple times, just change in the sub process i.e. at one place only.
  • Code looks more modularized and easy to understand by any other stakeholder.
  • It is better than calling the invoke activity.
Some points needs to be remember about subprocess
  • Subprocess is only supported with BPEL 2.0
  • Correlation sets are not supported with subprocess.
  • Subprocess can not be shared between multiple composites. But you can use the soa template to shared across the multiple composite.
  • Monitor view is not supported from inside the subprocess.

Oracle SOA 12c provides support for two types of resuable subprocesses.

Standalone BPEL Subprocess:

Standalone bpel process defined in a file with extension .sbpel (subprocess bpel extension). This process is out side the parent bpel process as shown in the figure below:

Here in the subprocess you can use any activities that is use in the bpel and you can use the subprocess by connecting through dotted wire with the parent bpel process. In figure above two sub process AlertNotificationProcess and LogsProcess are wired with Error bpel process.

See this post How to create standalone process.

Inline BPEL Subprocess

Inline subprocess are defined inside the parent bpel process that means we can't call the subprocess outside the parent bpel process. This subprocess may be useful in the situation where same activity happens at multiple times in single bpel process e.g.

  • Status updating in database or calling external webservice at multiple times in process at various levels.
  • logging of message at multiple times in a process.
  • Validation of message in a process.
see the figure below:

you can see the inline process under the components tab, here the log scope has been converted into subprocess. Here the log scope is converted into in line subprocess.


Note:  Always remember only the scope activity can be converted into inline subprocess.