How to-icon.png

How to start a new jBEAM instance from inside jBEAM

This Script generates a new jBEAM instance:

import java.io.File;

workerJBEAM = ReflectionUtils.createInstance("com.AMS.jBEAM.jBEAM");
workerJBEAM.initAsService(this, new jBEAMParameter());

File definitionScriptFile = new File("Script.groovy");
StringChannelGenerator ListSubProjects = (StringChannelGenerator) jC.getComponentByName("List_SubProjects");

for (Object subProjectsEntry : ListSubProjects.getItems()) {
    File definitionProjectFile = new File(subProjectsEntry.toString());
    workerJBEAM.openProject(definitionProjectFile);
    workerJBEAM.getScriptService().runScript(definitionScriptFile, ScriptLanguage.Groovy);
}

workerJBEAM.quitjBEAM(false, false);

System.out.println("Script successfully ended");
How To » How to collection for customization of jBEAM (using API or scripts) » How to start a new jBEAM instance from inside jBEAM
Tags:

Copyright by Kistler Chemnitz GmbH 2021
XWiki Enterprise 4.4 - Documentation