{
Class<?> curClass = loadClass(instance.module().source());
// Retrieve the main method and its annotation
Method mainMethod = PlatformUtil.getMainMethod(curClass);
Main mainAnnotation = PlatformUtil.getMainAnnotation(curClass);
try {
// This is where the module is actually executed
Object result = mainMethod.invoke(moduleObject);
// Store the result of the main method as the first output
if(result != null) // if the main method is not null
outputs.put(mainAnnotation.name(), result);
} catch (Exception e)
{
throw new RuntimeException("Something went wrong during module execution.", e);
}