Sunday May 20, 2012

Renaming BPEL Process Names

A common problem is that developers don't get the BPEL process name right the first time. There have been a number of solutions proposed on the Internet which range from 'you just can't do it' to complicated Linux 'one-liners' which don't work on Windows.

Wouldn't it be nice to just have a "Rename BPEL Process" button in JDeveloper for SOA Suite 11g.

What we need is a script which will do the following:

  1. Run on any platform that JDeveloper supports (ie, Windows, Linux, and Mac).
  2. Rename the old filename to the new filename of the BPEL process.
  3. Updated any string references to the old BPEL name with the new BPEL name in any file that references the BPEL process.
  4. Easily accessible from JDeveloper (ie, no complicated command line wizardry).

JDeveloper has an option to call an "External Tool" which can also be a custom Ant script. This "External Tool" can be called from the toolbar of JDeveloper, including the context menu of the Application Navigator View.

Here is a build.xml Ant script which takes care of the above requirements.

<?xml version="1.0" encoding="UTF-8" ?>
<project default="RenameBPELProcessInJDeveloper11gR1">
    <target name="RenameBPEL">
        <echo>Workdir: ${PROJECT_DIR}</echo>
        <echo>String replacement: ${FILENAME_NO_EXT} -> ${NEW_FILENAME}</echo>
        <replace dir="${PROJECT_DIR}" token="${FILENAME_NO_EXT}" value="${NEW_FILENAME}">
            <exclude name="**/.svn*"/>
        </replace>
        <echo>complete...</echo>
        <echo>Renaming ${FILENAME_NO_EXT} -> ${NEW_FILENAME} in ${PROJECT_DIR}</echo>
        <move todir="${PROJECT_DIR}">
            <fileset dir="${PROJECT_DIR}">
                <exclude name=".svn*"/>
            </fileset>
            <mapper type="glob" from="${FILENAME_NO_EXT}*" to="${NEW_FILENAME}*"/>
        </move>
        <echo>Renaming ${FILENAME_NO_EXT} -> ${NEW_FILENAME} in ${PROJECT_DIR}/xsd</echo>
        <move todir="${PROJECT_DIR}/xsd">
            <fileset dir="${PROJECT_DIR}/xsd">
                <exclude name=".svn*"/>
            </fileset>
            <mapper type="glob" from="${FILENAME_NO_EXT}*" to="${NEW_FILENAME}*"/>
        </move>
        <echo>Renaming ${FILENAME_NO_EXT} -> ${NEW_FILENAME} in ${PROJECT_DIR}/xsl</echo>
        <move todir="${PROJECT_DIR}/xsl">
            <fileset dir="${PROJECT_DIR}/xsd">
                <exclude name=".svn*"/>
            </fileset>
            <mapper type="glob" from="${FILENAME_NO_EXT}*" to="${NEW_FILENAME}*"/>
        </move>
        <echo>complete...</echo>
     </target>
</project>

Save this script to a file called build.xml and store it in a folder called RenameBPELAntScript.

We will also need an icon for the "External Tool" button in the JDeveloper Toolbar. For example this one: 
Right-click and "Save Image As...". 

Next follow these steps:

  1. Tools -> External Tools...
  2. New
  3. Tool Type: Apache Ant
  4. Ant Build File: (Browse to build.xml file)
  5. Move RenameBPEL target from Available Targets to Selected Targets.
  6. Add Property -> Insert -> File Directory | Property Name: PROJECT_DIR
  7. Add Property -> Insert -> File Name Without Extension | Property Name: FILENAME_NO_EXT
  8. Add Property -> Insert -> Prompt | Property Name: NEW_FILENAME
  9. Options Page, no changes required. Click Next.
  10. Process Page, no changes required. Click Next.
  11. Classpath Page, no changes required. Click Next.
  12. Display Page: 
    Caption for Menu Items: Rename BPEL Process
    Icon Location: (Browse to renameBpelIcon.gif)
    Click Next.
  13. Integration Page:
    Add Items to Menus: 
    Tools Menu
    Navigator Context Menu
    Add Buttons to Toolbars:
    Main Toolbar
    Before Tool Starts:
    Save All
    After Tool Exits:
    Reload Open File:
    Log Output to Messages Log
    Click Next
  14. Availability Page:
    Select: When Specific File Types are Selected
    Move BPEL Process from Available Types to Selected Types
  15. Click Finish
  16. Click OK

So what does the result look like?

Select a BPEL process in the Application Navigator of JDeveloper. Now you have two options for invoking the Rename BPEL process 'External Tool'.

As shown below, you can press the new icon in the toolbar. 

Alternatively you can select from the context menu. 

The complete process should look something like this: 

Notice that the original filename was foo.bpel and we have renamed it to bar.bpel.

If you are using Oracle Suite for 11g, then the above solution will solve your BPEL process rename issue. This same features is already on the roadmap for 12c.

Tuesday May 15, 2012

Upgrading Database Schema in FMW Upgrade

During a FMW upgrade one of the most common tasks forgotten is the upgrade of the database schemas as the steps seem to be berried in a mountain of documentation. If you are looking for the actual steps to upgrade FMW look at the following post - Upgrading Fusion Middleware 11.1.1.x to 11.1.1.4 when you get to step 24 refer to this blog entry.

Oracle has made it a bit simpler running the Patch Set Assistant (psa). Before it was a bit of a dark art running a command line script and you had to guess what schemas need to be upgraded. Now there is a wizard driven tool to implement this.

  1. As the middleware owner change directory to $MW_HOME/oracle_common/bin
  2. Run the following command to start the PSA wizard
    ./psa



    Click Next to start entering details

  3. Select the component you want to upgrade, it will include all the prerequisites.



  4. Select the prerequisite check boxes to say you have backed up your environment.



  5. Enter connection details for the MDS schema



  6. Enter connection details for the SOAINFRA schema



  7. Check that all schemas connect successfully. If not go back and correct.



  8. Make sure all the setting are correct and continue



  9. Watch the install run, then complete



  10. Now you can check the version of the schemas to ensure they are correct. In this case I'm looking to have the version come back as 11.1.1.6

    SELECT owner, version, status FROM schema_version_registry
    where owner in ('DEV_MDS', 'DEV_SOAINFRA');


    OWNER                          VERSION                        STATUS
    ------------------------------ ------------------------------ -----------
    DEV_MDS                        11.1.1.6.0                     VALID
    DEV_SOAINFRA                   11.1.1.6.0                     VALID


Monday May 14, 2012

Finding the Right Patchset

I'm always surprised at how hard it is to find the right patchsets when looking to do an upgrade.

So I thought I would make a blog entry that makes it easy to find the right patches starting from 11.1.1.4. The following list are documents that provide the required patches for the associated upgrades:

11.1.1.4
11.1.1.5
11.1.1.6
11.1.1.7

I will update as more patchsets become available.

If you are looking for patch install instructions please refer to the following blog entry:

Upgrading Fusion Middleware

Happy upgrades


About

Discussions and Examples using Oracle Fusion Middleware. Some image links are broken when using Firefox, Safari, and Chrome. If you want to see the full image please use IE.

Twitter:@james8001

tumblr hit counter vistors, thanks for your support

Search

Archives
« April 2012 »
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
16
17
18
19
21
22
23
24
25
26
27
28
29
30
31
  
       
Today