How to rename BPEL in Jdeveloper 12c — oracle-tech

    Forum Stats

  • 3,701,031 Users
  • 2,239,263 Discussions
  • 7,834,978 Comments

Discussions

How to rename BPEL in Jdeveloper 12c

Hi All,

This post is to provide solution to How to rename BPEL in Jdeveloper 12c

Thanks @Krishna Hanumantharao for the suggestion.

To rename BPEL in Jdeveloper 12c, I have used the custom ant script, which has to be accessed from Jdeveloper 12c as an external tool.

Steps are provided below on how to configure the script and use it to rename BPEL.

In build.xml, the following are defined, which are to be set in Jdeveloper 12c external tools properties.

PROJECT_DIR: This will be Project Work directory path

FILE_DIR: This will be BPEL file directory path

FILENAME_NO_EXT: Old BPEL Process Name without extension

NEW_FILENAME: New BPEL Process Name without extension

This is the Custom Ant script build.xml that serves the purpose:

<?xml version="1.0" encoding="UTF-8" ?>

<project default="RenameBPELProcessInJDeveloper12c">

    <target name="RenameBPEL">

        <echo>Workdir: ${PROJECT_DIR}</echo>

        <echo>Filedir: ${FILE_DIR}</echo>

           

            <pathconvert property="oldname">

            <path path="${FILENAME_NO_EXT}"/>

            <chainedmapper>

            <flattenmapper/>

            <scriptmapper language="javascript">

            self.addMappedName(source.toLowerCase());

            </scriptmapper>

            </chainedmapper>

            </pathconvert>

            <echo>${oldname}</echo>

           

            <pathconvert property="newname">

            <path path="${NEW_FILENAME}"/>

            <chainedmapper>

            <flattenmapper/>

            <scriptmapper language="javascript">

            self.addMappedName(source.toLowerCase());

            </scriptmapper>

            </chainedmapper>

            </pathconvert>

            <echo>${newname}</echo>

           

<!-- Composite.xml --> 

            <echo>--composite.xml--</echo>

        <echo>Replacing ${FILENAME_NO_EXT} with ${NEW_FILENAME} in ${PROJECT_DIR}\SOA\composite.xml</echo>

            <replace file="${PROJECT_DIR}\SOA\composite.xml">              

            <replacefilter token="${FILENAME_NO_EXT}" value="${NEW_FILENAME}"/>

            <replacefilter token="${oldname}_client" value="${newname}_client"/>

        </replace>

            <echo>Replace in composite.xml - Complete</echo>           

           

<!-- In Bpel file and Name of Bpel file -->

<echo>--.bpel--</echo>

<echo>Replacing ${FILENAME_NO_EXT} with ${NEW_FILENAME} in ${FILE_DIR}\${FILENAME_NO_EXT}.bpel</echo>

  <replace file="${FILE_DIR}\${FILENAME_NO_EXT}.bpel">

      <replacefilter token="${FILENAME_NO_EXT}" value="${NEW_FILENAME}"/>

      <replacefilter token="${oldname}_client" value="${newname}_client"/>

  </replace>

           

<echo>Replace in ${FILENAME_NO_EXT}.bpel - Complete</echo>    

<echo>Renaming ${FILE_DIR}\${FILENAME_NO_EXT} -> ${FILE_DIR}\${NEW_FILENAME} in ${FILE_DIR}</echo>

   <move todir="${FILE_DIR}">

       <fileset dir="${FILE_DIR}"/>     

       <mapper type="glob" from="${FILENAME_NO_EXT}*" to="${NEW_FILENAME}*"/>

   </move> 

<echo>Rename of ${FILENAME_NO_EXT}.bpel to ${NEW_FILENAME}.bpel - Complete</echo>

           

<!-- In .xsd and name of schema -->

<echo>--.xsd--</echo>

<echo>Replacing ${FILENAME_NO_EXT} with ${NEW_FILENAME} in ${PROJECT_DIR}\SOA\Schemas\${FILENAME_NO_EXT}.xsd</echo>

<replace file="${PROJECT_DIR}\SOA\Schemas\${FILENAME_NO_EXT}.xsd">

       <replacefilter token="${FILENAME_NO_EXT}" value="${NEW_FILENAME}"/>

</replace>

           

<echo>Replace in ${FILENAME_NO_EXT}.xsd - Complete</echo>

           

<echo>Renaming ${PROJECT_DIR}\SOA\Schemas\${FILENAME_NO_EXT} -> ${PROJECT_DIR}\SOA\Schemas\${NEW_FILENAME} in ${PROJECT_DIR}\SOA\Schemas</echo>

   <move todir="${PROJECT_DIR}\SOA\Schemas">

       <fileset dir="${PROJECT_DIR}\SOA\Schemas"/>

       <mapper type="glob" from="${FILENAME_NO_EXT}*" to="${NEW_FILENAME}*"/>

   </move>

<echo>Rename of ${FILENAME_NO_EXT}.xsd to ${NEW_FILENAME}.xsd - Complete</echo>

           

<!-- In .wsdl and name of wsdl -->

<echo>--.wsdl--</echo>

<echo>Replacing ${FILENAME_NO_EXT} with ${NEW_FILENAME} in ${PROJECT_DIR}\SOA\WSDLs\${FILENAME_NO_EXT}.wsdl</echo>

  <replace file="${PROJECT_DIR}\SOA\WSDLs\${FILENAME_NO_EXT}.wsdl">

      <replacefilter token="${FILENAME_NO_EXT}" value="${NEW_FILENAME}"/>

  </replace>

           

<echo>Replace in ${FILENAME_NO_EXT}.wsdl - Complete</echo>

           

<echo>Renaming ${PROJECT_DIR}\SOA\WSDLs\${FILENAME_NO_EXT} -> ${PROJECT_DIR}\SOA\WSDLs\${NEW_FILENAME} in ${PROJECT_DIR}\SOA\WSDLs</echo>

   <move todir="${PROJECT_DIR}\SOA\WSDLs">

       <fileset dir="${PROJECT_DIR}\SOA\WSDLs"/>               

       <mapper type="glob" from="${FILENAME_NO_EXT}*" to="${NEW_FILENAME}*"/>

   </move>

<echo>Rename of ${FILENAME_NO_EXT}.wsdl to ${NEW_FILENAME}.wsdl - Complete</echo>  

      

     </target>

</project>

Save this script as build.xml in your desired location.

The build.xml customs ant script must be accessed from Jdeveloper 12c as an “External Tool”.

Steps to access build.xml from Jdeveloper:

1.      1. Go to Tools and then select External Tools

pastedImage_3.png

2.      External Tools windows pops up. Click on New.

pastedImage_14.png

3. Create External Tool window appears.

From Tool Type drop down, select Apache Ant, and click Next.

pastedImage_15.png

4. Select the saved build.xml file and click Next

pastedImage_134.png

2.      5. Move RenameBPEL target from Available Targets to Selected Targets and Click Next

pastedImage_133.png

pastedImage_132.png

6. To specify the properties, we need to add

pastedImage_127.png

pastedImage_126.png

Click on Insert. Insert Macro window appears. We need to select the required one from list of macros for the properties we defined in ant script and click OK.

pastedImage_116.png

pastedImage_115.png

pastedImage_114.png

pastedImage_113.png

pastedImage_105.png                        

Property

Value

PROJECT_DIR

Project Directory

FILE_DIR

File Directory

FILENAME_NO_EXT

File Name Without Extension

NEW_FILENAME

Prompt

4.     7. In Options Page, no changes required. Click Next.

pastedImage_102.png

5.     8. In Process Page, no changes required. Click Next.

pastedImage_98.png

6.     9.  In Classpath Page, no changes required. Click Next.

pastedImage_85.png

10. In Display Page, under Caption for Menu Items, give Rename BPEL Process and we can use the default icon. Click Next

pastedImage_82.png

8.      11. Check the boxes as highlighted and click Next.

pastedImage_69.png

12. Select ‘When Specific File Types are Selected’ and move ‘BPEL Process’ from Available Types to Selected Types and Click Finish.

pastedImage_58.png

<span style="font-size: 9.0pt; font-family: 'Arial',san

Tagged:
vladodias

Comments

Sign In or Register to comment.