fix bug in invocation graph builder
package org.streampipes.manager.matching;
+import org.apache.commons.lang.RandomStringUtils;
import org.streampipes.config.backend.BackendConfig;
import org.streampipes.manager.data.PipelineGraph;
import org.streampipes.manager.data.PipelineGraphHelpers;
import org.streampipes.manager.matching.output.OutputSchemaFactory;
import org.streampipes.manager.matching.output.OutputSchemaGenerator;
+import org.streampipes.model.SpDataStream;
import org.streampipes.model.base.InvocableStreamPipesEntity;
import org.streampipes.model.base.NamedStreamPipesEntity;
-import org.streampipes.model.monitoring.ElementStatusInfoSettings;
+import org.streampipes.model.graph.DataProcessorInvocation;
import org.streampipes.model.grounding.EventGrounding;
+import org.streampipes.model.monitoring.ElementStatusInfoSettings;
import org.streampipes.model.schema.EventSchema;
-import org.streampipes.model.SpDataStream;
-import org.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.commons.lang.RandomStringUtils;
import java.util.ArrayList;
import java.util.Arrays;
@@ -57,9 +57,9 @@ public class InvocationGraphBuilder {
EventSchema outputSchema = new EventSchema();
OutputSchemaGenerator schemaGenerator = new OutputSchemaFactory(dataProcessorInvocation).getOuputSchemaGenerator();
- if (((DataProcessorInvocation) source).getInputStreams().size() == 1)
+ if (((DataProcessorInvocation) source).getInputStreams().size() == 1) {
outputSchema = schemaGenerator.buildFromOneStream(dataProcessorInvocation.getInputStreams().get(0));
- else if (graphExists(dataProcessorInvocation.getDOM())) {
+ } else if (graphExists(dataProcessorInvocation.getDOM())) {
DataProcessorInvocation existingInvocation = (DataProcessorInvocation) find(dataProcessorInvocation.getDOM());
outputSchema = schemaGenerator.buildFromTwoStreams(existingInvocation.getInputStreams().get(0), dataProcessorInvocation.getInputStreams().get(1));
@@ -96,9 +96,8 @@ public class InvocationGraphBuilder {
t.setCorrespondingPipeline(pipelineId);
t.setStatusInfoSettings(makeStatusInfoSettings(elementIdentifier));
- if (getConnections(t).size() > 0) {
configure(t, getConnections(t));
- }
+
});
}
@@ -144,8 +143,11 @@ public class InvocationGraphBuilder {
}
private Integer getIndex(InvocableStreamPipesEntity element) {
- if (element.getStreamRequirements().size() == 1) return 0;
- else return graphExists(element.getDOM()) ? 1 : 0;
+ if (element.getStreamRequirements().size() == 1) {
+ return 0;
+ } else {
+ return graphExists(element.getDOM()) ? 1 : 0;
+ }
}
private boolean graphExists(String domId) {
