dataEdge.setLabel(label);
}
}
}
Node node = null;
while (!workQueue.isEmpty()) {
Node processingNode = workQueue.remove();
if (!GraphUtil.isAllInputsConnected(processingNode)) {
throw new XBayaRuntimeException(
"Disconnedted node inputs during labeling");
}
if (GraphUtil.isAllInputsLabeled(processingNode)) {
String sameLabel = GraphUtil.isSameLabeledInput(processingNode);
if (null != sameLabel) {
// same label so its a regular node
if (GraphUtil.isRegulerNode(processingNode)) {
processingNode.setLabel(sameLabel);
String nodeLabel = processingNode.getLabel();
List<DataPort> outputPorts = processingNode
.getOutputPorts();
for (DataPort dataPort : outputPorts) {
List<DataEdge> edges = dataPort.getEdges();
for (DataEdge dataEdge : edges) {
dataEdge.setLabel(nodeLabel);
}
workQueue.addAll(dataPort.getToNodes());
}
} else {
processingNode.inventLabel(GraphUtil
.getEncodedInputLabels(processingNode));
String nodeOutLabel = processingNode.getLabel()
+ "_out";
List<DataPort> outputPorts = processingNode
.getOutputPorts();
for (DataPort dataPort : outputPorts) {
List<DataEdge> edges = dataPort.getEdges();
for (DataEdge dataEdge : edges) {
dataEdge.setLabel(nodeOutLabel);
}
workQueue.addAll(dataPort.getToNodes());
}
}
} else {
// may need to introduce a join
// if its CEP node we assume it doesnt require
// joins
// Its hard to determine if the CEP node would
// resolve the joins
if (!GraphUtil.isCEPNode(processingNode)) {
processingNode.setRequireJoin(true);
}
processingNode.inventLabel(GraphUtil
.getEncodedInputLabels(processingNode));
String nodeOutLabel = processingNode.getLabel() + "_out";
List<DataPort> outputPorts = processingNode
.getOutputPorts();
for (DataPort dataPort : outputPorts) {
List<DataEdge> edges = dataPort.getEdges();
for (DataEdge dataEdge : edges) {
dataEdge.setLabel(nodeOutLabel);