Skip to content

Define specific rules when merging action output by default #712

Closed
@cdavernas

Description

@cdavernas

What would you like to be added:

Define specific rules when merging action output by default

Why is this needed:

So far, the spec mandates that the output of an action without toState data filter should be merged back 'as is' into the state data.
Problem is, if the output of said action is not an object, merging it into state data will effectilvely fault the whole workflow: all evaluations will fail.

Image for instance an action that returns, say, an array or, why not, an integer. Your state was the following beforehand:

{
  "someName": "someValue"
}

After the action, the state data would be:

[
 1,
 2,
 3
]

Or why not something like:

125

Which would result in all further actions to fail. Consider, for example, a next action with a fromState data filter => BOOM.

What I propose is that the action output be merged back "as-is" ONLY if/when it's an object. If it's an array or a value type (string, bool, int, ...), it should instead be merged back into a 'actionOuput' property, for example. The name of that property could be based on the name of the action, such as myActionOutput.

WDYT?

Metadata

Metadata

Assignees

Labels

area: specChanges in the Specificationchange: featureNew feature or request. Impacts in a minor version change

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions