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

Array mapping fails #281

Closed
retgits opened this issue May 24, 2018 · 0 comments
Closed

Array mapping fails #281

retgits opened this issue May 24, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@retgits
Copy link
Contributor

retgits commented May 24, 2018

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[] feature request
[] support request
[] general question

Current behavior (how does the issue manifest): It seems that mapping with arrays fails when using it in branches or functions

Using in a branch

2018-05-23 19:57:16.474 ERROR  [linker] - Get value from link value %+v, error %s$flow.commandline[0] == "type"Execution failed for mapping [$flow.commandline[0] == "type"] due to error - Mapping ref eva error [not an array]

The input for the array

{
                  "mapTo": "commandline",
                  "type": "assign",
                  "value": "$.args"
                }

The commandline is mapped from the args coming from the cli trigger

The link expression

{
            "from": "log_2",
            "to": "log_5",
            "type": "expression",
            "value": "$flow.commandline[0] == \"type\""
          }

Using in a function

This mapping

{
"type": "expression",
"value": "string.concat(\"Your search parameters are \", $flow.commandline[0], \" - \", $flow.commandline[1], \" - \", $flow.commandline[2], \" - \", $flow.commandline[3])",
"mapTo": "message"
}

results in this error

Expression mapping failed, due to Execution failed for mapping [string.concat("Your search parameters are ", $flow.commandline[0], " - ", $flow.commandline[1], " - ", $flow.commandline[2], " - ", $flow.commandline[3])] due to error - not an array
2018-05-23 20:14:35.615 ERROR  [flowmodel-simple] - Error evaluating activity 'log_2'[github.com/TIBCOSoftware/flogo-contrib/activity/log] - Expression mapping failed, due to Execution failed for mapping [string.concat("Your search parameters are ", $flow.commandline[0], " - ", $flow.commandline[1], " - ", $flow.commandline[2], " - ", $flow.commandline[3])] due to error - not an array

I'm very sure that $flow.commandline is an array because when I try to use it without any qualifiers in my mapping I get the error

 Expression mapping failed, due to Execution failed for mapping [string.concat("Your search parameters are ", $flow.commandline)] due to error - reflect: cannot use []string as type string in Call
@retgits retgits changed the title Branch expression failing Array mapping fails May 24, 2018
@mellistibco mellistibco added this to the 0.5.5 milestone May 24, 2018
lixingwang added a commit to TIBCOSoftware/flogo-lib that referenced this issue May 24, 2018
lixingwang added a commit to TIBCOSoftware/flogo-lib that referenced this issue May 25, 2018
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

4 participants