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

[BUG] Formula not correctly evaluated #4388

Open
MatWein opened this issue Oct 4, 2022 · 1 comment
Open

[BUG] Formula not correctly evaluated #4388

MatWein opened this issue Oct 4, 2022 · 1 comment
Labels

Comments

@MatWein
Copy link

MatWein commented Oct 4, 2022

Describe the bug
I have the following formula:
IF(Length(${DOC.Properties.832504:/current/XXX-WPNRID-D}) == 6, ${DOC.Properties.832504:/current/XXX-WPNRID-D}, null)
which is not correctly calculated. I tried to change the source code at:
io.atlasmap.core.DefaultAtlasFieldActionService#processActionForEachCollectionItem
from:
subField.setValue(value);
to:
fieldGroup.setValue(value);
That seems to work, but I don't know what side-effects this can have.

Attach .adm file and source document examples
mapping.zip

To Reproduce
Steps to reproduce the behavior:

  1. Import adm file
  2. Go to mapping of target DSER_DEPOT_BESTAND_WKN
  3. use preview

Expected behavior
If the input field has exactly 6 characters than we want a mapping. Otherwise not.

Screenshots
image
image

Environment (please complete the following information):

  • OS: Linux Mint 21
  • Browser chrome
  • Version 105

Additional context
Maybe you should think about using some existing frameworks / interpreter like Lua/JS/... instead of writing a custom formula interpreter.

@MatWein MatWein added the cat/bug label Oct 4, 2022
@MatWein
Copy link
Author

MatWein commented Oct 7, 2022

The above change does not seem to work and breaks other formulas.

Hint: formulas like:
NormalizeDouble('de',${DOC.Properties.832504:/current/XXX-NW-M}) * NormalizeDouble('de',${DOC.Properties.832504:/current/XXX-EINKURS-M})
are also not correctly evaluated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant