org.jbpm.sim.report.jasper.ScenarioDetailsReport Maven / Gradle / Ivy
package org.jbpm.sim.report.jasper;
import java.util.HashMap;
import java.util.Map;
import org.jbpm.sim.def.JbpmSimulationExperiment;
import org.jbpm.sim.exe.ExperimentReader;
import org.jbpm.sim.report.ScenarioReport;
/**
* Report to show details of the simulation results of one scenario
*
* @author [email protected]
*/
public class ScenarioDetailsReport extends AbstractBaseJasperReport {
private ScenarioReport report;
public ScenarioDetailsReport(ScenarioReport report) {
this.report = report;
}
public Object[] getContent() {
/**
* we need one object, otherwise the report is empty
*/
return new Object[] {""};
}
public Map getReportParameters() {
HashMap params = new HashMap();
params.put("SCENARIO_REPORT", report);
return params;
}
public String getReportPath() {
return "/org/jbpm/sim/report/jasper/ScenarioDetails.jasper";
}
public Map getSubreportPaths() {
HashMap subreports = new HashMap();
subreports.put("SUBREPORT_WaitingTimeBeforeTask",
"/org/jbpm/sim/report/jasper/WaitingTimeBeforeTask.jasper");
subreports.put("SUBREPORT_WaitingTimeForResource",
"/org/jbpm/sim/report/jasper/WaitingTimeForResource.jasper");
subreports.put("SUBREPORT_ResourceUsageTime",
"/org/jbpm/sim/report/jasper/ResourceUsageTime.jasper");
subreports.put("SUBREPORT_ResourcePools",
"/org/jbpm/sim/report/jasper/ResourcePools.jasper");
//
// SUBREPORT_ResourcePools
return subreports;
}
public static void main(String[] args) {
String processXml =
"" +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " ;
String experimentConfiguration =
"" +
" " +
" " +
" " +
" " +
" " +
" ";
ExperimentReader reader = new ExperimentReader(experimentConfiguration);
reader.addProcessDefinition( "test", processXml );
JbpmSimulationExperiment experiment = reader.readExperiment();
experiment.setWriteDesmojHtmlOutput(true);
experiment.run();
ScenarioDetailsReport report = new ScenarioDetailsReport(experiment.getSimulationReportForScenario("Three people"));
report.show();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy