Exemplo n.º 1
0
func (w *WorkerFSM) One() fsm.Decider {
	return fsm.NewComposedDecider(
		fsm.OnActivityFailedTimedOutCanceled("one", fsm.AddDecision(w.actOne)),
		fsm.OnActivityCompleted("one",
			fsm.UpdateState(w.afterOne),
			fsm.AddDecision(w.actTwo),
			fsm.Transition("Two"),
		),
	)
}
Exemplo n.º 2
0
func (w *WorkerFSM) Two() fsm.Decider {
	return fsm.NewComposedDecider(
		fsm.OnActivityFailedTimedOutCanceled("two", fsm.AddDecision(w.actTwo)),
		fsm.OnActivityCompleted("two",
			fsm.UpdateState(w.afterTwo),
			fsm.CompleteWorkflow(),
		),
	)
}
Exemplo n.º 3
0
func (w *WorkerFSM) Initial() fsm.Decider {
	return fsm.OnStarted(
		fsm.AddDecision(w.actOne),
		fsm.Transition("One"),
	)
}