Variables between environments

Variables between environments

  
Looking for a bit of advice.  In our espace, we store a link to an internal API we use to exchange data with another application.  Now, while we're developing, we're pointing to a test copy of the API but when we move to a live environment, we will want to point to the live copy of the API.  Is there a good/easy way to manage values (either through a static entity, or a sort of global variable) between environments?
Erm,

My suggestion would be a site property
see: http://www.outsystems.com/help/servicestudio/8.0/default.htm#Language_Reference/About_Site_Properties.htm

Slightly offtopic, but why did you not thought/used site-properties before?

Hi Steve,

Statler suggestion is right on the money. I'm just curious on how you are accessing this API. If it is a webservice you don't really need the site property. You already have the possibility to configure the URL in the different environments. Is this your case?

Cheers
Thanks for the responses.  I hadn't considered site properties as I wasn't sure how I could vary them between environments if I'm using Lifetime to push changes.  I see that I can edit them in Service Center, however, if I set a site property in our Dev environment, push using Lifetime to QA, will the site property from Dev overwrite any existing site property in QA?

André - yes, it's a web service, so the URL would vary depending on the environment, for instance from http://devurl/api to http://qaurl/api to http://liveurl/api so even a way to manipulate the url depending on the server name would work.
There is a component in Forge called Environment Sticker (http://www.outsystems.com/forge/component/489/environment-sticker/) that is able to identify the environment that is being run and allow you to do things based on that information.  The component just displays something on the screen when you are in a development environment.  Instead of that you could take the same logic and alter URL's, or whatever else you need to do different in the different environments.  Check it out!
Thanks Curt, that's really useful.  I've fired that in and it appears to be working perfectly.
Steve,

if you've used the Development Environment to add the WebReference to your eSpace Module, then you have extra options to configure it in Service Center (that's what André was suggesting).



After you publish it, go to Service Center, select the eSpace module, Web Services tab:

 
Click the Web Reference (in this case "DataMigration"):


As you can see, in this case I didn't define an Effective URL, so the Default URL is being used. Had I defined it, that Effective URL had been used instead. Once you define an Effective URL, the platform will use it, even if you publish new versions of your application.

Thanks António, it's a REST web service I'm using, so I'm not sure if I can use web references as there is no WSDL?
If you are consuming REST, you didn't define it directly in the Development Environment. But in a few months, with OutSystems Platform 9.0, you'll be able to do it - and then also take advantage of the effective URL in Service Center.