import com.engineous.sdk.component.ComponentAPI;
import com.engineous.sdk.model.DtScalarVariable;

#############################################################################################
# Create the OS Command component, make it the root, and add parameters to represent relevant quantities
#############################################################################################

# create OSCommand component
DtComponent osCmdComp = DtModelManager.createComponent("com.engineous.component.OSCommand","Custom OSCommand");

# Make this OS Command component the root component
model.setRootComponent(osCmdComp);

# Note: If, instead, you want to add this component as a child under another component,
#        such as the existing root component in the model, do the following:
# model.getRootComponent().addComponent(osCmdComp, true);
# The "true" argument says to add it to the end of the workflow, otherwise you must explicitly
# create the appropriate DtControlFlow links.


#############################################################################################
# Configure the OS Command component:  set the command and other execution options
#############################################################################################

# get OSCommand component API
osCmdAPI = osCmdComp.getAPI();

osCmdAPI.set ("command","aero.exe");
#osCmdAPI.set("commandargs", cmdargs);
osCmdAPI.set("LogStdError", true);
osCmdAPI.set("FailWhenStdError", true);
osCmdAPI.set("MaxExecutionTime", 60);
osCmdAPI.set("RetryLimit", 4);
			

# apply changes to the OS Command API to store back in the component
osCmdAPI.apply();

