mesg-foundation / engine

Build apps or autonomous workflows with reusable, shareable integrations connecting any service, app, blockchain or decentralized network.
https://mesg.com/
Apache License 2.0
130 stars 13 forks source link

Process steps cannot access to event data if not the first one #1523

Open NicolasMahe opened 4 years ago

NicolasMahe commented 4 years ago

The process steps cannot access to event data if they are not the first one. Here is a process where step #3 try to access to the trigger's event:

key: notification
steps:
  - type: trigger
    key: interval
    instance:
      src: https://github.com/mesg-foundation/service-emit-event-interval
    eventKey: every_10_seconds
  - type: task
    instance:
      src: ../service-crypto-tracker
    taskKey: get
    inputs:
      pair: 'btcusd'
      exchange_sym: 'bitfinex'
  - type: task
    instance:
      src: ../service-concat
    taskKey: concat
    inputs:
      p1: 'The price of BTC/USD on Bitfinex is '
      value:
        key: price
      p2: ' $ '
      date:
        stepKey: interval
        key: timestamp
  - type: task
    instance:
      src: ../service-telegram
      env:
        - 'TOKEN=$(env:TOKEN)'
        - 'CHAT_ID=$(env:CHAT_ID)'
    taskKey: pushNotify
NicolasMahe commented 4 years ago

I added two e2e tests about this that are skipped for now: https://github.com/mesg-foundation/engine/blob/dev/e2e/orchestrator_event_map_task_map_task_test.go and https://github.com/mesg-foundation/engine/blob/dev/e2e/orchestrator_result_map_task_map_task_test.go