All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.touk.nussknacker.ui.process.repository.ScenarioComponentsUsagesHelper.scala Maven / Gradle / Ivy

There is a newer version: 1.17.0
Show newest version
package pl.touk.nussknacker.ui.process.repository

import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess
import pl.touk.nussknacker.engine.node.ComponentIdExtractor
import pl.touk.nussknacker.engine.util.Implicits.RichTupleList
import pl.touk.nussknacker.restmodel.component.ScenarioComponentsUsages

object ScenarioComponentsUsagesHelper {

  def compute(scenario: CanonicalProcess): ScenarioComponentsUsages = {
    val usagesList = for {
      node        <- scenario.collectAllNodes
      componentId <- ComponentIdExtractor.fromScenarioNode(node)
    } yield {
      (componentId, node.id)
    }
    val usagesMap = usagesList.toGroupedMap
    ScenarioComponentsUsages(usagesMap)
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy