Monday, September 19, 2011

Solution Portability


Here's an additional option of making a solution easily portable/testable between QA, Dev, and Production environments.

When developing within the TDI Config Editor we want to make the most of the flexibility provided in Eclipse.  In this example we want to create a Property store for each environment which you'll be testing your Assemblyline against.

Here's an example of my Property Stores:



















-- Script References:
When referencing an property from a Property Store...reference the Property Name only.
Not the Property Store Name. With out declaring the Property Store Name, the TDI Server will pull the value from the Default Property Store.  Use setParam(string), not setParam(String,String) when referencing the property.
















-- 'Use Property' Reference:
When setting the value of a Connector's Field, there's many different ways to do this.
I believe the easiest approach is the 'Use Property' option.

When using the 'Use Property' option of a Field definition you'll see it automatically adds the Property Store Name to the Property Name.  This occurs when you select the property from your available properties.


By removing the Property Store Name (in the above example it would be 'Customer_Test:') the server will pull the Property Name from the Default Property Store.



-- Setting the Default Property Store
Now that we've set the solution to read the values from the Default Property Store, and not a particular Property Store we can easily and quickly redirect the direction of an AL just by selecting which Property Store we indicate as the Default Property Store.

To set the Default Property Store, just right click any of your Property Stores and select 'Default Property Store'.


On your next AL execution, the AL will read all it's property values from this particular Property Store.


-- Required Environment:



2 comments:

  1. how would you tell the AL to use a different default property store once it is moved to servers in Test/Prod?

    ReplyDelete
  2. Erik,
    When you move the Assemblyline to another Solution Directory or Machine, you don't have to tell it the Default property store(properties file).

    When the Assemblyline starts it will attempt to use the Default Property Store you last defined in the Configuration. However, if that's not found, it will progress through all known propertry stores of the Project until it finds a properties file which contains the key/value pair you're looking for. I found that the order of this processing is based on the order in which the Property Stores were created in your TDI Eclipse Project.

    After seeing your question, I ran a test to confirm this.

    As you'll see here 'QAEnv' is the Default, however since the Server isn't able to find it..it found the next properties file and found my key.

    2012-06-18 13:55:08,968 INFO [SolutionPortability] - CTGDIR103W The properties file 'QAEnv.properties' for was not found, and will be created if anything is written to it.
    2012-06-18 13:55:08,984 INFO [AssemblyLine.AssemblyLines/HelloWorld.1] - >> Username = Prod_User

    So you can either:
    1. Select the property store you want as Default Property Store, before you export the xml to your other Server.
    or
    2. When you move the xml to the other server, only move you're desired property file with it.

    ReplyDelete