OSB Configuration files allow the developer to manage environment specific values during deployment. FlexDeploy supports the use of these configuration files and extends them to using tokens in the configuration file that will get replaced with configured properties from FlexDeploy. This way we do not need to generate a customization file for every environment where we are going to deploy the project. We can have one configuration file that will work across environments.
My example is built using JDeveloper and SOA 12.2.1. I have an OSB project named ValidatePayment that is acting as a proxy service for a SOA service:
The ValidateBS when I run locally, refers to localhost:
When I deploy this to our shared development environment, I want to replace http://localhost.flexagon:7001/ with http://soalt05.flexagon:7001/. When I deploy to production, I want the URL to be http://soa.flexagon.com/. To accomplish this I add a property to my OSB Deploy workflow in FlexDeploy. First, I will show the full workflow for the OSB deploy. Since FlexDeploy has smart plugins, the deploy workflow is a simple 1 step process to import the OSB project:
By using FlexDeploy, organizations establish an automated and repeatable process for building, packaging, and safely deploying code, APIs, meta-data changes, and data migrations from development through test to production environments.
Now I add the property on the main tab of the workflow:
I made it an Environment Instance property so I configure it once for each environment (dev, prod) and not once for every project. Now, I will set the property on the property environment/instance page for Dev, then similarly for Prod:
FlexDeploy will scan the OSB configuration file and will look for any tokens with the format ${{….}} and replace it with the value of the configured property from FlexDeploy. So, I adjust the configuration file to reference the FlexDeploy workflow property we just created.
…
<xt:replace> <xt:envValueType>Service URI</xt:envValueType> <xt:location>0</xt:location> <xt:value xsi:type=”xs:string” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>${{SOASERVER_URL_PREFIX}}/soa-infra/services/default/ValidatePayment/ValidatePayment</xt:value> </xt:replace> … |
In my OSB project on FlexDeploy, I set the path to my OSB configuration file on the properties page. In this case, the customization file is located in my project. If it is external to the project you can either use a fully qualified path or relative path to the project. (Note: FlexDeploy also supports configuration files that have environment in the name such as ValidatePayment_CustomizationFileDEV.xml)
Now we deploy the project to soalt05:
Finally, we check the deployed service in the sbconsole to see that the URL change was made after deployment:
In summary, using the token replacement can reduce the complexity of setting up your OSB configuration files.