From 12670ddb7250ef6458efd204d64e4c7a8867cd1c Mon Sep 17 00:00:00 2001 From: frikky Date: Sat, 6 Aug 2022 01:34:04 +0200 Subject: [PATCH] Fixed startnode management during schedule startup --- backend/go-app/go.mod | 2 +- backend/go-app/walkoff.go | 19 ++++++++++++------- frontend/src/views/AngularWorkflow.jsx | 7 ++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 3f038a4e..f6c8d495 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -24,7 +24,7 @@ require ( github.com/h2non/filetype v1.1.3 github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect github.com/satori/go.uuid v1.2.0 - github.com/shuffle/shuffle-shared v0.2.78 + github.com/shuffle/shuffle-shared v0.2.79 go4.org v0.0.0-20201209231011-d4a079459e60 // indirect golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce google.golang.org/api v0.65.0 diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 46c64508..092b52ad 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -1504,14 +1504,19 @@ func scheduleWorkflow(resp http.ResponseWriter, request *http.Request) { // Finds the startnode for the specific schedule startNode := "" - for _, branch := range workflow.Branches { - if branch.SourceID == schedule.Id { - startNode = branch.DestinationID - } - } + if schedule.Start != "" { + startNode = schedule.Start + } else { - if startNode == "" { - startNode = workflow.Start + for _, branch := range workflow.Branches { + if branch.SourceID == schedule.Id { + startNode = branch.DestinationID + } + } + + if startNode == "" { + startNode = workflow.Start + } } //log.Printf("Startnode: %s", startNode) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 847dd46b..db072734 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -4903,9 +4903,10 @@ const AngularWorkflow = (defaultprops) => { } var mappedStartnode = "" - const edges = cy.edges.jsons() - for (var key in edges.length) { - const tmp = edges[key] + const alledges = cy.edges().jsons() + for (var key in alledges) { + const tmp = alledges[key] + console.log("TMP: ", tmp, tmp.data.source) if (tmp.data.source === trigger.id) { mappedStartnode = tmp.data.target break