Skip to content

Bump polyflow.version from 4.2.2 to 4.4.0 #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import io.holunda.polyflow.taskpool.EnableTaskpoolEngineSupport
import io.holunda.polyflow.taskpool.collector.task.enricher.*
import io.holunda.polyflow.taskpool.sender.gateway.CommandErrorHandler
import io.holunda.polyflow.taskpool.sender.gateway.LoggingTaskCommandErrorHandler
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.commandhandling.CommandResultMessage
import org.camunda.bpm.spring.boot.starter.annotation.EnableProcessApplication
import org.springframework.boot.autoconfigure.domain.EntityScan
Expand All @@ -25,6 +25,8 @@ import org.springframework.context.annotation.Import
import org.springframework.context.annotation.Primary
import org.springframework.data.jpa.repository.config.EnableJpaRepositories

private val logger = KotlinLogging.logger {}

@Configuration
@EnableProcessApplication
@EnableTaskpoolEngineSupport
Expand All @@ -38,8 +40,6 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories
)
class RequestApprovalProcessConfiguration {

companion object : KLogging()

@Bean
fun processVariablesFilter(): ProcessVariablesFilter = ProcessVariablesFilter(
// define a variable filter for every task inside the process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import io.holunda.polyflow.example.process.approval.adapter.rest.model.TaskAmend
import io.holunda.polyflow.example.process.approval.adapter.rest.request
import io.holunda.polyflow.example.process.approval.adapter.rest.taskDto
import io.holunda.polyflow.view.auth.UserService
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional

private val logger = KotlinLogging.logger {}

@Component
class AmendRequestResource(
private val requestApprovalProcessBean: RequestApprovalProcessBean,
private val userService: UserService
) : UserTaskAmendRequestApiDelegate {

companion object : KLogging()

override fun loadTaskAmendRequestFormData(
id: String,
xCurrentUserID: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import io.holunda.polyflow.example.process.approval.adapter.rest.model.TaskAppro
import io.holunda.polyflow.example.process.approval.adapter.rest.model.TaskApproveRequestSubmitDataDto
import io.holunda.polyflow.example.process.approval.adapter.rest.taskDto
import io.holunda.polyflow.view.auth.UserService
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional

private val logger = KotlinLogging.logger {}

@Component
class ApproveRequestResource(
private val requestApprovalProcessBean: RequestApprovalProcessBean,
private val userService: UserService
) : UserTaskApproveRequestApiDelegate {

companion object : KLogging()

override fun loadTaskApproveRequestFormData(
id: String,
xCurrentUserID: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import io.holunda.polyflow.example.process.approval.process.AssignmentCommand
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcessBean
import io.holunda.polyflow.example.process.approval.adapter.rest.api.UserTaskAssignmentApiDelegate
import io.holunda.polyflow.example.process.approval.adapter.rest.model.TaskAssignmentDto
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.commandhandling.CommandMessage
import org.axonframework.commandhandling.CommandResultMessage
import org.axonframework.commandhandling.gateway.CommandGateway
import org.springframework.http.ResponseEntity
import org.springframework.http.ResponseEntity.noContent
import org.springframework.stereotype.Component

private val logger = KotlinLogging.logger {}

@Component
class AssignmentResource(
private val requestApprovalProcessBean: RequestApprovalProcessBean,
private val commandGateway: CommandGateway
) : UserTaskAssignmentApiDelegate {

companion object : KLogging()

override fun submitTaskAssignmentChange(
taskId: String,
xCurrentUserID: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ import io.holunda.polyflow.view.auth.User
import io.holunda.polyflow.view.auth.UserService
import io.holunda.polyflow.view.query.data.DataEntriesForUserQuery
import io.holunda.polyflow.view.query.data.DataEntriesQueryResult
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.messaging.GenericMessage
import org.axonframework.queryhandling.QueryGateway
import org.springframework.http.ResponseEntity
import org.springframework.http.ResponseEntity.noContent
import org.springframework.http.ResponseEntity.ok
import org.springframework.stereotype.Component

private val logger = KotlinLogging.logger {}

@Component
class RequestResource(
private val requestApprovalProcessBean: RequestApprovalProcessBean,
Expand All @@ -33,9 +35,6 @@ class RequestResource(
private val objectMapper: ObjectMapper
) : RequestApiDelegate {

companion object : KLogging()


override fun startNewApproval(
xCurrentUserID: String,
approvalRequestDraftDto: ApprovalRequestDraftDto,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package io.holunda.polyflow.example.process.approval.adapter.workflow.listener

import io.holunda.polyflow.taskpool.collector.task.TaskEventCollectorService
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.camunda.bpm.engine.delegate.DelegateTask
import org.springframework.context.event.EventListener
import org.springframework.core.annotation.Order
import org.springframework.stereotype.Component

private val logger = KotlinLogging.logger {}

@Component
class LoggingTaskListener {

companion object : KLogging()

@EventListener(condition = "#task.eventName.equals('create')")
@Order(TaskEventCollectorService.ORDER - 9)
fun logTaskCreation(task: DelegateTask) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package io.holunda.polyflow.example.process.approval.schedule
import io.holunda.polyflow.example.process.approval.process.RequestApprovalProcessBean
import io.holunda.polyflow.example.process.approval.service.RequestService
import io.holunda.polyflow.example.process.approval.service.BusinessDataEntry
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.camunda.bpm.spring.boot.starter.event.PostDeployEvent
import org.springframework.context.event.EventListener
import org.springframework.stereotype.Component

private val logger = KotlinLogging.logger {}

/**
* This configuration makes sure that some processes are started directly
* after empty system initialization to demonstrate how the system looks like
Expand All @@ -19,7 +21,7 @@ class PrefillingConfiguration(
private val requestService: RequestService
) {

companion object : KLogging() {
companion object {
const val MIN_INSTANCES = 1L
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.holunda.polyflow.example.process.approval.process.RequestApprovalProce
import io.holunda.polyflow.example.process.approval.service.RequestService
import io.holunda.polyflow.example.process.approval.service.BusinessDataEntry
import io.holunda.polyflow.example.users.UserStoreService
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Profile
Expand All @@ -19,15 +19,15 @@ import java.util.concurrent.atomic.AtomicLong
@Profile("scheduled-processes")
class ScheduledConfiguration

private val logger = KotlinLogging.logger {}

@Component
class ScheduledStarter(
private val processApprovalProcessBean: RequestApprovalProcessBean,
private val requestService: RequestService,
private val userStoreService: UserStoreService
) {

companion object : KLogging()

@Value("\${scheduled-processes.limit:1000}")
private var limit: Long = 999
private lateinit var requestInfo: Pair<String, AtomicLong>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package io.holunda.polyflow.example.process.approval.service

import io.github.oshai.kotlinlogging.KotlinLogging
import io.holixon.axon.gateway.query.QueryResponseMessageResponseType
import io.holunda.polyflow.example.users.UserStoreService
import io.holunda.polyflow.view.ProcessInstanceState
import io.holunda.polyflow.view.query.process.ProcessInstanceQueryResult
import io.holunda.polyflow.view.query.process.ProcessInstancesByStateQuery
import mu.KLogging
import org.axonframework.queryhandling.QueryGateway
import org.springframework.boot.ApplicationRunner
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

private val logger = KotlinLogging.logger {}

@Configuration
class SystemInfoPrinter(
Expand All @@ -20,16 +21,14 @@ class SystemInfoPrinter(
private val queryGateway: QueryGateway
) {

companion object : KLogging()

@Bean
fun requestPrinter(): ApplicationRunner {
return ApplicationRunner {
try {
val requests = requestService.getAllRequests(1)
logger.info("Found ${requests.size} requests.")
logger.info { "Found ${requests.size} requests." }
requests.forEach {
logger.info("Request $it")
logger.info { "Request $it" }
}
} catch (e: Exception) {
logger.error(e) { "Error loading requests" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@ import io.holunda.polyflow.example.tasklist.adapter.rest.model.TaskWithDataEntri
import io.holunda.polyflow.view.Task
import io.holunda.polyflow.view.auth.User
import io.holunda.polyflow.view.auth.UserService
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.camunda.bpm.engine.variable.Variables
import org.springframework.http.HttpHeaders
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Component
import java.time.OffsetDateTime
import java.util.*

private val logger = KotlinLogging.logger {}

@Component
class TaskResource(
private val taskServiceGateway: TaskServiceGateway,
private val userService: UserService,
private val mapper: TaskWithDataEntriesMapper
) : TaskApiDelegate {

companion object : KLogging() {
companion object {
const val HEADER_ELEMENT_COUNT = "X-ElementCount"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import io.holunda.polyflow.view.auth.User
import io.holunda.polyflow.view.query.task.TaskForIdQuery
import io.holunda.polyflow.view.query.task.TasksWithDataEntriesForUserQuery
import io.holunda.polyflow.view.query.task.TasksWithDataEntriesQueryResult
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.commandhandling.gateway.CommandGateway
import org.axonframework.queryhandling.QueryGateway
import org.springframework.stereotype.Component

private val logger = KotlinLogging.logger {}

@Component
class TaskServiceGateway(
queryGateway: QueryGateway,
val commandGateway: CommandGateway
) {

companion object : KLogging()

val taskQueryClient = TaskQueryClient(queryGateway)

fun send(command: InteractionTaskCommand) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import org.mockito.kotlin.whenever
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.http.MediaType
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.context.bean.override.mockito.MockitoBean
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
Expand All @@ -33,7 +33,7 @@ internal class TaskResourceIT {
@Autowired
private lateinit var mockMvc: MockMvc

@MockBean
@MockitoBean
private lateinit var taskServiceGateway: TaskServiceGateway

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import io.holunda.polyflow.view.TaskWithDataEntries
import io.holunda.polyflow.view.auth.UserService
import io.holunda.polyflow.view.query.task.TasksWithDataEntriesForUserQuery
import io.holunda.polyflow.view.query.task.TasksWithDataEntriesQueryResult
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.messaging.responsetypes.ResponseTypes
import org.axonframework.queryhandling.QueryGateway
import org.axonframework.queryhandling.SubscriptionQueryResult
Expand All @@ -19,6 +19,8 @@ import java.util.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern

private val logger = KotlinLogging.logger {}

/**
* Reactive controller delivering tasks.
*/
Expand All @@ -31,8 +33,6 @@ class ReactiveTasksController(
private val mapper: TaskWithDataEntriesMapper
) {

companion object : KLogging()

@GetMapping(path = ["/tasks"], produces = [MediaType.TEXT_EVENT_STREAM_VALUE, MediaType.APPLICATION_JSON_VALUE])
fun getTasks(
@NotNull @Pattern(regexp = "^([\\w]*)=([.]+)?$") @RequestParam(value = "filter", required = true, defaultValue = "[]") filters: List<String>,
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


<springboot.version>3.4.5</springboot.version>
<polyflow.version>4.2.2</polyflow.version>
<polyflow.version>4.4.0</polyflow.version>

<camunda-ce.version>7.21.0</camunda-ce.version>
<camunda-ee.version>7.21.0-ee</camunda-ee.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package io.holunda.polyflow.example.other

import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.commandhandling.CommandHandler
import org.axonframework.eventsourcing.EventSourcingHandler
import org.axonframework.modelling.command.AggregateIdentifier
import org.axonframework.modelling.command.AggregateLifecycle
import org.axonframework.spring.stereotype.Aggregate

private val logger = KotlinLogging.logger {}

@Aggregate
class OtherAggregate {

@AggregateIdentifier
private lateinit var id: String

companion object: KLogging() {
companion object {
@JvmStatic
@CommandHandler
fun create(cmd: OtherAggregateCreateCommand) = OtherAggregate().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package io.holunda.camunda.taskpool.cockpit.rest.impl
import io.holunda.camunda.taskpool.api.task.DeleteTaskCommand
import io.holunda.camunda.taskpool.cockpit.rest.Rest
import io.holunda.camunda.taskpool.cockpit.service.TaskPoolCockpitService
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.axonframework.commandhandling.gateway.CommandGateway
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import reactor.core.publisher.Mono

private val logger = KotlinLogging.logger {}

/**
* Task operation controller.
*/
Expand All @@ -21,8 +23,6 @@ class CockpitTaskOperationController(
private val cockpitService: TaskPoolCockpitService
) {

companion object : KLogging()

/**
* Send a command for a specific task.
*/
Expand Down
Loading