func (w *Workflow) Error() error {
	return w.workflowCreationError
}
Error returns the error if happened during creating a job session
or opening a job session.
package wfl
import (
	"context"
	"errors"
	"fmt"
	"github.com/dgruber/drmaa2interface"
	"github.com/dgruber/wfl/pkg/log"
)
type Workflow struct {
	ctx                   *Context
	js                    drmaa2interface.JobSession
	workflowCreationError error
	log                   log.Logger
}
func NewWorkflow(context *Context) *Workflow {
	var err error
	if context == nil {
		err = errors.New("No context given")
	} else if context.SM == nil {
		err = errors.New("No Session Manager available in context")
	} else {
		js, errJS := context.SM.CreateJobSession("wfl", "")
		if errJS != nil {
			var errOpenJS error
			if js, errOpenJS = context.SM.OpenJobSession("wfl"); errOpenJS != nil {
				err = fmt.Errorf("error creating (%v) or opening (%v) Job Session \"wfl\"",
					errJS.Error(), errOpenJS.Error())
			}
		}
		return &Workflow{ctx: context,
			js:                    js,
			workflowCreationError: err,
			log:                   log.NewDefaultLogger(),
		}
	}
	return &Workflow{ctx: nil,
		workflowCreationError: err,
		log:                   log.NewDefaultLogger(),
	}
}
func (w *Workflow) Logger() log.Logger {
	return w.log
}
func (w *Workflow) SetLogger(log log.Logger) *Workflow {
	if log != nil {
		w.log = log
	}
	return w
}
func (w *Workflow) OnError(f func(e error)) *Workflow {
	if w.workflowCreationError != nil {
		f(w.workflowCreationError)
	}
	return w
}