You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"}
The text was updated successfully, but these errors were encountered:
process.state = process.state || {};
async function run(msg, cfg, snapshot) {
this.logger.info(`Pre State is: ${JSON.stringify(process.state)}`);
state = _.merge(process.state, msg.body);
this.logger.info(`Post State is: ${JSON.stringify(process.state)}`);
await this.emit('data', { body : {} });
this.logger.info('Execution finished');
}
Steps to reproduce
JSONata transform:
Code component:
2.Run the flow once and look at the logs of the code component
Actual Result
The logs contain
Expected Result
The logs contain
The text was updated successfully, but these errors were encountered: