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

io.holunda.camunda.taskpool.urlresolver.FormUrlResolverProperties.kt Maven / Gradle / Ivy

There is a newer version: 2.1.8
Show newest version
package io.holunda.camunda.taskpool.urlresolver

import io.holunda.camunda.taskpool.api.business.EntryType
import org.springframework.boot.context.properties.ConfigurationProperties

@ConfigurationProperties(prefix = "camunda.taskpool.form-url-resolver")
data class FormUrlResolverProperties(
  var defaultTaskTemplate: String = "",
  var defaultApplicationTemplate: String = "",
  var defaultProcessTemplate: String = "",
  var defaultBoTemplate: String = "",

  var applications: Map = mutableMapOf()

) {

  fun getTaskUrlTemplate(applicationName: String, taskDefinitionKey: String): String {
    val application = applications[applicationName] ?: return defaultTaskTemplate

    return application.tasks.getOrDefault(taskDefinitionKey, defaultTaskTemplate)
  }

  fun getProcessUrlTemplate(applicationName: String, processDefinitionKey: String): String {
    val application = applications[applicationName] ?: return defaultProcessTemplate
    return application.processes.getOrDefault(processDefinitionKey, defaultProcessTemplate)
  }

  fun getBoTemplate(applicationName: String, entryType: EntryType): String {
    val application = applications[applicationName] ?: return defaultBoTemplate
    return application.bos.getOrDefault(entryType, defaultBoTemplate)
  }

  fun getApplicationTemplate(applicationName: String): String {
    val application = applications[applicationName] ?: return defaultApplicationTemplate

    return application.url ?: defaultApplicationTemplate
  }

  data class Application(
    var url: String? = null,
    var tasks: Map = mutableMapOf(),
    var processes: Map = mutableMapOf(),
    var bos: Map = mutableMapOf()
  )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy