Skip to content

Commit

Permalink
probagate changes about nodeKey
Browse files Browse the repository at this point in the history
  • Loading branch information
antho1404 committed Aug 9, 2019
1 parent 294b78f commit 3fc0f0a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 39 deletions.
4 changes: 2 additions & 2 deletions protobuf/types/execution.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 31 additions & 32 deletions protobuf/types/workflow.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protobuf/types/workflow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ message Workflow {
string instanceHash = 2; // Hash of the instance that triggers the workflow.
string key = 3; // Key that triggers the workflow (event key or task key).
repeated Filter filters = 4; // List of filters to apply on the data of the event/result.
string nodeKey = 5; // First node to trigger when the workflow starts.
string nodeKey = 5; // First node to trigger when the workflow starts.
}

// Definition of the node to execute when the workflow is triggered.
Expand Down
4 changes: 2 additions & 2 deletions scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (s *Scheduler) processTrigger(trigger workflow.TriggerType, instanceHash ha
}
for _, wf := range workflows {
if wf.Trigger.Match(trigger, instanceHash, key, data) {
nextStep, err := wf.FindNode(wf.Trigger.InitialNode)
nextStep, err := wf.FindNode(wf.Trigger.NodeKey)
if err != nil {
s.ErrC <- err
continue
}
if _, err := s.execution.Execute(wf.Hash, nextStep.InstanceHash, eventHash, execHash, wf.Trigger.InitialNode, nextStep.TaskKey, data, []string{}); err != nil {
if _, err := s.execution.Execute(wf.Hash, nextStep.InstanceHash, eventHash, execHash, wf.Trigger.NodeKey, nextStep.TaskKey, data, []string{}); err != nil {
s.ErrC <- err
}
}
Expand Down
4 changes: 2 additions & 2 deletions server/grpc/api/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func fromProtoWorkflow(wf *types.Workflow) (*workflow.Workflow, error) {
Type: triggerType,
InstanceHash: instanceHash,
Key: wf.Trigger.Key,
InitialNode: wf.Trigger.InitialNode,
NodeKey: wf.Trigger.NodeKey,
Filters: fromProtoFilters(wf.Trigger.Filters),
},
Nodes: nodes,
Expand Down Expand Up @@ -203,7 +203,7 @@ func toProtoWorkflow(wf *workflow.Workflow) *types.Workflow {
InstanceHash: wf.Trigger.InstanceHash.String(),
Key: wf.Trigger.Key,
Filters: toProtoFilters(wf.Trigger.Filters),
InitialNode: wf.Trigger.InitialNode,
NodeKey: wf.Trigger.NodeKey,
},
Nodes: toProtoWorkflowNodes(wf.Nodes),
Edges: toProtoWorkflowEdges(wf.Edges),
Expand Down

0 comments on commit 3fc0f0a

Please sign in to comment.