io.holunda.camunda.taskpool.CamundaKotlinExtensions.kt Maven / Gradle / Ivy
package io.holunda.camunda.taskpool
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl
import org.camunda.bpm.engine.impl.interceptor.Command
import org.camunda.bpm.engine.impl.persistence.entity.IdentityLinkEntity
import org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity
/**
* Runs a command in command context.
*/
fun ProcessEngineConfigurationImpl.executeInCommandContext(command: Command): T {
return this.commandExecutorTxRequired.execute(command)
}
fun ProcessDefinitionEntity.candidateLinks(): List = this.identityLinks.filter { it.type == "candidate" }
/**
* Retrieves a set of candidate user ids allowed to start given process definition.
*/
fun ProcessDefinitionEntity.candidateUsers() = this.candidateLinks().filter { it.isUser }.map { it.userId }.toSet()
/**
* Retrieves a set of candidate group ids allowed to start given process definition.
*/
fun ProcessDefinitionEntity.candidateGroups() = this.candidateLinks().filter { it.isGroup }.map { it.groupId }.toSet()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy