In your runtime class (which implements
public void execute(RuntimeEnv runEnv) throws RtException {
try {
// Get my component properties
parallel =
runEnv.getScalarProperty("parallel").getValueObj().getAsBoolean();
useDelay =
runEnv.getScalarProperty("useDelay").getValueObj().getAsBoolean();
}
catch (com.engineous.sdk.vars.VarElementNotFoundException e) {
// The model was missing a component property (should never
happen)
throw new RtMissingPropertyException(e, "Missing expected component
property.");
}
catch (VariableException ve) {
// Some other problem accessing the properties
throw new RtException(ve, "Unable to access component
properties.");
}
// ... maybe similar try-catch block for parameters, or we might
// ... iterate the set of parameters. Either way, we should
catch
// ... exceptions and re-throw as RtExceptions. Having separate
try-catch
// ... blocks allows the exception text to be more specific about
what we
// ... were doing when the failure occurred (e.g. getting our
properties,
// ... getting parameters, or doing some component logic).
try {
// ... processing logic of my component ...
}
catch (Exception e) {
// Rethrow any errors during processing
throw new RtException(e, "My component failed.");
}
}
Although the methods of the component interfaces (editor and executor)
are defined to throw a specific type, the infrastructure will actually
catch all Throwables and handle them to ensure that an errant component
does not bring down the entire Design Gateway
or SIMULIA Execution Engine
station when connected to a SIMULIA Execution Engine.
However, if a component does a | |||||||