func (state *SagaState) IsSagaAborted() bool {
	return state.sagaAborted
}
/*
Returns true if this Saga has been Aborted, false otherwise
package saga
import (
	"fmt"
)
type InvalidSagaStateError struct {
	s string
}
func (e InvalidSagaStateError) Error() string {
	return e.s
}
func NewInvalidSagaStateError(msg string, args ...interface{}) error {
	return InvalidSagaStateError{
		s: fmt.Sprintf(msg, args...),
	}
}
type InvalidSagaMessageError struct {
	s string
}
func (e InvalidSagaMessageError) Error() string {
	return e.s
}
func NewInvalidSagaMessageError(msg string) error {
	return InvalidSagaMessageError{
		s: msg,
	}
}
type flag byte
const (
	TaskStarted flag = 1 << iota
	TaskCompleted
	CompTaskStarted
	CompTaskCompleted
)
type taskData struct {
	taskStart     []byte
	taskEnd       []byte
	compTaskStart []byte
	compTaskEnd   []byte
}
type SagaState struct {
	sagaId string
	job    []byte
	taskData map[string]*taskData
	taskState map[string]flag
	sagaAborted bool
	sagaCompleted bool
}
func initializeSagaState() *SagaState {
	return &SagaState{
		sagaId:        "",
		job:           nil,
		taskState:     make(map[string]flag),
		taskData:      make(map[string]*taskData),
		sagaAborted:   false,
		sagaCompleted: false,
	}
}
func (state *SagaState) SagaId() string {
	return state.sagaId
}
func (state *SagaState) Job() []byte {
	return state.job
}
func (state *SagaState) GetTaskIds() []string {
	taskIds := make([]string, 0, len(state.taskState))
	for id := range state.taskState {
		taskIds = append(taskIds, id)
	}
	return taskIds
}
func (state *SagaState) IsTaskStarted(taskId string) bool {
	flags, _ := state.taskState[taskId]
	return flags&TaskStarted != 0
}
func (state *SagaState) GetStartTaskData(taskId string) []byte {
	data, ok := state.taskData[taskId]
	if ok {
		return data.taskStart
	} else {
		return nil
	}
}
func (state *SagaState) IsTaskCompleted(taskId string) bool {
	flags, _ := state.taskState[taskId]
	return flags&TaskCompleted != 0
}
func (state *SagaState) GetEndTaskData(taskId string) []byte {
	data, ok := state.taskData[taskId]
	if ok {
		return data.taskEnd
	} else {
		return nil
	}
}
func (state *SagaState) IsCompTaskStarted(taskId string) bool {
	flags, _ := state.taskState[taskId]
	return flags&CompTaskStarted != 0
}
func (state *SagaState) GetStartCompTaskData(taskId string) []byte {
	data, ok := state.taskData[taskId]
	if ok {
		return data.compTaskStart
	} else {
		return nil
	}
}
func (state *SagaState) IsCompTaskCompleted(taskId string) bool {
	flags, _ := state.taskState[taskId]
	return flags&CompTaskCompleted != 0
}
func (state *SagaState) GetEndCompTaskData(taskId string) []byte {
	data, ok := state.taskData[taskId]
	if ok {
		return data.compTaskEnd
	} else {
		return nil
	}
}