Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform configuration during flow steps #1363

Open
weberjm opened this issue Nov 25, 2021 · 1 comment
Open

Transform configuration during flow steps #1363

weberjm opened this issue Nov 25, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request ferryman

Comments

@weberjm
Copy link
Member

weberjm commented Nov 25, 2021

While reviewing work for #1361, I noticed that when transformations are called from the "Transformer interface for flow steps" functionality, not all configurable transform settings are available.

Since a custom cfg object is set before calling the transform() function,

if (this.nodeSettings && this.nodeSettings.applyTransform
&& (this.nodeSettings.applyTransform === 'before' || this.nodeSettings.applyTransform === 'both')) {
const cfg = {
customMapping: this.nodeSettings.transformFunction
};
const transformedMsg = transform(message, cfg, false);

features which are configured inside https://github.com/openintegrationhub/openintegrationhub/blob/bbb147bf4373f1546de1f6a190bac505e00d3199/lib/ferryman/lib/transformer.js, such as the raw data storage will not be called before doing the transform, although the flow may be configured for it.

I am not sure if this restriction is intentional, or a side effect we can work around by passing more data from nodesettings into the transform function. If this should be improved, please mention in the comments and we can figure out a way to proceed.

@weberjm weberjm added enhancement New feature or request ferryman labels Nov 25, 2021
@SvenHoeffler
Copy link
Contributor

I think this is just a side effect from the additional options in the transform() function being added at a later point (specifically rawRecord), and that not being ported back into the flow step transformations. It should be simple enough to check whether relevant settings are present in the current step and add them in there, or alternatively to move the storeRawRecord one level higher to apply independent of the transform function and instead work solely off of nodeSettings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ferryman
Development

No branches or pull requests

2 participants