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

camundala.helper.setup.DmnGenerator.scala Maven / Gradle / Ivy

There is a newer version: 1.30.23
Show newest version
package camundala.helper.setup

import camundala.api.docs.DependencyConf

case class DmnGenerator()(using config: SetupConfig):

  lazy val generate: Unit =
    createIfNotExists(dmnPath() / "ProjectDmnTester.scala", dmnTester)

  lazy val dmnTester: String =
    s"""package ${config.projectPackage}.dmn
       |
       |import ${config.projectPackage}.bpmn.*
       |
       |// dmn/run
       |object ProjectDmnTester extends ValiantDmnTester:
       |
       |  createDmnConfigs(
       |    // myDmn
       |  )
       |  /* example:
       |  private lazy val myDmn =
       |    import myProcess.v1.*
       |
       |    MyDmn.example
       |      .testUnit
       |      .testValues(
       |        _.value,
       |        1,
       |        2
       |      )
       |      .testValues(
       |        _.age,
       |        64,
       |        65,
       |        66
       |      )
       |  */
       |
       |end ProjectDmnTester""".stripMargin
  end dmnTester

  private def dmnPath(setupElement: Option[SetupElement] = None) =
    val dir =
      config.projectDir / ModuleConfig.dmnModule.packagePath(config.projectPath)

    os.makeDir.all(dir)
    dir
  end dmnPath

end DmnGenerator




© 2015 - 2024 Weber Informatics LLC | Privacy Policy