AnsweredAssumed Answered

How to use getExecutionProperty method?

Question asked by schaecherlj on Oct 18, 2018
Latest reply on Oct 20, 2018 by mahesh.sreenivasulu329291

What is the correct way to return the value of an execution property in Groovy? I've tried using the scripting values referenced in the Execution Properties documentation for the keys, but the following script results in null values:

 

import java.util.Properties;
import java.io.InputStream;
import com.boomi.execution.ExecutionUtil;
import java.util.logging.Logger;

Logger logger = ExecutionUtil.getBaseLogger();
logger.info("Account ID = " + ExecutionUtil.getExecutionProperty("ACCOUNT_ID"));
logger.info("Atom ID = " + ExecutionUtil.getExecutionProperty("ATOM_ID"));
logger.info("Document Count = " + ExecutionUtil.getExecutionProperty("DOCUMENT_COUNT"));
logger.info("Execution ID = " + ExecutionUtil.getExecutionProperty("EXECUTION_ID"));
logger.info("Node ID = " + ExecutionUtil.getExecutionProperty("NODE_ID"));
logger.info("Process ID = " + ExecutionUtil.getExecutionProperty("PROCESS_ID"));
logger.info("Process Name = " + ExecutionUtil.getExecutionProperty("PROCESS_NAME"));

 

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

   dataContext.storeStream(is, props);
}

Outcomes