Friday, 27 March 2015

New Feature in SOA 12C Creating SOA Temaple

Hi All,

Hope you all doing good with SOA.

Today I am going to share How to creating soa template and I feel It would be highly productive and desirable to be able to easily create templates for service designs that could be reused across teams and projects. Using quality designs and tested patterns as the starting point for new services speeds up development while also supporting widespread adoption of quality and standards in service design.

SOA Suite 12c automates creation and management of templates of service composites, as well as individual service components. The service project templates we create will be stored and managed in the file-based MDS, so they can easily be shared with other developers.
We have an existing service composite that we would like to clone or use as the basis of new service composite. Once we create the new service based on the template, we’ll be able to make modifications to it as needed.




Here is the current Service: 

pic1
The service exposes a web service entry point, OrderStatus whose interface is implemented by convertWS mediator. ConvertWS transforms the incoming message as needed and routes the message to be processed by GetStatus, a Business Process Execution Logic (BPEL)-based component. The BPEL process accesses the database through the database adapter, OrderDB, to check order status and then writes the status to a flat file via the file adapter, writeQA.



We’d like to start with this service and then create a new, separate project and service that will have the same starting structure. Then we can make modifications to suit our particular needs.

We begin by creating the service composite template from the existing project.

Create or find a SOA Suite 12c Service Composite to use as the basis for the template and open it in JDeveloper 12c.


    pic2

  1. Right-click the project or composite name and select Create SOA Template.

  2. pic3

  3. Click the Save In icon to select the location for storing the template: in the file system or file-based MDS for reuse. We are using the file-based MDS to enable easier sharing and reuse and use a single repository for storing assets.

  4. pic4

  5. Select which parts of the service project to include in the template. You can choose to not add certain components or assets to the template.

  6. pic5

  7. Save the template.

    Now that the template is created, we can reuse it here in our application, or share it as a jar file or since we checked it into the file-based MDS, then we can share it with other developers who have access to the MDS.

To create a new service composite based on the template:

  1. Create a new SOA Project.

  2. pic6

  3. Select a name for the project.


  4. Select the SOA Template radio button and then select the template form the list.

  5. pic7

  6. The new project is created based on the template.

  7. pic8
You can now edit the new project as you see fit.

The ability to create reusable templates is included with components: you can create a mediator or BPEL process and save that as a template for reuse. The process is similar to creating a template for a service composite.
  1. Right-click on the component to use as the basis for the template.

  2. pic9

  3. Select Create Component template, and choose where to save it.


  4. pic10

  5. Choose which files to bundle with the template and Finish.
  6. pic11
    Once the component template is created, you can view it in the Component Window.
    pic12
    To use the component template:
  1. Drag and drop the template onto your service component editor.

  2. pic13

  3. Choose the name for the component and which files to include from the template.

  4. pic14

  5. If there are conflicts with existing files, use the wizard to resolve them as needed and Finish.
  6. pic15
    When finished, you have a new component with the same configuration as the template added to your service composite. You can now edit the new component as needed.
    pic16

In this blog we saw the benefits of using templates to create new SOA service composites and components that can save you development time and increase quality in your Oracle SOA Suite 12c service designs. The templates created can be stored in a local file system or the file-based MDS for reuse.



Friday, 13 March 2015

12c SOA composite deployment using maven

Hi All,

Today I am going to share How we can deploy soa composite using Maven in 12c.Maven is newly introduces with Soa in 12c and this blogs might helps you get to know Soa maven little bit.

For getting started with deployment you need to Setup Environment for maven in you local Enviorment.

I am not sure if I am missing anything here. Please suggest.

inti.cmd:

SET JAVA_HOME=D:\12c-Installation-Path\Java\jdk1.7.0_60
SET ANT_HOME=D:\12c-Installation-Path\Oracle\Middleware\Oracle_Home\oracle_common\modules\org.apache.ant_1.9.2
SET M2_HOME=D:\12c-Installation- 
(I would suggest for Maven please download Maven 3.2.5.zip from http://maven.apache.org/download.cgi)

Path\Oracle\Middleware\Oracle_Home\oracle_common\modules\org.apache.maven_3.0.5
SET PATH=%PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin;%ANT_HOME%\bin

After Setting up above properties in Enviorment Just open then cmd prompt run as adminstrator and 

#mvn -version

get confrontation maven class-path set and working fine. 

Next step is to populate all the maven repositories

cd  .../oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.3

install the maven sync plugin to the local repository

mvn install:install-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-sync-12.1.3.jar -DoracleHome=/Users/edwin/Oracle/JDevMiddleware12.1.3

Deploy all the libraries to the local mvn repository

mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=/Users/edwin/Oracle/JDevMiddleware12.1.3

update your local archetype catalog

mvn archetype:crawl -Dcatalog=$HOME/.m2/archetype-catalog.xml

Next steps are, to do the same but then we will fill the Nexus repository

Deploy the maven sync plugin to the nexus maven repository and we need to configure the maven settings.xml(its optional upto you).

mvn deploy:deploy-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-sync-12.1.3.jar -Durl=http://localhost:8081/nexus/content/repositories/thirdparty -DrepositoryId=internal

and do a another sync

mvn com.oracle.maven:oracle-maven-sync:push

Once you Done with All setups and configuration.Lets start with Soa Composite Deployments.

1.Create Soa Application File>NewApp>..
2.Create Project.
Finish

Open the Structure you will notice that there is Two Pom.xml one is at Applicatoin Level and other one is at project Level.In jdev You can See project pom under Resource folder and Application one under ApplicationRsources > Build

If you open the pom you will notice Structure

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- The Basics -->
  <groupId>...</groupId>
  <artifactId>...</artifactId>
  <version>...</version>
  <packaging>...</packaging>
  <dependencies>...</dependencies>
  <parent>...</parent>
  <dependencyManagement>...</dependencyManagement>
  <modules>...</modules>
  <properties>...</properties>

  <!-- Build Settings -->
  <build>...</build>
  <reporting>...</reporting>

  <!-- More Project Information -->
  <name>...</name>
  <description>...</description>
  <url>...</url>I 
  <organization>...</organization>
  <developers>...</developers>
  <contributors>...</contributors>

  <!-- Environment Settings -->
  <issueManagement>...</issueManagement>
  <ciManagement>...</ciManagement>
  <mailingLists>...</mailingLists>
  <scm>...</scm>
  <prerequisites>...</prerequisites>
  <repositories>...</repositories>
  <pluginRepositories>...</pluginRepositories>
  <distributionManagement>...</distributionManagement>
  <profiles>...</profiles>
</project>



I will just Discuss Bisics about Pom in this Blog.

The Basics

The POM contains all necessary information about a project, as well as configurations of plugins to be used during the build process. It is, effectively, the declarative manifestation of the "who", "what", and "where", while the build lifecycle is the "when" and "how". That is not to say that the POM cannot affect the flow of the lifecycle - it can. For example, by configuring the maven-antrun-plugin, one can effectively embed ant tasks inside of the POM. It is ultimately a declaration, however. Where as a build.xml tells ant precisely what to do when it is run (procedural), a POM states its configuration (declarative). If some external force causes the lifecycle to skip the ant plugin execution, it will not stop the plugins that are executed from doing their magic. This is unlike a build.xml file, where tasks are almost always dependant on the lines executed before it.
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.codehaus.mojo</groupId>
  <artifactId>my-project</artifactId>
  <version>1.0</version> 
</project> 


Maven Hierarchy  .
root
|-- parent-pom
|   |-- branches
|   |-- tags
|   `-- trunk
|       `-- pom.xml
`-- projectA
    |-- branches
    |-- tags
    `-- trunk
        |-- module1
        |   `-- pom.xml
        |-- moduleN
        |   `-- pom.xml
        `-- pom.xml


Lets come Back And See how you can find you Poms's in :-


Jdev generate you pom.xml so its to easy no need to get more worried you just need to difene your properties.under property tag.


Open you project Pom.and Define you serverUrl and user Name etc. 

<properties>
        <!-- These parameters are used by the compile goal -->
        <scac.input.dir>${project.basedir}\SOA/</scac.input.dir>
        <scac.output.dir>${project.basedir}/target</scac.output.dir>
        <scac.input>${scac.input.dir}/composite.xml</scac.input>
        <scac.output>${scac.output.dir}/out.xml</scac.output>
        <scac.error>${scac.output.dir}/error.txt</scac.error>
        <scac.displayLevel>1</scac.displayLevel>
        <!-- if you are using a config plan, uncomment the following line and update to point
             to your config plan -->
        <!--<configplan>${scac.input.dir}/configplan.xml</configplan>-->
     
        <!-- These parameters are used by the deploy and undeploy goals -->
        <composite.name>${project.artifactId}</composite.name>
        <composite.revision>1.0</composite.revision>
        <composite.partition>default</composite.partition>      
        <serverUrl>http://192.168.137.150:7003</serverUrl>      
        <user>weblogic</user>
        <password>Oracle123</password>
        <overwrite>true</overwrite>
        <forceDefault>flase</forceDefault>
        <regenerateRulebase>false</regenerateRulebase>
        <keepInstancesOnRedeploy>false</keepInstancesOnRedeploy>
     
        <!-- These parameters are used by the test goal
         if you are using the sca-test (test) goal, you need to uncomment the following
             line and point it to your jndi.properties file. -->
           
        <!--<jndi.properties.input>UNDEFINED</jndi.properties.input>-->
        <scatest.result>${scac.output.dir}/testResult</scatest.result>
        <!--  input is the name of the composite to run test suties against -->
        <input>${project.artifactId}</input>
     
        <!--<scac.ant.buildfile>${env.MW_HOME}/soa/bin/ant-sca-compile.xml</scac.ant.buildfile>
        <sca.ant.testfile>${env.MW_HOME}/soa/bin/ant-sca-test.xml</sca.ant.testfile>
        -->
     
    </properties>



Now You can  Deploy you Composite:-





>Open cmd promt go to your application dir.

Run #
 mvn pre-integration-test

It will build and deploy you composite.

Hope you have happy deployment.