How to get the Account ID and Atom ID in a process?

Document created by Rabia_Sozkesen Employee on Jan 4, 2016Last modified by Adam Arrowsmith on Aug 4, 2017
Version 3Show Document
  • View in full screen mode

You can dynamically obtain the AtomSphere Account ID, Atom ID, and other values from within a process execution using the AtomSphere Scripting API with a Groovy script in a Data Process shape or Map Function.


In the following Data Process shape script example, ExecutionUtil.getAccountId() and ExecutionUtil.getContainerId() are used to obtain the AtomSphere Account ID and container (Atom or cloud attachment ID) and store them in dynamic process properties "accountID" and "atomID", respectively.


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

// Set the process property
ExecutionUtil.setDynamicProcessProperty("accountID", ExecutionUtil.getAccountId(), false);
ExecutionUtil.setDynamicProcessProperty("atomID", ExecutionUtil.getContainerId(), false);

// Pass documents through unmodified to the next shape
for( int i = 0; i < dataContext.getDataCount(); i++ ) {
  InputStream is = dataContext.getStream(i);
  Properties props = dataContext.getProperties(i);

  dataContext.storeStream(is, props);
5 people found this helpful