AuditId
The audit ID is a unique ID of each flow execution.
To get auditId of the currently running flow from anywhere in the code:
var auditId= com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getRequestId();
FlowId
The flow ID is a unique Id of the flow.
To get flowId of the currently running flow from anywhere in the code:
var flowId = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getFlowId();
Flow Name
The Flow Name is a name of the currently running flow. If flow includes multiple flows it is a name of the main nested flow.
To get the flow name of the currently running flow anywhere in the code:
var flowName = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getData().
getMainScenarioName();
etlConfig
etlConfig is an object which holds the configuration of the currently running flow.
Variable etlConfig is directly accessible within:
• Mapping transformations
• Scripting transformations
• The dedicated Scripting Flow
var param = etlConfig.getValue('param name');
To get the reference to etlConfig anywhere in the code, including Preprocessors (e.g., Format Preprocessor, HTTP Connection Preprocessor, etc.):
var etlConfig = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getData();
var param = etlConfig.getValue('param name');
Tenant name and user name
Anytime the data integration Flow is executed, the following global variables are set automatically:
- request_tenant_name: a tenant name. Empty if the Flow is executed under the main account. Read about tenants.
- request_user_name: a name of the user.
// props is a java.util.HashMap<String, String>
var props = com.toolsverse.config.SystemConfig.instance().getProperties();
var tenant = props.get("request_tenant_name");
var user = props.get("request_user_name");