func (ti *TaskInst) SetOutput(name string, value interface{}) error {
	if ti.logger.DebugEnabled() {
		ti.logger.Debugf("Task[%s] - Set Output: %s = %v", ti.taskID, name, value)
	}
	if ti.outputs == nil {
		ti.outputs = make(map[string]interface{})
	}
	ti.outputs[name] = value
	return nil
}
SetOutput implements activity.Context.SetOutput
package instance
import (
	"fmt"
	"runtime/debug"
	"time"
	"github.com/project-flogo/core/activity"
	"github.com/project-flogo/core/data"
	"github.com/project-flogo/core/data/coerce"
	"github.com/project-flogo/core/data/schema"
	"github.com/project-flogo/core/support/log"
	"github.com/project-flogo/core/support/trace"
	"github.com/project-flogo/flow/definition"
	"github.com/project-flogo/flow/model"
)
func NewTaskInst(flowInst *Instance, task *definition.Task) *TaskInst {
	var taskInst TaskInst
	initTaskInst(&taskInst, flowInst, task)
	return &taskInst
}
func initTaskInst(taskInst *TaskInst, flowInst *Instance, task *definition.Task) {
	if task == nil {
		task = flowInst.flowDef.GetTask(taskInst.taskID)
	}
	if task == nil {
		task = flowInst.flowDef.GetErrorHandler().GetTask(taskInst.taskID)
	}
	taskInst.flowInst = flowInst
	taskInst.task = task
	taskInst.taskID = task.ID()
	if log.CtxLoggingEnabled() {
		taskInst.logger = log.ChildLoggerWithFields(task.ActivityConfig().Logger, log.FieldString("activityName", taskInst.taskID), log.FieldString("flowName", flowInst.Name()), log.FieldString("flowId", flowInst.ID()))
	} else {
		taskInst.logger = task.ActivityConfig().Logger
	}
}
type TaskInst struct {
	flowInst *Instance
	task     *definition.Task
	status   model.TaskStatus
	id       string
	counter  int
	workingData *WorkingDataScope
	inputs   map[string]interface{}
	outputs  map[string]interface{}
	settings map[string]interface{}
	logger       log.Logger
	returnError  error
	traceContext trace.TracingContext
	taskID string
}
func (ti *TaskInst) ActivityHost() activity.Host {
	return ti.flowInst
}
func (ti *TaskInst) Name() string {
	return ti.task.Name()
}
func (ti *TaskInst) InstanceId() string {
	return ti.id
}
func (ti *TaskInst) GetInput(name string) interface{} {
	val, found := ti.inputs[name]
	if found {
		return val
	}
	return nil
}