When your bpel.xml seems to change by magic

Maybe you have experienced the same curiosity as I did after changing the bpel.xml file in JDeveloper and clicking “Deploy”. Somehow the file got reverted to its original state. Meaning all the changes I had made were lost, even though I had saved the file before pushing the button.

I took some research until I found that this seems to be a known issue with JDeveloper. The trick is to first close all BPEL diagram files. JDeveloper is caching the content of the bpel.xml file if any BPEL diagrams are open. When you close the BPEL files the cached memory including the bpel.xml is released and the changed file is use in the next build.