Tuesday, February 22, 2011

Moving OSB project from Development to Production Environment

In this document i will discuss how we can move our project from one environment to other.I will take example of a very simple process.A simple File write operation which will write to a particular location in my local folder and then i will import the project in to other server with different location for file to be write.we will create customization file for the same Found in System Administrator of Sbconsole.


Ok lets create a business service for writing data in to particular location.
Log in to OSB console http://localhost:port/sbconsole

Create a session
No create a business service.











Save and activate the change now create a proxy service
























now choose the business service



Submit then save all and then activate the project.

Now test the proxy service with some random input




Now if you will go to the C:\output location in your machine you will see a file has been created.

It will have some random name as in my case it is 1650839931605045641-3be301d.12e56ff03c1.-7fd8
But if you will open the file you will get the content which you have passed
<?xml version="1.0" encoding="UTF-8"?>
<a>arpit rahi</a>

So now our basic setup is complete,Now we will try to migrate this project to other machine where in our output location in not C:/output but I C:/outgoing
Since I am using a single machine I will delete the existing project and reimport it which will essentially be the same what we wanted to achieve but before that we will create a configuration plan for process.
Log in to sb console.

Go to system administration
Create Customization file
And select the process for which you have to create configuration plan




Say create file and it will create a ALSBCustomizationFile.xml which will contain all the details of the existing process

Now check for following tags in the file

<cus:customization xsi:type="cus:FindAndReplaceCustomizationType">
<cus:description/>
<cus:query>
<xt:resourceTypes>ProxyService</xt:resourceTypes>
<xt:resourceTypes>BusinessService</xt:resourceTypes>
<xt:envValueTypes>Service Retry Iteration Interval</xt:envValueTypes>
<xt:envValueTypes>UDDI Auto Publish</xt:envValueTypes>
<xt:envValueTypes>Service URI Weight</xt:envValueTypes>
<xt:envValueTypes>Service Retry Count</xt:envValueTypes>
<xt:envValueTypes>Service URI</xt:envValueTypes>
<xt:refsToSearch xsi:type="xt:ResourceRefType">
<xt:type>ProxyService</xt:type>
<xt:path>default/Caller</xt:path>
</xt:refsToSearch>
<xt:refsToSearch xsi:type="xt:ResourceRefType">
<xt:type>BusinessService</xt:type>
<xt:path>default/FileWrite</xt:path>
</xt:refsToSearch>
<xt:includeOnlyModifiedResources>false</xt:includeOnlyModifiedResources>
<xt:searchString>Search String</xt:searchString>
<xt:isCompleteMatch>false</xt:isCompleteMatch>
</cus:query>
<cus:replacement>Replacement String</cus:replacement>
</cus:customization>

Now here you have to make the changes manually.
This is just an example and may not sound great to you but you can use this for your application which are much complex than this.

Here in our use case we will provide the current folder in search string and will provide the new folder in replacement string so it will look something like this.


<cus:customization xsi:type="cus:FindAndReplaceCustomizationType">
<cus:description/>
<cus:query>
<xt:resourceTypes>ProxyService</xt:resourceTypes>
<xt:resourceTypes>BusinessService</xt:resourceTypes>
<xt:envValueTypes>Service Retry Iteration Interval</xt:envValueTypes>
<xt:envValueTypes>UDDI Auto Publish</xt:envValueTypes>
<xt:envValueTypes>Service URI Weight</xt:envValueTypes>
<xt:envValueTypes>Service Retry Count</xt:envValueTypes>
<xt:envValueTypes>Service URI</xt:envValueTypes>
<xt:refsToSearch xsi:type="xt:ResourceRefType">
<xt:type>ProxyService</xt:type>
<xt:path>default/Caller</xt:path>
</xt:refsToSearch>
<xt:refsToSearch xsi:type="xt:ResourceRefType">
<xt:type>BusinessService</xt:type>
<xt:path>default/FileWrite</xt:path>
</xt:refsToSearch>
<xt:includeOnlyModifiedResources>false</xt:includeOnlyModifiedResources>
<xt:searchString>file:///C:/output</xt:searchString>
<xt:isCompleteMatch>false</xt:isCompleteMatch>
</cus:query>
<cus:replacement>file:///C:/outgoing</cus:replacement>
</cus:customization>



Now if you have a different environment then import it to new one or if you don’t have delete the existing project and try to reimport the project.

Once you have imported the project
Again go to System Administration
Execute Customization file and import the customization file that we have created as shown below






Verify if command is executed and activate your changes



now once you have made the changes now check you business process you will see that the enpoint location has now changed to the new value that you have provided in replacement string.If you will execute the process now it will now log file in the new folder location.

3 comments:

Anonymous said...

You are doing a nice job,keep doing the good work.

Anonymous said...

Cool STuff,nice work buddy

Anonymous said...

Well done!!!! nice explanation mf!!