Is there a way to access the environment variables section, and get the deployment group variable value within C#? I need the active deployment group variable value from the name.
I have the following code in C#, but this only gets me the name, not the variable value. I attached an image showing the deployment group for development. Not sure how to access the variable value.
System.Collections.Generic.Dictionaryfont color="#0000FF">string, Neuron.Esb.Administration.NeuronVariable>.KeyCollection dict = Neuron.Explorer.UIEnvironment.ActiveConfiguration.NeuronEnvironmentVariables.Keys;
foreach
(string key in dict)
{
context.Instance.TraceInformation(key.ToString());
}
Tags:
at run time, within a code step, you can iterate through all the environmental variables for the active deployment very easily like so:
foreach(var s in context.EnvironmentVariables)
context.Instance.TraceInformation(string.Format("key={0}, value={1}",s.Key,s.Value));
I tried that, but received 0 as the count. If I use ActiveConfig as in the foreach below, I get 39 which is correct, but the name and value are equal to the name of the variable, still no value access.
context.Instance.TraceInformation(context.EnvironmentVariables.Count.ToString()); = 0 as the Count
foreach
(var s in Neuron.Explorer.UIEnvironment.ActiveConfiguration.NeuronEnvironmentVariables)
{
context.Instance.TraceInformation(string.Format("key={0}, value{1}", s.Key, s.Value)); /* Key and Value were identical */
}
ok, well the solution for me was to basically create a file adapter and subscribe to the topic. I was trying to get the deployment group and then access the value, but it's much easier with the adapter rather than try using C# code.
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by