From 2b10929c48977b72453a6e3bacb18af7d3d13dfe Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Wed, 15 Jul 2020 16:08:05 +0300 Subject: Added merge --- workflow.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/workflow.go b/workflow.go index 89d5459..f079e6c 100644 --- a/workflow.go +++ b/workflow.go @@ -90,5 +90,14 @@ func (w *Workflow) DumpToDot() []byte { return buf.Bytes() } +// Merge another workflow to current +func (w *Workflow) Merge(workflow *Workflow) { + for from, tos := range workflow.transitions { + for _, to := range tos { + w.AddTransition(from, to) + } + } +} + // Place is one of state type Place string -- cgit v1.2.3