-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Ready For ToDoThe task can be transferred to BacklogThe task can be transferred to Backlog
Description
Steps to reproduce
- Create a flow: Simple Trigger -> JSONata Transform -> Code
JSONata transform:
[{"one": "foo"}, {"two":"bar"}, {"three": "baz"}]
Code component:
let state = {}
async function run(msg, cfg, snapshot) {
this.logger.info(`Pre State is: ${JSON.stringify(state)}`);
state = _.merge(state, msg.body);
this.logger.info(`Post State is: ${JSON.stringify(state)}`);
await this.emit('data', { body : {} });
this.logger.info('Execution finished');
}
2.Run the flow once and look at the logs of the code component
Actual Result
The logs contain
Pre State is: {}
Post State is: {"one":"foo"}
Pre State is: {}
Post State is: {"two":"bar"}
Pre State is: {}
Post State is: {"three":"baz"}
Expected Result
The logs contain
Pre State is: {}
Post State is: {"one":"foo"}
Pre State is: {"one":"foo"}
Post State is: {"one":"foo", "two":"bar"}
Pre State is: {"one":"foo", "two":"bar"}
Post State is: {"one":"foo", "two":"bar", "three":"baz"}
Metadata
Metadata
Assignees
Labels
Ready For ToDoThe task can be transferred to BacklogThe task can be transferred to Backlog