ServiceDesk

 View Only

Workflow/ServiceDesk - How To Extract the (local.orm) Sql Connection String 

May 15, 2015 12:21 PM

Configure a Code (Script) Component as such:

 

result_variable.png

 

source_code.png

 

// Using namespace (one per line):

System
Symantec.SymQ
LogicBase.Core.Messaging
LogicBase.Core.Messaging.Implementations



// Source code:

string connectionString = "";

try {
        IMessageExchange exchange = MessageExchangeFactory.GetExchange(SymQConstants.Q_CONFIG);
        Message message = exchange.Get("SymQ_Local_Defaults");
        ExchangeConfiguration config = (ExchangeConfiguration)message.PayLoad;
        AbstractExchangeConfiguration localOrm = config.GetConfiguration("local.orm");
        RelationalMapperExchangeConfiguration mapper = (RelationalMapperExchangeConfiguration)localOrm;
        connectionString = mapper.ConnectionString;
}
catch (Exception e) {
        return e.Message;
}

return connectionString;

 

Once completed, you will be able to use the 'SqlConnectionString' variable in your project.

Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
txt file
source.txt   763 B   1 version
Uploaded - Apr 10, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.