Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzilske committed Oct 16, 2024
2 parents f9cb56a + 7aadcf0 commit be05d95
Show file tree
Hide file tree
Showing 53 changed files with 1,183 additions and 245 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:

- name: Upload coverage to Codecov
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v4.6.0
with:
token: ${{secrets.CODECOV_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

- name: Upload coverage information
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>dev.bpm-crafters.process-engine-api</groupId>
<artifactId>process-engine-api-root</artifactId>
<version>0.1.1</version>
<version>0.2.0</version>
</parent>

<artifactId>process-engine-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>dev.bpm-crafters.process-engine-api</groupId>
<artifactId>process-engine-api-root</artifactId>
<version>0.1.1</version>
<version>0.2.0</version>
</parent>

<artifactId>process-engine-api-bom</artifactId>
Expand Down
28 changes: 19 additions & 9 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ you will also need to add some additional libraries. Here is the result:
<dependency>
<groupId>org.camunda.community.rest</groupId>
<artifactId>camunda-platform-7-rest-client-spring-boot-starter</artifactId>
<version>7.21.0</version>
<version>7.22.0</version>
</dependency>
<!-- open feign client -->
<dependency>
Expand Down Expand Up @@ -161,13 +161,22 @@ First add the corresponding adapter to your project's classpath:

<!-- We need the camunda client too -->
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
<groupId>io.camunda</groupId>
<artifactId>spring-boot-starter-camunda-sdk</artifactId>
<version>8.6.3</version>
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>java-common</artifactId>
<groupId>io.camunda</groupId>
<artifactId>camunda-tasklist-client-java</artifactId>
<version>8.6.0</version>
<exclusions>
<exclusion>
<groupId>io.camunda</groupId>
<artifactId>zeebe-client-java</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>
```

Expand All @@ -190,11 +199,12 @@ dev:
tasklist-url: https://${zeebe.client.cloud.region}.tasklist.camunda.io/${zeebe.client.cloud.clusterId}
fixed-rate-refresh-rate: 5000 # every 5 seconds

zeebe:
camunda:
client:
cloud:
region: ${ZEEBE_REGION}
clusterId: ${ZEEBE_CLUSTER_ID}
mode: saas
region: ${ZEEBE_REGION}
cluster-id: ${ZEEBE_CLUSTER_ID}
auth:
clientId: ${ZEEBE_CLIENT_ID}
clientSecret: ${ZEEBE_CLIENT_SECRET}

Expand Down
2 changes: 1 addition & 1 deletion engine-adapter/adapter-commons-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dev.bpm-crafters.process-engine-api</groupId>
<artifactId>process-engine-api-root</artifactId>
<version>0.1.1</version>
<version>0.2.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion engine-adapter/adapter-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dev.bpm-crafters.process-engine-api</groupId>
<artifactId>process-engine-api-root</artifactId>
<version>0.1.1</version>
<version>0.2.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import java.util.concurrent.Future

/**
* Abstract task subscription api implementation, using subscription repository and a list of completion strategies.
* @since 0.0.2
*/
abstract class AbstractTaskSubscriptionApiImpl(
private val subscriptionRepository: SubscriptionRepository
Expand All @@ -28,13 +29,14 @@ abstract class AbstractTaskSubscriptionApiImpl(
termination = cmd.termination
).let {
subscriptionRepository.createTaskSubscription(it)
logger.info { "Registered new task subscription $it" }
logger.info { "PROCESS-ENGINE-API-001: Registered new task subscription $it" }
CompletableFuture.completedFuture(it)
}
}

override fun unsubscribe(cmd: UnsubscribeFromTaskCmd): Future<Empty> {
subscriptionRepository.deleteTaskSubscription(ensure(cmd.subscription))
logger.info { "PROCESS-ENGINE-API-002: Un-registered new task subscription ${cmd.subscription}" }
return CompletableFuture.completedFuture(Empty)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package dev.bpmcrafters.processengineapi.adapter.commons.task

import dev.bpmcrafters.processengineapi.task.TaskHandler
import dev.bpmcrafters.processengineapi.task.TaskInformation

/**
* Composite task handler.
* @since 0.1.2
* @param handlers handlers to include.
*/
class CompositeTaskHandler(
private val handlers: MutableList<TaskHandler> = mutableListOf(),
) : TaskHandler {
/**
* Adds handler.
* @param handler handler to add.
*/
fun addHandler(handler: TaskHandler) {
handlers.add(handler)
}

/**
* Creates a new composite task handler out of current adding the given task handler.
* @param handler handler to add.
* @return composite handler.
*/
fun withHandler(handler: TaskHandler): CompositeTaskHandler {
return CompositeTaskHandler(handlers.plus(handler).toMutableList())
}

override fun accept(taskInformation: TaskInformation, payload: Map<String, Any>) {
handlers.forEach { it.accept(taskInformation, payload) }
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package dev.bpmcrafters.processengineapi.adapter.commons.task

import dev.bpmcrafters.processengineapi.task.TaskTerminationHandler

/**
* Composite task termination handler.
* @since 0.1.2
* @param handlers handlers to include.
*/
class CompositeTaskTerminationHandler(
private val handlers: MutableList<TaskTerminationHandler> = mutableListOf(),
) : TaskTerminationHandler {

/**
* Creates a new composite task termination handler out of current adding the given task termination handler.
* @param handler handler to add.
* @return composite handler.
*/
fun withHandler(handler: TaskTerminationHandler): CompositeTaskTerminationHandler {
return CompositeTaskTerminationHandler(handlers.plus(handler).toMutableList())
}

/**
* Adds handler.
* @param handler handler to add.
*/
fun addHandler(handler: TaskTerminationHandler) {
this.handlers.add(handler)
}

override fun accept(taskId: String) {
handlers.forEach { it.accept(taskId) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import java.util.concurrent.ConcurrentHashMap

/**
* Trivial in-memory implementation of the repository.
* @since 0.0.1
*/
class InMemSubscriptionRepository : SubscriptionRepository {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ package dev.bpmcrafters.processengineapi.adapter.commons.task

/**
* Refreshable delivery.
* @since 0.1.0
*/
interface RefreshableDelivery {
/**
* Triggers a refresh in the delivery.
*/
fun refresh()
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,22 @@ import dev.bpmcrafters.processengineapi.task.TaskType
*/
interface SubscriptionRepository {

/**
* Retrieves the list of subscriptions.
* @return list of subscriptions.
*/
fun getTaskSubscriptions(): List<TaskSubscriptionHandle>

/**
* Creates a new task subscription.
* @param subscription subscription to create.
*/
fun createTaskSubscription(subscription: TaskSubscriptionHandle)

/**
* Deletes existing task subscription.
* @param subscription subscription to delete.
*/
fun deleteTaskSubscription(subscription: TaskSubscriptionHandle)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import dev.bpmcrafters.processengineapi.task.TaskType

/**
* Task subscription handle.
* @since 0.0.1
*/
data class TaskSubscriptionHandle(
val taskType: TaskType,
Expand Down
Loading

0 comments on commit be05d95

Please sign in to comment.