There seems to be a multitude of pages advertising how to use the configuration plan functionality in SOA Composites, but none of them (including the oracle documentation) seem to make much sense. Some of the things you can do with a config plan are fairly obvious (like altering a directory name for a File/FTP Adapter) as the Jdeveloper Wizard prompts you for the variable names on the way through.
Recently I was trying to make it easy to change the target email address for notifications coming from a BPEL process. Sounds easy enough but took a while to find the easy way to do it.
Open the source tab of the composite.xml file and search for the <component> that matches the BPEL you need the variable in. Add a new property similar to the one below:
<component name="MyTestBPEL" version="2.0"> <implementation.bpel src="MyTestBPEL.bpel"/>... <property name="bpel.preference.targetEmail" type="xs:string" many="false">admin@company.com</property> </component>The value (admin@company.com) here becomes the default value if no configuration plan is applied during the deployment of the jar.
Below I'm using the property value in an assign statement to assign the email address into the "Email To" attribute of an Email component.
<copy> <from>ora:getPreference('targetEmail')</from> <to>$varNotificationReq.EmailPayload/ns11:To</to> </copy>Right click on the composite.xml file and choose Generate Config Plan. This will create a configuration plan with a spot to provide a custom value for this property.
Using the example configuration plan below, the default email address provided in the composite.xml (admin@company.com) will be replaced in MyTestBPEL with the dev@company.com. This way when deploying to production, no configuration plan is required. When working on it in development, the developer can supply the configuration plan and ensure messages go to them.
<component name="MyTestBPEL">... <property name="bpel.preference.targetEmail"> <replace>dev@company.com</replace> </property> </component>