Tenant and user name global variables
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.
You can access these global variables programmatically:
// props is a java.util.HashMap<String, String>
var props = com.toolsverse.config.SystemConfig.instance().getProperties();
// use the same key you stored in props.put(...)
var tenant = props.get("request_tenant_name");
var user = props.get("request_user_name");
Request ID and Flow ID
You can access requestId - the unique execution id displayed in Flow Statistics dashboard:
and flowId using the following code:
var requestId = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getRequestId();
var flowId = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getFlowId();
Schedule ID
You can access scheduleId - the unique id of the schedule which triggered the flow using the following code:
var scheduleId = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getScheduleId();
Note that if the flow was triggered manually or by the integration agent the scheduleId is null.
Test Transformation Flag
When user clicks Test Transformation button the system sets the flag which indicates that the source-to-destination transformation is executed in the test mode.
Access flag when etlConfig variable is available
var isTest = etlConfig.isTestTranfromation();
Access flag when etlConfig variable is not available
var etlConfig = com.toolsverse.config.SystemConfig.instance().getEtlThreadContext().getData();
var isTest = etlConfig.isTestTranfromation();