WorkflowCreator creator = new WorkflowCreator();
Workflow workflow = creator.createComplexMathWorkflow();
WorkflowClient.createScript(workflow);
Monitor monitor;
if (this.gui) {
this.engine = new XBayaEngine(this.configuration);
this.graphCanvas = this.engine.getGUI().getGraphCanvas();
this.graphCanvas.setWorkflow(workflow);
monitor = this.engine.getMonitor();
this.engine.getGUI().eventReceived(new Event(Type.MONITOR_STARTED));
repaintAndWait(2);
} else {
MonitorConfiguration monitorConfiguration = new MonitorConfiguration(
this.configuration.getBrokerURL(), this.configuration
.getTopic(), this.configuration.isPullMode(),
this.configuration.getMessageBoxURL());
monitor = new Monitor(monitorConfiguration);
}
MonitorEventData eventData = monitor.getEventData();
MonitorCallback callback = new MonitorCallback(eventData);
LoopbackPublisher publisher = new LoopbackPublisher(callback,
this.configuration.getTopic());
MonitorNotifier notifier = new MonitorNotifier(publisher);