-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/843 provide task list filter criteria #335
base: develop
Are you sure you want to change the base?
Changes from all commits
f58dff6
b9e3445
94bd90a
be8e46e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,6 +221,67 @@ paths: | |
'404': | ||
description: Task not found. | ||
|
||
'/tasks/payload/attribute/names': | ||
parameters: | ||
- $ref: '#/components/parameters/CurrentUserIdParam' | ||
- $ref: '#/components/parameters/FiltersParam' | ||
get: | ||
tags: | ||
- Task | ||
summary: Lists all available attribute names for task payload. | ||
operationId: getTasksAttributeNames | ||
responses: | ||
'200': | ||
description: Successful operation. | ||
content: | ||
application/json: | ||
schema: | ||
title: List of attribute names. | ||
type: array | ||
items: | ||
type: string | ||
|
||
headers: | ||
X-ElementCount: | ||
description: Number of elements in total. | ||
schema: | ||
type: integer | ||
'401': | ||
description: Not authenticated. | ||
'403': | ||
description: Not authorized. | ||
|
||
'/tasks/payload/attribute/{attributeName}/values': | ||
parameters: | ||
- $ref: '#/components/parameters/CurrentUserIdParam' | ||
- $ref: '#/components/parameters/AttributeNameParam' | ||
- $ref: '#/components/parameters/FiltersParam' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No filters in the API |
||
get: | ||
tags: | ||
- Task | ||
summary: Lists all available attribute values for given attribute name. | ||
operationId: getTasksAttributeValues | ||
responses: | ||
'200': | ||
description: Successful operation. | ||
content: | ||
application/json: | ||
schema: | ||
title: List of attribute values. | ||
type: array | ||
items: | ||
type: object | ||
|
||
headers: | ||
X-ElementCount: | ||
description: Number of elements in total. | ||
schema: | ||
type: integer | ||
'401': | ||
description: Not authenticated. | ||
'403': | ||
description: Not authorized. | ||
|
||
'/business-data-entries': | ||
parameters: | ||
- $ref: '#/components/parameters/CurrentUserIdParam' | ||
|
@@ -313,6 +374,14 @@ components: | |
schema: | ||
type: string | ||
|
||
AttributeNameParam: | ||
name: attributeName | ||
in: path | ||
description: Payload Attribute Name. | ||
required: true | ||
schema: | ||
type: string | ||
|
||
schemas: | ||
TaskWithDataEntries: | ||
type: object | ||
|
@@ -553,5 +622,3 @@ components: | |
username: | ||
type: string | ||
description: username of currently logged-in user. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,33 @@ class TaskResource( | |
return ResponseEntity.noContent().build() | ||
} | ||
|
||
override fun getTasksAttributeNames( | ||
xCurrentUserID: String, | ||
filters: List<String>? // FIXME -> no filters needed? | ||
): ResponseEntity<List<String>> { | ||
val user = userService.getUser(xCurrentUserID) | ||
val result = taskServiceGateway.getTaskAttributeNames(user) | ||
|
||
return ResponseEntity | ||
.ok() | ||
.headers(HttpHeaders().apply { this[HEADER_ELEMENT_COUNT] = result.totalElementCount.toString() }) | ||
.body(result.elements) | ||
} | ||
|
||
override fun getTasksAttributeValues( | ||
xCurrentUserID: String, | ||
attributeName: String, | ||
filters: List<String>? // FIXME -> no filters needed? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you see, the generated method signature is not matching the API call in line 169 |
||
): ResponseEntity<List<Any>> { | ||
val user = userService.getUser(xCurrentUserID) | ||
val result = taskServiceGateway.getTaskAttributeValues(attributeName, user) | ||
|
||
return ResponseEntity | ||
.ok() | ||
.headers(HttpHeaders().apply { this[HEADER_ELEMENT_COUNT] = result.totalElementCount.toString() }) | ||
.body(result.elements) | ||
} | ||
|
||
private fun getAuthorizedTask(taskId: String, user: User): Task = taskServiceGateway | ||
.getTask(taskId) | ||
.apply { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,7 @@ import io.holunda.polyflow.example.tasklist.adapter.rest.ElementNotFoundExceptio | |
import io.holunda.polyflow.view.Task | ||
import io.holunda.polyflow.view.TaskQueryClient | ||
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 io.holunda.polyflow.view.query.task.* | ||
import mu.KLogging | ||
import org.axonframework.commandhandling.gateway.CommandGateway | ||
import org.axonframework.queryhandling.QueryGateway | ||
|
@@ -56,4 +54,26 @@ class TaskServiceGateway( | |
filters = filters | ||
) | ||
).join() ?: throw ElementNotFoundException() | ||
|
||
fun getTaskAttributeNames( | ||
user: User, | ||
): TaskAttributeNamesQueryResult = taskQueryClient | ||
.query( | ||
TaskAttributeNamesQuery( | ||
user = user, | ||
assignedToMeOnly = false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because there are no filters in the query object |
||
) | ||
).join() ?: throw ElementNotFoundException() | ||
|
||
fun getTaskAttributeValues( | ||
attributeName: String, | ||
user: User, | ||
): TaskAttributeValuesQueryResult = taskQueryClient | ||
.query( | ||
TaskAttributeValuesQuery( | ||
attributeName = attributeName, | ||
user = user, | ||
assignedToMeOnly = false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because there are no filters in the query object |
||
) | ||
).join() ?: throw ElementNotFoundException() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-scenario-root</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>polyflow-example-scenario-single-node-simple</artifactId> | ||
<name>examples/${project.artifactId}</name> | ||
|
||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Frontends see below in the profile--> | ||
<!-- Core --> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-taskpool-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-datapool-core</artifactId> | ||
</dependency> | ||
|
||
<!-- Tasklist --> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-tasklist-backend</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-form-url-resolver</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-view-simple</artifactId> | ||
</dependency> | ||
|
||
<!-- Process application --> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-approval-backend</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.axonframework</groupId> | ||
<artifactId>axon-server-connector</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.flywaydb</groupId> | ||
<artifactId>flyway-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-infrastructure</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<!-- for packaging springboot application --> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<requiresUnpack> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-process-backend</artifactId> | ||
</dependency> | ||
</requiresUnpack> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>frontend</id> | ||
<activation> | ||
<property> | ||
<name>!skipFrontend</name> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-approval-forms</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.holunda.polyflow</groupId> | ||
<artifactId>polyflow-example-tasklist-angular</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
|
||
<profile> | ||
<id>camunda-ce</id> | ||
<activation> | ||
<property> | ||
<name>!camunda-ee</name> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.camunda.bpm.springboot</groupId> | ||
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
|
||
<profile> | ||
<id>camunda-ee</id> | ||
<activation> | ||
<property> | ||
<name>camunda-ee</name> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.camunda.bpm.springboot</groupId> | ||
<artifactId>camunda-bpm-spring-boot-starter-webapp-ee</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
</profiles> | ||
|
||
|
||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no filters in the api anymore