Wednesday, December 18, 2013

Renaming SOA Composite Name Bpel Process

Renaming BPEL Process Names, Composite Name


One of the biggest challenge developers of Oracle fusion solutions face is changing the bpel process name or entirely the composite name. The way it gets displayed in the enterprise manager. I have come up with some steps getting information from oracle blogs and including my work around . I have used this process several times and did not see any issues.


There are series of steps to be followed to achieve the same.

1) Renaming BPEL Process Names (below Article by Sebastian Krueger)

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 ProcessIcon Location: (Browse to renameBpelIcon.gif)Click Next.
  13. Integration Page:Add Items to Menus: Tools MenuNavigator Context MenuAdd Buttons to Toolbars:Main ToolbarBefore Tool Starts:Save AllAfter Tool Exits:Reload Open File:Log Output to Messages LogClick Next
  14. Availability Page:Select: When Specific File Types are SelectedMove 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.


2.  In case you want to change the name of HelloWorld to HelloOracle.

First thing is using the above approach change the Bpel process name to HelloOracle


After the build it should look like this.



At times until you refresh you wont find the changed name.


Click on the refresh button.

 



Download the FNR ,

Close the Jdeveloper. Copy the project folder path .



Now open the program FNR you downloaded.


After you replace go to the project folder of the project.



After you change the folder name, change the .jpr file inside the folder in case it exists.


Now open the jdeveloper and open the .jpr file .








No comments:

Post a Comment