Is there a way in a process to get the currently executing Execution ID?

Document created by pete_mccoy1.3055586893899446E12 Employee on Sep 24, 2013
Version 1Show Document
  • View in full screen mode
Want to obtain the execution ID of the currently executing process from within the process and set it to a Dynamic Process Property.

Add a Dataprocess shape with custom code.  (Groovy).  In this example ExecID is a Dynamic Process property that is equal to the executionID.  It is NOT persisted.

import java.util.Properties;
import com.boomi.execution.*;
import com.boomi.execution.ExecutionUtil;

for( int i = 0; i < dataContext.getDataCount(); i++ ) {
  InputStream is = dataContext.getStream(i);
  Properties props = dataContext.getProperties(i);

  dataContext.storeStream(is, props);

propValue = ExecutionManager.getCurrent().getExecutionId();

ExecutionUtil.setDynamicProcessProperty("ExecID", propValue, false);
2 people found this helpful