Integration scenarios often need to 'promote' or 'enrich' messages/data from either internal or external data sources. Codit is a long-term implementer of something called 'Transco', which was originally a Microsoft BizTalk component. Now, modern Azure Logic Apps integration benefits from this behavior.
Invictus provides a Transco component to promote properties from a SQL database or to transform XML content via XSLT transformations. The component can also promote values to the context of the response.
Component usage
The Transco component has endpoints available for XML or JSON content. Given a stored Transco configuration file, the component promotes values from a client's SQL database or transforms XML content via a stored XSLT file.
- XML/JSON
- Matrix basic promote
/api/TranscoXML or /api/TranscoJsonSimulatedPromotes values from a SQL database or transforms XML content via a stored XSLT file, based on a stored Transco configuration file.
{
"content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTE2Ij8+PHJvb3Q+PG5hbWUgc3RhdHVzPSJNZW1iZXIiPkpvaG4gRG9lPC9uYW1lPjwvcm9vdD4=",
"transcoConfig": "docs_config.json",
"context": {
"customerActive": true
}
}
contentstringrequiredThe input XML or JSON content as a Base64-encoded string.
transcoConfigstringrequiredThe filename of the Transco configuration file, stored in the internal blob storage container (for example
docs_config.json).contextobjectThe dictionary providing context to the conversion, gets copied 1:1 to the response.
The Transco component successfully promoted values or transformed the content.
{
"content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTE2Ij8+PE1lbWJlcj5Kb2huIERvZTwvTWVtYmVyPg==",
"transcoConfig": "docs_config.json",
"context": {
"customerActive": true
}
}
Transco configuration file
The component requires a JSON Transco configuration file to describe the instructions to perform. Execution of instructions happens in the order in which they appear.
Store the configuration file in the Azure Storage Account in the Transcov2configstore container, in the /Configs folder.
- SQL Commands
- XML Transformation
Full Transco config file specification
{
"instructions": [
{
"scopePath": "[XPath/JPath of content scope]",
"namespaces": [
{
"namespace": "[XML Namespace]",
"prefix": "[XML Namespace prefix]"
}
],
"command": {
"databaseConnectionString":"[Raw connection string to DB]",
"databaseKeyVaultName": "[Name of DB connection string secret in Key Vault]",
"commandValue": "[SQL query to be executed]",
"isMandatory": "[If true, will throw error when result is null]",
"columnName": "[Obtain value from specified column if query returns more than one field. If empty, use value from first column]",
"defaultValue": "[Default value of result]",
"parameters": [
{
"paramName": "[Name of param in query]",
"value": "[Type dependent. XPath or JPath if valueType = 'path']",
"type": "[SQL DB type. See: https://learn.microsoft.com/en-us/dotnet/api/system.data.sqldbtype]",
"valueType": "['path' or 'fixedValue' or 'context']"
},
{
"paramName": "[Name of param in query]",
"value": "[Type dependent. Any string value if valueType = 'fixedValue']",
"type": "[SQL DB type. See: https://learn.microsoft.com/en-us/dotnet/api/system.data.sqldbtype]",
"valueType": "['path' or 'fixedValue' or 'context']"
}
],
"destination": "[XPath/JPath of the results destination, or Context key if 'promoteToContext=true']",
"promoteToContext": "[If true, the component saves the SQL query result to Context with 'destination' as key]",
"cache": {
"useCaching": "[If true, caches the SQL query result]",
"cachingTimeout": "[Cache timeout time span]"
}
}
},
{
"xsltTransform": "[Name of XSLT file]",
"extensions": [
{
"namespace": "[Assembly namespace]",
"assemblyName": "[Assembly name]",
"className": "[Assembly class name]",
"dependencies": [
"[DLL dependency file name]",
"[DLL dependency file name]"
]
}
]
}
],
"options": {
"configCache": {
"useCaching": "[If true, config file is cached]",
"cachingTimeout": "[Cache timeout time span]"
},
"indentResult": "[If true, Transco results will be formatted and indented]"
}
}
The basic promote is a way of promoting values to the context. This version accept a list of parameters and promotes them to the Context. The component only transfers found values to the response.
Transco XML/JSON operations also support promotion of values to the context.
- Set the option
promoteToContext=truein the Transco configuration file. - Set the option
destinationto the key of the desired destination in the context. The SQL operation will now save the result to the context.
/api/MatrixBasicPromoteSimulatedAccepts a list of parameters and promotes them to the Context in the response.
{
"content": "ew0KICAiQ291bnRyeUNvZGUiOiAiQkUiLA0KICAiTW9uZXkiOiAgeyAiQW1vdW50IjogIDUwLCAiQ3VycmVuY3kiOiAgIkdCUCIgIH0NCn0NCg==",
"context": {
"x-conversationId": "29500405-d7cf-4877-a72b-a3288cff9dc0",
"x-correlationId": "fc13d345-ebd7-44f2-89a9-4371258c0a08",
"x-batchId": "975f7ea4-6247-431b-afb6-6d27fb47516f",
"x-applicationName": "InvoiceApp",
"filter": "salesforceconnector"
},
"keyValueCollection": {
"customer": "John Doe",
"amount": 50,
"currency": "GBP"
},
"flow": "fl1",
"domain": "sales"
}
contentstringrequiredThe input content as a Base64-encoded string.
contextobjectThe dictionary providing context to the conversion, gets copied 1:1 to the response.
keyValueCollectionobjectA collection of key-value pairs to promote to the context.
flowstringThe flow identifier for the request.
domainstringThe domain identifier for the request.
servicestringThe service identifier for the request.
actionstringThe action identifier for the request.
versionstringThe version identifier for the request.
senderstringThe sender identifier for the request.
applicationNamestringThe application name for the request.
milestonestringThe milestone identifier for the request.
conversationIdstringThe conversation identifier for the request.
correlationIdstringThe correlation identifier for the request.
batchIdstringThe batch identifier for the request.
data1stringThe data1 identifier for the request.
data2stringThe data2 identifier for the request.
data3stringThe data3 identifier for the request.
The Transco component successfully promoted values to the context.
{
"content": "ew0KICAiQ291bnRyeUNvZGUiOiAiQkUiLA0KICAiTW9uZXkiOiAgeyAiQW1vdW50IjogIDUwLCAiQ3VycmVuY3kiOiAgIkdCUCIgIH0NCn0NCg==",
"context": {
"x-conversationId": "29500405-d7cf-4877-a72b-a3288cff9dc0",
"x-correlationId": "fc13d345-ebd7-44f2-89a9-4371258c0a08",
"x-batchId": "975f7ea4-6247-431b-afb6-6d27fb47516f",
"x-applicationName": "InvoiceApp",
"filter": "salesforceconnector",
"flow": "fl1",
"domain": "sales",
"service": null,
"action": null,
"version": null,
"sender": null,
"applicationName": null,
"milestone": null,
"conversationId": null,
"correlationId": null,
"batchId": null,
"data1": null,
"data2": null,
"data3": null,
"customer": "John Doe",
"amount": 50,
"currency": "GBP"
}
}
Related Bicep template parameters
Use arrow keys to navigate rows. Press Enter or Space to expand a row with sub-properties. Press / to focus the search field.