diff --git a/action/flow/instance/instance.go b/action/flow/instance/instance.go index 2f25531a..3838a4e9 100644 --- a/action/flow/instance/instance.go +++ b/action/flow/instance/instance.go @@ -124,7 +124,7 @@ func (inst *Instance) Return(returnData map[string]*data.Attribute, err error) { inst.returnError = err } -func (inst *Instance) WorkingData() data.Scope { +func (inst *Instance) WorkingData() data.MutableScope { return inst } diff --git a/action/flow/instance/taskinst.go b/action/flow/instance/taskinst.go index 6a9a3cf2..e1870fdb 100644 --- a/action/flow/instance/taskinst.go +++ b/action/flow/instance/taskinst.go @@ -517,3 +517,7 @@ func (taskInst *TaskInst) appendErrorData(err error) { // return ti.flowInst //} // + +func (ti *TaskInst) FlowWorkingData() data.MutableScope { + return ti.flowInst.WorkingData() +} \ No newline at end of file diff --git a/action/flow/model/context.go b/action/flow/model/context.go index 47d05a3e..008e6b89 100644 --- a/action/flow/model/context.go +++ b/action/flow/model/context.go @@ -16,6 +16,8 @@ type FlowContext interface { // Status gets the state of the Flow instance Status() FlowStatus + + WorkingData() data.MutableScope } // TaskContext is the execution context of the Task when executing @@ -55,6 +57,8 @@ type TaskContext interface { UpdateWorkingData(key string, value interface{}) error GetWorkingData(key string) (*data.Attribute, bool) + + FlowWorkingData() data.MutableScope } // LinkInstance is the instance of a link diff --git a/action/flow/test/context.go b/action/flow/test/context.go index 1d3d1de2..b03020b0 100644 --- a/action/flow/test/context.go +++ b/action/flow/test/context.go @@ -17,7 +17,7 @@ func NewTestActivityContext(metadata *activity.Metadata) *TestActivityContext { HostId: "1", HostRef: "github.com/TIBCOSoftware/flogo-contrib/action/flow", IoMetadata: &data.IOMetadata{Input: input, Output: output}, - HostData: data.NewSimpleScope(nil, nil), + HostData: data.NewSimpleSyncScope(nil, nil), } return NewTestActivityContextWithAction(metadata, ac) @@ -84,7 +84,7 @@ type TestActivityHost struct { HostRef string IoMetadata *data.IOMetadata - HostData data.Scope + HostData data.MutableScope ReplyData map[string]interface{} ReplyDataAttr map[string]*data.Attribute ReplyErr error @@ -118,7 +118,7 @@ func (ac *TestActivityHost) Return(data map[string]*data.Attribute, err error) { ac.ReplyErr = err } -func (ac *TestActivityHost) WorkingData() data.Scope { +func (ac *TestActivityHost) WorkingData() data.MutableScope { return ac.HostData }