how to get Boomi ProcessName and Exec ID

Use the below Groovy script to get the ProcessName & Exec ID

import org.jdom.Document;
import org.jdom.Element;
import java.util.Properties;
import java.io.InputStream;
import com.boomi.execution.ExecutionUtil;
import com.boomi.execution.ExecutionManager;
for( int i = 0; i < dataContext.getDataCount(); i++ ) {
  InputStream is = dataContext.getStream(i);
  Properties props = dataContext.getProperties(i);
  dataContext.storeStream(is, props);
}
// get the process name
def processName = ExecutionManager.getCurrent().getProcessName();
if(ExecutionManager.getCurrent()!= null){
    processName = ExecutionManager.getCurrent().getProcessName();
}
ExecutionUtil.setDynamicProcessProperty(‘BOOMI_PROCESS_NAME’,processName,false);
// get the execution ID
def executionId =  ExecutionManager.getCurrent().getTopLevelExecutionId();
ExecutionUtil.setDynamicProcessProperty(‘BOOMI_EXECUTION_ID’,executionId,false);
Advertisements