use of org.talend.designer.runprocess.trace.TraceConnectionsManager in project tdi-studio-se by Talend.
the class ClearTraceAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
//
final TraceConnectionsManager traceConnectionsManager = new TraceConnectionsManager(process);
traceConnectionsManager.init();
Set<IConnection> doneConnections = new HashSet<IConnection>();
IConnection connection = null;
for (Iterator<? extends INode> i = process.getGraphicalNodes().iterator(); connection == null && i.hasNext(); ) {
INode psNode = i.next();
if (psNode instanceof Node) {
Node node = (Node) psNode;
//$NON-NLS-1$
node.getNodeProgressBar().updateState("UPDATE_STATUS", new Double(0));
node.setErrorFlag(false);
node.setCompareFlag(false);
node.setErrorInfo(null);
//$NON-NLS-1$
node.getNodeError().updateState("UPDATE_STATUS", false);
//$NON-NLS-1$
node.setErrorInfoChange("ERRORINFO", false);
}
for (IConnection connec : psNode.getOutgoingConnections()) {
if (!doneConnections.contains(connec)) {
connec.setTraceData(null);
doneConnections.add(connec);
}
// get the related shadow connections
IConnection[] shadowconns = traceConnectionsManager.getShadowConnenctions(connec.getUniqueName());
if (shadowconns != null) {
for (IConnection sc : shadowconns) {
if (!doneConnections.contains(sc)) {
sc.setTraceData(null);
doneConnections.add(sc);
}
}
}
}
// currently, only for joblet when expanded.
IConnection[] nonShadowDataConnections = traceConnectionsManager.getNonShadowDataConnections(psNode);
if (nonShadowDataConnections != null) {
for (IConnection conn : nonShadowDataConnections) {
if (!doneConnections.contains(conn)) {
conn.setTraceData(null);
doneConnections.add(conn);
}
}
}
}
}
Aggregations