Renaming a Package and Folders

Is there a set procedure for renaming a package and or folders?

Chris

I wish webMethods implement something similar to moving individual flow/java services, to folder/package level ??

We here run unix sheel scripts (using find,grep,sed and/or awk) to move folders / packages , but it is not generic enough. Works quite well in our case :wink:

Regards,
Saurabh

Saurabh,

Could you list the high level steps that you take to accomplish this.
Do you unzip the package to a different drive and then do your search and replace or do you just do it directly in the directory after backing it up.

Thanks.

chris

Chris, can you elaborate on what you are trying to do? Thanks.

Sorry for the delayed response Chris.

as I said earlier, a lot depends on your specific requirements, but still…

say, i need to move a folder full of records cross-referencing each other…
old folder path : of1.of2.of3
all records/node.ndf files exist below of3 dir.

new folder path : nf1.nf2

hence all the node.ndf files will be under of3 directory. copy contents of of3 dir into new dir nf2. replace all occurances of of1.of2.of3 with nf1.nf2.

find . -name node.ndf -exec replace.sh {} ;
where replace.sh runs a simple sed cmd to replace currentstr to newstr
//sample replace.sh
sed -e “s/$old_pattern/$new_pattern/g” $file_name > $file_tmp
mv $file_tmp $file_name

bingo!! its done… as you see, its lot of manual work too… BUT, this has lots of exceptions… today only i ran something like this in our dev env… it worked well for our requirements… may or may not work for your specific requirement…

so please let us know, what exactly you are trying to do…

As long as, you clear what goes where ( i mean, if you change some reference how it effects physical files - node.ndf/ node.idf/ *.java/ flow.xml ) then i think you may be able to make judicious decisions when this approach will work for you and when it wont…

in general, for me until now, i was always able to somehow or other overcome limitations set by webMethods software in this regards…

BTW, i have included this wish in the wishlist forum on advantage site.

Hope the above was of help to you. The post was written in quite a hurry [may contain errors ]

Regards,
Saurabh

Saurab,

Thanks.

I have a package that I need to rename. I may also need to rename some of the folders. I know I need to do a search and replace on the files under the package tree.
What I’m looking for is the correct sequence of steps.
ie. do I create the new pkg first, copy the files from the old pkg to new pkg and then do my search n replace. Do I have to bring the server down when I do this.
That sort of thing.

Chris

Hi, Chris. I am going to assume that you have a package of Flows, Java services, and Records that you want to move into a new package. I am also going to assume that you do not have JARs or other custom Java source code dropped into your \code folder.

The solution I offer here will allow you to move Flow around and maintain the references made to your components from within other packages.

webMethods Developer can manage the task of moving your Flow around from package to package. Create a new package and create a first-level folder with the same name of the new package. Then, you can begin re-creating your folder structure beneath the top-level folder.

Once you have built your folder structure, you can begin moving things using click-and-drag. After every move, the Developer will present you with this dialog box:

"path.to.your:Flow is being used in following places. Please use “Update” to just rename it or use “Update All” to update all the references "

Choose “Update All”. This will force all Flow referencing the component that you are moving to update its reference to the new location. You can confirm this in the “service” text of the “Properties” tab.

If you choose “Update”, the references will not be updated.

That’s it, really. The only place where you’ll run into a potential problem is if you are moving Java servcies. Be sure to copy over the data in the “Shared” tab which includes imports and any shared code for that folder-level.

If this is a simple package, the tips above will suffice. If you are moving mountains, reference back to Saurahb.

Good luck.

Dan,

I’ve tried that but what happens when I drag the item is that wm creates the target interface.folder in the current package and drops the item there.

Strange.

Chris

From the sound of your description, the top-level folder in both of your packages is identical.

I will always create my top-level folder with the same name as the package it’s in. This not only makes it easier to find my (deeply) buried services but also to eliminate issues moving between packages like you are experiencing.

You could probably create a temporary folder somewhere to put all of your components into. After moving them all, delete the original package and then create a new one with the same folders/sub-folders.

You will then be able to move your components to the new package without Developer confusing the target namespaces.

Chris,
for just renaming a package - pls rename the package name at the file system level. no search or replace required. Remember, package name is not referenced in fully qualified name of flow services…

to rename a folder, pls follow the mentioned approach in the last post.

please bring the server down before renaming the package. for rename of folder, its optional. but in that case, you may have to reload the package/refresh developer.

as i have said earlier, the solution may work for your specific case. Please provide more details on what exactly you trying to do. It will help us understand your specific requirement.

also, i will suggest you take a backup just in case…

Regards,
Saurabh.

PS: renaming of pkg doesnt imply renaming the top level folder

Chris : You said in this thread:

> I’ve tried that but what happens when I drag the item is that wm creates > the target interface.folder in the current package and drops the item there.

Just wanted to say that I’ve experience the same problem - you’re not seeing things WM does create a folder in the wrong package sometimes. It looks like a bug.