Friday, 30 August 2013

Dynamically write information with File/FTP Adapter using BPEL

I came across this today on OTN Community Forum:

Basically this user wanted to dynamically create folders by using the File Adapter and was asking if BPEL could do it. After I tried it could not, but the following work around worked for me.


Create the different Year&Month folders on your destination from Jan to Dec:
201301
201302
201303
201304
201305
201306
201307
201308
201309
201310
201311
201312
(You can actually create as many as you want going to 2090 if you want... 

Add the below config to your JCA File:

<adapter-config name="FW" adapter="File Adapter" wsdlLocation="FW.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">

  <connection-factory location="eis/FileAdapter"/>
  <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
      <property name="PhysicalDirectory" value="C:\Archive"/>
      <property name="Append" value="false"/>
      <property name="FileNamingConvention" value="%yyyy.MM%\filename"/>
      <property name="NumberMessages" value="1"/>
    </interaction-spec>
  </endpoint-interaction>
</adapter-config>

This will allow the files to be dynamically created in the correct directories.


Thursday, 29 August 2013

SOA Environment domain creation in 13 Steps


Oracle SOA Domain creation


After you have installed Oracle SOA and Orascle OSB, you can now begin the process of creating a local WebLogic Domain

1.       Navigate you way to C:\Oracle\Middleware\Oracle_SOA\common\bin

2.       Double click the config.cmd file

3.       Select Create a new WebLogic Domain and click “Next”



4.       Select and tick the same as the below image:


Some option will be auto selected if you select some other options which are obviously dependencies 





5.       Give you domain an appropriate name 





6.       Add a username and password for your domain


7.       Add JDK – I have chosen JRocket


C:\Java\jrockit-jdk1.6.0_45-R28.2.7-4.1.0
  

8.       Tick all boxes and enter your local database details



9.       Select the tick box OSB JMS Reporting Provider and change the Vendor to Oracle  - It will fail otherwise




10.   Test your connection



11.   Select Admins Server – This is so you can name it.




12.   Give you server an appropriate name



13.    It will start creating the domain. After this has been completed, you can tick “Done”

Start you WebLogc and Managed Servers:
Navigate to C:\Oracle\Middleware\user_projects\domains\soa_domain\bin using command promt

Enter below commands

  • startWebLogic.cmd
  • startManagedWebLogic.cmd soa_server1
  • startManagedWebLogic.cmd osb_server1

Open your brower and view links:
http://localhost:7001/console/login/LoginForm.jsp
http://localhost:7001/em



Wednesday, 28 August 2013

Beginners Guide to setting up a Local Oracle SOA Environment Part 2



I spoke about some of the downloads from Oracle you’ll need to create your own local SOA Environment – So in this post I would like to give a little more detail on this and would essentially be an Install guide for you own VM or local machine.

Requirements:
- Windows 7 OS 64 Bit
- 8GB RAM as minimumHz machine
- 40 GB minimum to be safe
- CPU - I've used a Intel Core i3 2.4GHz to do the install

Below is a list of the downloads and their sizes:

·         OracleXE.exe  Size = 157 MB

·         ofm_rcu_win_11.1.1.7.0_32_disk1_1of1.zip Size = 324 MB

·         JDK6 and JRocket Size Combined Size= 181MB

·         wls1036_generic.jar Size = 1GB

·         ofm_osb_generic_11.1.1.7.0 Size= 1.11GB

·         ofm_soa_generic_11.1.1.7.0 zips Size = 2.8GB

So after you have successfully downloaded the software you can start with the Installation

Installation of Oracle JDK


·         Double click jdk-6u45-windows-x64.exe to launch installer

·         Change the JDK Installation directory to C:\Java\jdk*

·         You can accept the JRE destination folder and click “Next”

·         Click Finish to complete

·         It creates two files and the total amount of size is about 300MB

Installation of JRocket


·         Double Click jrockit-jdk1.6.0_45-R28.2.7-4.1.0-windows-x64.exe
·         Click “Next”
·         Change the default installation directory from “C:\Program Files\Java\jrockit-jdk1.6.0_24-R28.1.3-4.0.1” to C:\Java\ jrockit-jdk1.6.0_45-R28.2.7-4.1.0.
·         Check “Demos and Samples” and “Source code” and click “Next”.
·         Choose “Yes” to install JRockit as a public JRE and click “Next”.
·         Change the Public JRE installation directory from “C:\Program Files\Java\ jrockit-jdk1.6.0_45-R28.2.7-4.1.0” to “C:\Java\ jrockit-jdk1.6.0_45-R28.2.7-4.1.0” and click “Next”
·         Click “Done” to complete installation
·         Total Size is about 350MB

Oracle Database Installation


·         Click on the XE link Oracle.exe.
·         Click “Next”.
·         Choose “I accept the terms in this license agreement” and click “Next”
·         Leave the default install directory as “C:\oracle” and click “Next”
·         You will be prompted for the “SYSTEM” password for the Database - Enter an appropriate  password and ensure you remember it and click “Next”.
·         Click on “Install”. Click “Finish” to complete the installation.
·         Login to the XE console go to“Start - All Programs - Oracle Database 10g Express Edition - Go To Database Home Page”. Login using SYS and the password you specified.
·         In SQL command line enter the below. You can also Download SQL Developer and add the database in there.
It’s normally XE as the SID, localhost as Hostname and 1521 as the port

a.       alter system reset sessions scope=spfile sid='*';

b.      alter system set processes=200 scope=spfile;
·         Shutdown and then Restart the database

RCU

·         Extract ofm_rcu_win_11.1.1.7.0_32_disk1_1of1.zip to a Directory of your choice
·         In the extracted rcuHome navigate to the BIN folder and double click the rcu.bat to launch the utility – click “Next”
·         Leave the radio button on “create” and click “Next”
·         Enter your local database information:
 

·        You will get the following warning, but click “Ignore” twice then click “OK” to continue









·         Choose “SOA and BPM Infrastructure” and click “Next”. Ignore any warnings.
·         Enter. Keep the default option of “Use same password your password for all schemas”. Enter a password and click “Next”.
·         Click “Next” to continue. You will be given a warning about creating schemas that don’t already exist. Click “OK”.
·         The RCU will create the tables, click “OK” to continue
·         Click “Create” for the artifacts to be created within those schemas. Click “Close” to finish.

Weblogic Server





  • Copy wls1036_generic.jar to a directory on your machine like OacleSoftware or something
  • Open a command prompt (Start ->cmd) and navigate to the directory where you copied the JAR file
  • Type “java -D64 -jar wls1036_generic.jar” and enter to launch the Installer
  • Choose the option to “Create a new Middleware home” and set the “Middleware Home Directory” to “C:\Oracle\Middleware” and click “Next”
  • Uncheck the “I wish to receive Security updates via My Oracle Account”. You will be prompted to confirm if you are sure, click “Yes”. Click “Next” and you will further be prompted because you have not provided an email address. Click “Yes” to which you will be prompted again, click “Yes” and a “Connection failed” dialog should be displayed. Check the “I wish to remained uninformed …” and click “Continue”
  • Choose the “Typical Install” and click “Next”
  • Add both JDKs to Local JDK that you previously installed and click “Next”








    ·         Accept the defaults and click “Next”.
    ·         Choose “All Users” and click “Next”.
    ·         Click “Next” again to begin installation

    Oracle Service Bus



    · Create a directory like “C:\Eclipse” and copy oepe-helios-all-in-one-oepe-indigo-all-in-one-11.1.1.8.0.201110211138-win32-x86_64.zip to it. Then unzip the file there and then delete the zip file.
    · Unzip the file ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip into an OSB directory
    · Open Disk1 and double click “setup.exe”.
    · You will be prompted to enter a JDK/JRE location again and press "Enter"
    · Click “Next”
    · Choose “Skip Software Updates” and click “Next”.
    · Ensure that the Oracle Middleware Home is “C:\Oracle\Middleware” and click“Next”

    · Leave the default installation as “Typical” and click “Next”.
    · The Installer will do some Prerequisite Checks, after which, “Next” will be available for clicking which you will click.





    ·         A new screen will ask you for a OEPE location. You can ignore it if you want but OEPE is essentially an IDE which is integrated into Eclipse to do OSB Development. You can also use the OSB Console to create Services on OSB but I prefer using OEPE to do my developer
    ·         Click “Next” then “Finish” to complete the installation.


    Oracle SOA


    ·         Unzip the download SOA Zips into a SOA directory into a directory like SOA or something
    ·         Open Disk1 and double click “setup.exe”
    ·         You will be prompted to enter a JDK/JRE location on a command window.  Give your JDK directory and “Enter”
    ·         Click “Next” on the Installation GUI.
    ·         Choose “Skip Software Updates” and click “Next”
    ·        The Installer will do some Prerequisite Checks, after which, “Next” will be available for clicking which you will click.


    ·         You will be presented with the following screen. Ensure that the Oracle Middleware Home is “C:\Oracle\Middleware” and click “Next”.

    


    ·         Select “Next” and then “Install” to begin the installation.
    ·         Once the Installation is successful, click “Next” then click “Finish” to complete the installation.


    After the above you should have the following:
    > XE database installed
    > RCU that created schemas
    > WebLogic
    > SOA
    > OSB
    > OEPE if you're using it

    My next post will be around creating a domain
    After this you'll be able to start your Managed Servers and your Admin Console
    After that you can pretty much start with the fun stuff


















    Tuesday, 27 August 2013

    Beginners Guide to setting up a Local Oracle SOA Environment Part 1


    Beginners Guide to setting up a Local Oracle SOA Environment

    One of the things that I think one needs to understand first before creating your own local Oracle SOA environment is to understand the Architecture of how the components fits together and essentially what you create on your local machine will be a small representation of what a server environment would look like.

    The below was a good image I found on the Web:
     

    So as you can see what we need are the following components:

    ·         JDeveloper

    ·         Oracle SOA

    ·         Oracle Service Bus

    ·         WebLogic

    ·         BAM (Not required for now but nice to have)

    One of the things not mentioned in the above image is a database and SOA needs a Database because it’s a statefull application (Stateful means the computer or program keeps track of the state of interaction, usually by setting values in a storage field designated for that purpose), so one of the things you need is a preferably Oracle Database which you can download as well from Oracle. I normally use the XE database from Oracle for development purposes.

    The other thing missing is the JDK (Java Development Kit) and your JRE (Java Runtime Environment)


    So let us recap on what we need in order of Installation and dependency:

    ·         Oracle XE Database

    ·         JDK and JRE

    ·         Oracle JDeveloper

    ·         Oracle WebLogic

    ·         Oracle OSB

    ·         Oracle SOA

    ·         Oracle BAM

    Versioning

    When choosing your version, ensure that they are all compatible with each other. It is wise to look at release notes from Oracle and to also just browse a bit to check that everything is compatible with each-other before downloading and just installing random version of the Suite.

    So I have decided to use version 11.1.1.7 for my Oracle SOA Suite Installation and to get the installation files you can just go to www.oracle.com

    Oracle.com is a massive site and at first glance you can easily get confused and struggle to navigate your way around it so as a suggestion, try and understand the site and try getting a feel for it otherwise you can go straight to old faithful Google and search Oracle SOA Suite Downloads.

    So once you’re one the site, and on the downloads page you’ll see that you need to accept a license agreement to actually start downloading.

    My downloads are for Windows and 64Bit so my downloads will be around that specification:

    ·         Oracle XE for Windows

    ·         ofm_rcu_win_11.1.1.7.0_32_disk1_1of1 (for soa schema creation)

    ·         jdevstudio11117install.jar (Generic jar for other platforms as well)

    ·         jdk-6u45-windows-x64.exe

    ·         jrockit-jdk1.6.0_45-R28.2.7-4.1.0-windows-x64.exe

    ·         wls1036_generic.jar

    ·         ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip

    ·         ofm_soa_generic_11.1.1.7.0_disk1_1of1.zip

    ·         ofm_soa_generic_11.1.1.7.0_disk1_1of2.zip

    So the above is what you need to setup a local 11.1.1.7 Oracle SOA Environment to start with.