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

Cannot iterate over an output array from a previous activity #213

Closed
mellistibco opened this issue Apr 5, 2018 · 1 comment
Closed

Cannot iterate over an output array from a previous activity #213

mellistibco opened this issue Apr 5, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@mellistibco
Copy link
Collaborator

mellistibco commented Apr 5, 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):
Attempting to set a log activity as type iterator and iterate over the output of a previous activity.

The log activity:

{
  "id": "log_4",
  "type": "iterator",
  "name": "Log Message",
  "description": "Simple Log Activity",
  "settings": {
    "iterate": "$activity[parsecsv_3].output"
  },
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
    "input": {
      "flowInfo": "false",
      "addToFlow": "true"
    },
    "mappings": {
      "input": [
        {
          "type": "assign",
          "value": "$current.iteration.value",
          "mapTo": "message"
        }
      ]
    }
  }
}

$activity[parsecsv_3].output is set in an activity prior to the log:

2018-04-04 21:04:58.095 DEBUG  [activity-flogo-parsecsv] - Output Object: [map[field1:Data1 field2:Data2 field3:Data3] map[field1:Data4 field2:Data5 field3:Data6]]
2018-04-04 21:04:58.095 DEBUG  [engine] - SET OUTPUT: output = [map[field1:Data1 field2:Data2 field3:Data3] map[field1:Data4 field2:Data5 field3:Data6]]

2018-04-04 21:04:58.095 DEBUG  [engine] - SetAttr: output = [map[field2:Data2 field3:Data3 field1:Data1] map[field1:Data4 field2:Data5 field3:Data6]]

The full log:

2018-04-04 21:04:55.795 DEBUG  [function-registry] - Registry function name random tag number
2018-04-04 21:04:55.795 DEBUG  [function-registry] - Registry function name concat tag string
2018-04-04 21:04:55.795 DEBUG  [function-registry] - Registry function name equals tag string
2018-04-04 21:04:55.795 DEBUG  [function-registry] - Registry function name equalsIgnoreCase tag string
2018-04-04 21:04:55.795 DEBUG  [function-registry] - Registry function name length tag string
2018-04-04 21:04:55.797 DEBUG  [function-registry] - Registry function name isDefined tag
2018-04-04 21:04:55.797 DEBUG  [flogo] - Registering activity: 'github.com/mellistibco/flogo-activities/activities/parsecsv'
2018-04-04 21:04:55.797 DEBUG  [flogo] - Registering activity: 'github.com/TIBCOSoftware/flogo-contrib/activity/log'
2018-04-04 21:04:55.798 INFO   [engine] - Engine Starting...
2018-04-04 21:04:55.798 DEBUG  [engine] - Resolved setting [iterate: $activity[parsecsv_3].output] to : <nil>
2018-04-04 21:04:55.798 DEBUG  [trigger-flogo-rest] - Registering handler [POST: /test]
2018-04-04 21:04:55.799 DEBUG  [trigger-flogo-rest] - Configured on port 9099
2018-04-04 21:04:55.799 INFO   [engine] - Starting Services...
2018-04-04 21:04:55.799 DEBUG  [engine] - ActionRunner Service: Starting...
2018-04-04 21:04:55.799 DEBUG  [engine] - Starting worker with id '1'
2018-04-04 21:04:55.799 DEBUG  [engine] - Starting worker with id '2'
2018-04-04 21:04:55.799 DEBUG  [engine] - Starting worker with id '3'
2018-04-04 21:04:55.799 DEBUG  [engine] - Starting worker with id '4'
2018-04-04 21:04:55.799 DEBUG  [engine] - Starting worker with id '5'
2018-04-04 21:04:55.799 DEBUG  [engine] - ActionRunner Service: Started
2018-04-04 21:04:55.799 INFO   [engine] - Started Services
2018-04-04 21:04:55.799 INFO   [engine] - Starting Triggers...
2018-04-04 21:04:55.799 DEBUG  [engine] - Trigger [ receive_http_message ]: Starting...
2018-04-04 21:04:55.800 DEBUG  [engine] - Trigger [ receive_http_message ]: Started
2018-04-04 21:04:55.800 INFO   [engine] - Trigger [ receive_http_message ]: Started
2018-04-04 21:04:55.800 INFO   [engine] - Triggers Started
2018-04-04 21:04:55.800 INFO   [engine] - Engine Started
2018-04-04 21:04:58.094 INFO   [trigger-flogo-rest] - Received request for id 'receive_http_message'
2018-04-04 21:04:58.094 DEBUG  [engine] - iomd &data.IOMetadata{Input:map[string]*data.Attribute{"csvData":(*data.Attribute)(0xc42012d440)}, Output:map[string]*data.Attribute{}}
2018-04-04 21:04:58.094 DEBUG  [basic-mapper] - Updated mapping def &{Type:1 Value:$.content.csv MapTo:csvData}
2018-04-04 21:04:58.094 DEBUG  [engine] - Action 'github.com/TIBCOSoftware/flogo-contrib/action/flow' queued
2018-04-04 21:04:58.094 DEBUG  [engine] - Received work request
2018-04-04 21:04:58.094 DEBUG  [engine] - Dispatching work request
2018-04-04 21:04:58.094 DEBUG  [engine] - Action-Worker-3: Received Request
2018-04-04 21:04:58.094 INFO   [engine] - Running FlowAction for URI: 'res://flow:my_flow'
2018-04-04 21:04:58.094 DEBUG  [engine] - Creating Flow Instance: f5ca71875ea2cb65dbaebc2ab34b00b6
2018-04-04 21:04:58.094 DEBUG  [engine] - Executing Flow Instance: f5ca71875ea2cb65dbaebc2ab34b00b6
2018-04-04 21:04:58.094 DEBUG  [flowmodel-simple] - Enter Task 'parsecsv_3'
2018-04-04 21:04:58.094 DEBUG  [flowmodel-simple] - Task 'parsecsv_3' Ready
2018-04-04 21:04:58.094 DEBUG  [engine] - Scheduling task 'parsecsv_3'
2018-04-04 21:04:58.094 DEBUG  [engine] - Step: 1
2018-04-04 21:04:58.094 DEBUG  [engine] - Retrieved item from Flow Instance work queue
2018-04-04 21:04:58.095 DEBUG  [flowmodel-simple] - Eval Task 'parsecsv_3'
2018-04-04 21:04:58.095 DEBUG  [engine] - Applying InputMapper
2018-04-04 21:04:58.095 DEBUG  [engine] - Action-Worker-3: Received result: &runner.ActionResult{results:map[string]*data.Attribute{"id":(*data.Attribute)(0xc420140480)}, err:error(nil)}
2018-04-04 21:04:58.095 DEBUG  [engine] - Action 'github.com/TIBCOSoftware/flogo-contrib/action/flow' returned
2018-04-04 21:04:58.095 DEBUG  [basic-mapper] - Updated mapping def &{Type:1 Value:$flow.csvData MapTo:csv}
2018-04-04 21:04:58.095 DEBUG  [engine] - SetAttr: csv = Data1,Data2,Data3
Data4,Data5,Data6
2018-04-04 21:04:58.095 DEBUG  [activity-flogo-parsecsv] - Output Object: [map[field1:Data1 field2:Data2 field3:Data3] map[field1:Data4 field2:Data5 field3:Data6]]
2018-04-04 21:04:58.095 DEBUG  [engine] - SET OUTPUT: output = [map[field1:Data1 field2:Data2 field3:Data3] map[field1:Data4 field2:Data5 field3:Data6]]

2018-04-04 21:04:58.095 DEBUG  [engine] - SetAttr: output = [map[field2:Data2 field3:Data3 field1:Data1] map[field1:Data4 field2:Data5 field3:Data6]]
2018-04-04 21:04:58.095 DEBUG  [engine] - Applying OutputMapper
2018-04-04 21:04:58.095 DEBUG  [engine] - AddAttr - name: _A.parsecsv_3.output, type: array, value:[map[field3:Data3 field1:Data1 field2:Data2] map[field1:Data4 field2:Data5 field3:Data6]]
2018-04-04 21:04:58.095 DEBUG  [flowmodel-simple] - Task 'parsecsv_3' is done
2018-04-04 21:04:58.095 DEBUG  [flowmodel-simple] - Task 'parsecsv_3' has 1 outgoing links
2018-04-04 21:04:58.095 DEBUG  [flowmodel-simple] - Task 'parsecsv_3': Following Link  to task 'log_4'
2018-04-04 21:04:58.095 DEBUG  [flowmodel-simple] - Enter Task 'log_4'
2018-04-04 21:04:58.095 DEBUG  [flowmodel-simple] - Task 'log_4' has 1 incoming Links
2018-04-04 21:04:58.096 DEBUG  [flowmodel-simple] - Task 'log_4': Link from Task 'parsecsv_3' has status 'true'
2018-04-04 21:04:58.096 DEBUG  [flowmodel-simple] - Task 'log_4' Ready
2018-04-04 21:04:58.096 DEBUG  [engine] - Scheduling task 'log_4'
2018-04-04 21:04:58.096 DEBUG  [engine] - Step: 2
2018-04-04 21:04:58.096 DEBUG  [engine] - Retrieved item from Flow Instance work queue
2018-04-04 21:04:58.096 DEBUG  [flowmodel-simple] - Eval Iterator Task 'log_4'
2018-04-04 21:04:58.096 DEBUG  [engine] - AddAttr - name: _E.activity, type: string, value:log_4
2018-04-04 21:04:58.096 DEBUG  [engine] - AddAttr - name: _E.message, type: string, value:unsupported type '%!s(<nil>)' for iterateOn
2018-04-04 21:04:58.096 DEBUG  [engine] - Done Executing flow instance [f5ca71875ea2cb65dbaebc2ab34b00b6] - Status: 700
2018-04-04 21:04:58.096 INFO   [engine] - Flow instance [f5ca71875ea2cb65dbaebc2ab34b00b6] Failed
2018-04-04 21:04:58.096 DEBUG  [engine] - Action-Worker-3: Received result: &runner.ActionResult{results:map[string]*data.Attribute(nil), err:(*errors.errorString)(0xc4201eab90)}
2018-04-04 21:04:58.096 DEBUG  [engine] - Action-Worker-3: Completed Request

Expected behavior:
The iterator to iterate over the output array from the previous activity.

Minimal steps to reproduce the problem (not required if feature enhancement):

What is the motivation / use case for changing the behavior?
Allow iteration over an array from a previous activity

Please tell us about your environment (Operating system, docker version, browser & web ui version, etc):

Flogo version (CLI & contrib/lib. If unknown, leave empty or state unknown): flogo-lib@master, [email protected]

Additional information you deem important (e.g. issue happens only occasionally):

@mellistibco mellistibco changed the title Cannot iterate over an output array from an activity Cannot iterate over an output array from a previous activity Apr 5, 2018
@mellistibco
Copy link
Collaborator Author

resolved in TIBCOSoftware/flogo-contrib#244

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

2 participants