Knotx / knotx-fragments

Fragments map-reduce processing using Graph flows, supplier and assembler.
https://knotx.io
Apache License 2.0
3 stars 5 forks source link

Unique node id #93

Closed tomaszmichalak closed 4 years ago

tomaszmichalak commented 4 years ago

Is your feature request related to a problem? Please describe. Each node in a graph (a task) should be identifiable. It should be unique within a task scope and can change with each request.

Describe the solution you'd like The books-listing task configuration below:

books-listing {
  action = book
  onTransitions {
    _success {
      action = te-hbs
    }
  }
}

defines two nodes with actions: book and te-hbs. We should not use an action name as a key. The configuration above is transformed to:

rootNode {
  # node factory config
  factory = action
  config {
    # action node factory config
    action = book
  }
  onTransitions {
    _success {
      action = ${te-hbs-node}
    }
  }
}

te-hbs-node {
  # node factory config
  factory = action
  config {
    # action node factory config
    action = te-hbs
  }
  onTransitions {}
}

With this unique node id we should get:

Node identifier should be correctly set in:

Please note that some parts of graph can be configured dynamically (based on fragment or request) so this configuration can not be stored.

tomaszmichalak commented 4 years ago

Done.

tomaszmichalak commented 4 years ago

https://github.com/Knotx/knotx-fragments/pull/104