Skip to content

WIP: fix/Re-introduce node recreation #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/models/generic/WorkflowModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,22 @@ export abstract class WorkflowModel extends ValidationBase implements Serializab
this.eventHub.on("step.port.change", (port: WorkflowStepOutputModel | WorkflowStepInputModel) => {
this.graph.setVertexData(port.connectionId, port);
// check if port is connected to a workflow output
// if (port instanceof WorkflowStepOutputModel && this.graph.hasOutgoing(port.connectionId)) {
// const temporaryEdges = Array.from(this.graph.edges);
// temporaryEdges.forEach(e => {
// if (e.source.id === port.connectionId) {
// const oldOutput = this.findById(e.destination.id);
// // make sure the destination is a workflow output and is only connected to the port which changed
// if (!(oldOutput instanceof WorkflowOutputParameterModel) || oldOutput.source.length !== 1) return;
//
// // remove the outdated workflow output first to avoid an infinite loop and duplicate ids
// this.removeOutput(oldOutput);
//
// // create a new workflow output in place of the one which changed
// this.createOutputFromPort(port.connectionId, {customProps: oldOutput.customProps});
// }
// })
// }
if (port instanceof WorkflowStepOutputModel && this.graph.hasOutgoing(port.connectionId)) {
const temporaryEdges = Array.from(this.graph.edges);
temporaryEdges.forEach(e => {
if (e.source.id === port.connectionId) {
const oldOutput = this.findById(e.destination.id);
// make sure the destination is a workflow output and is only connected to the port which changed
if (!(oldOutput instanceof WorkflowOutputParameterModel) || oldOutput.source.length !== 1) return;

// remove the outdated workflow output first to avoid an infinite loop and duplicate ids
this.removeOutput(oldOutput);

// create a new workflow output in place of the one which changed
this.createOutputFromPort(port.connectionId, {customProps: oldOutput.customProps});
}
})
}
});
}

Expand Down