HashMap parameterProviderMap = new HashMap();
IPentahoUrlFactory urlFactory = new SimpleUrlFactory( baseUrl );
ArrayList messages = new ArrayList();
IRuntimeContext context = null;
try {
context =
solutionEngine.execute( globalStartupAction.getActionPath(), "Global startup actions", false, true,
instanceId, false, parameterProviderMap, outputHandler, null, urlFactory, messages ); //$NON-NLS-1$
// if context is null, then we cannot check the status
if ( null == context ) {
return;
}
if ( context.getStatus() == IRuntimeContext.RUNTIME_STATUS_SUCCESS ) {
// now grab any outputs
Iterator outputNameIterator = context.getOutputNames().iterator();
while ( outputNameIterator.hasNext() ) {
String attributeName = (String) outputNameIterator.next();
IActionParameter output = context.getOutputParameter( attributeName );
Object data = output.getValue();
if ( data != null ) {
PentahoSystem.globalAttributes.remove( attributeName );
PentahoSystem.globalAttributes.put( attributeName, data );
}
}
}
} catch ( Throwable th ) {
Logger.warn( PentahoSystem.class.getName(), Messages.getInstance().getString(
"PentahoSystem.WARN_UNABLE_TO_EXECUTE_GLOBAL_ACTION", th.getLocalizedMessage() ), th ); //$NON-NLS-1$
} finally {
if ( context != null ) {
context.dispose();
}
}
}
}