Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
|
542fb26fe2 | |
|
87e4f75b9c | |
|
205fa56baa | |
|
4ca0ae869f | |
|
3646bc08b1 | |
|
af83e06000 | |
|
abd2735f26 | |
|
f4bd23bac2 | |
|
26e3c80f47 | |
|
02875ca1ce | |
|
c181417cf9 |
|
@ -7,6 +7,7 @@ updates:
|
|||
time: "06:00"
|
||||
timezone: Europe/Berlin
|
||||
open-pull-requests-limit: 99
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
@ -14,10 +15,3 @@ updates:
|
|||
time: "06:00"
|
||||
timezone: Europe/Berlin
|
||||
open-pull-requests-limit: 99
|
||||
- package-ecosystem: docker
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "06:00"
|
||||
timezone: Europe/Berlin
|
||||
open-pull-requests-limit: 99
|
||||
|
|
|
@ -1,15 +1,25 @@
|
|||
<!-- if needed please write above the given line -->
|
||||
### Thanks for your PR! Please fill out the following list :)
|
||||
|
||||
---
|
||||
- [ ] I put the ticket or multiple tickets in review
|
||||
- [ ] Commit message format → Closes #<Issue Number> - Your commit message.
|
||||
- [ ] Sonarcloud link : \<add the link here>
|
||||
- [ ] No documentation update needed
|
||||
- [ ] Link to PR with documentation update: \<add the link here>
|
||||
- [ ] No Release Notes needed
|
||||
- [ ] Release Notes :
|
||||
Release Notes:
|
||||
<!-- Please write your release notes between ```-->
|
||||
```
|
||||
|
||||
```
|
||||
<!-- please don't delete/modify the checklist -->
|
||||
### For the submitter:
|
||||
- [ ] I updated the [documentation](https://taskana.atlassian.net/wiki/spaces/TAS/overview) and will supply links to the specific files
|
||||
- [ ] I did not update the [documentation](https://taskana.atlassian.net/wiki/spaces/TAS/overview)
|
||||
- [ ] I included a link to the [SonarCloud branch analysis](https://taskana.atlassian.net/wiki/spaces/TAS/pages/1019969636/SonarCloud+Integration)
|
||||
- [ ] After integration of the PR, I added a description of changes on the [current release notes](https://taskana.atlassian.net/wiki/spaces/TAS/pages/1281392672/Current+Release+Notes+Taskana)
|
||||
- [ ] I did not update the [current release notes](https://taskana.atlassian.net/wiki/spaces/TAS/pages/1281392672/Current+Release+Notes+Taskana)
|
||||
- [ ] I put the ticket in review
|
||||
- [ ] After integration of the pull request, I verified our [bluemix test environment](http://taskana.mybluemix.net/taskana) is not broken
|
||||
|
||||
### Verified by the reviewer:
|
||||
- [ ] Commit message format → (Closes) #<Issue Number>: Your commit message. i.e. Closes #2271: Your commit message.
|
||||
- [ ] Submitter's update to [documentation](https://taskana.atlassian.net/wiki/spaces/TAS/overview) is sufficient
|
||||
- [ ] SonarCloud analysis meets our standards
|
||||
- [ ] Update of the [current release notes](https://taskana.atlassian.net/wiki/spaces/TAS/pages/1281392672/Current+Release+Notes+Taskana) reflects changes
|
||||
- [ ] PR fulfills the ticket
|
||||
- [ ] Edge cases and unwanted side effects are tested
|
||||
- [ ] Readability
|
||||
|
|
|
@ -40,13 +40,13 @@ jobs:
|
|||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
id: cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
|
@ -54,23 +54,23 @@ jobs:
|
|||
- name: Change versions to match tag
|
||||
run: ci/change_version.sh -m .
|
||||
- name: Compile & build
|
||||
run: ./mvnw -B install -DskipTests -Djacoco.skip
|
||||
run: ./mvnw -B install -DskipTests -Dasciidoctor.skip -Djacoco.skip
|
||||
- name: Populate cache
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
./mvnw -B dependency:go-offline
|
||||
./mvnw -B test -Dtest=GibtEsNet -Dsurefire.failIfNoSpecifiedTests=false
|
||||
- name: Upload taskana artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
if-no-files-found: error
|
||||
- name: Remove taskana artifacts from cache
|
||||
run: rm -rf ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
run: rm -rf ~/.m2/repository/pro/taskana
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
compile_frontend:
|
||||
name: Compile taskana-web
|
||||
|
@ -79,23 +79,23 @@ jobs:
|
|||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v4.0.3
|
||||
uses: actions/setup-node@v3.8.1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Cache web dependencies
|
||||
id: web-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: web/node_modules
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: Cache maven dependencies (for web)
|
||||
id: maven-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_MAVEN_FOR_WEB_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
|
@ -115,7 +115,7 @@ jobs:
|
|||
- name: Build maven artifact
|
||||
run: ./mvnw -B install -pl :taskana-web -am
|
||||
- name: Upload taskana-web dist artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
|
@ -124,7 +124,7 @@ jobs:
|
|||
run: rm -rf ~/.m2/repository/pro/taskana
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
test_frontend:
|
||||
runs-on: ubuntu-20.04
|
||||
|
@ -134,12 +134,12 @@ jobs:
|
|||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v4.0.3
|
||||
uses: actions/setup-node@v3.8.1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Cache web dependencies
|
||||
id: web-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: web/node_modules
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}-${{ hashFiles('**/yarn.lock') }}
|
||||
|
@ -151,7 +151,7 @@ jobs:
|
|||
run: yarn ci
|
||||
- name: Cache maven dependencies (for web)
|
||||
id: maven-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_MAVEN_FOR_WEB_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
|
@ -166,7 +166,7 @@ jobs:
|
|||
run: yarn run test -- --coverageReporters text-summary
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
test_e2e:
|
||||
runs-on: ubuntu-20.04
|
||||
|
@ -176,17 +176,17 @@ jobs:
|
|||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v4.0.3
|
||||
uses: actions/setup-node@v3.8.1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Cache web dependencies
|
||||
id: web-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: web/node_modules
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}-${{ hashFiles('**/yarn.lock') }}
|
||||
|
@ -198,12 +198,12 @@ jobs:
|
|||
run: yarn ci
|
||||
- name: Cache maven dependencies
|
||||
id: maven-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
|
@ -215,7 +215,7 @@ jobs:
|
|||
run: ./mvnw -B dependency:go-offline -pl :taskana-rest-spring-example-boot -am
|
||||
if: steps.maven-cache.outputs.cache-hit != 'true'
|
||||
- name: Download taskana-web dist artifact
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
|
@ -228,13 +228,13 @@ jobs:
|
|||
npx wait-port -t 30000 localhost:8080 && yarn run e2e-standalone --spec "cypress/integration/monitor/**"
|
||||
- name: Upload Cypress tests
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_CYPRESS_TESTS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_CYPRESS_TESTS_PATH }}
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
test_backend:
|
||||
runs-on: ubuntu-20.04
|
||||
|
@ -300,18 +300,18 @@ jobs:
|
|||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
|
@ -319,23 +319,26 @@ jobs:
|
|||
run: |
|
||||
ci/change_version.sh -m .
|
||||
ci/update_taskana_dependency_for_wildfly.sh
|
||||
- name: Generate JavaDoc for Rest Documentation
|
||||
if: matrix.module == 'taskana-simplehistory-rest-spring'
|
||||
run: ./mvnw -B validate -pl :taskana-rest-spring
|
||||
- name: Test
|
||||
run: ./mvnw -B verify -pl :${{matrix.module}} -Dcheckstyle.skip
|
||||
env:
|
||||
DB: ${{ matrix.database }}
|
||||
- name: Upload JaCoCo Report
|
||||
if: matrix.database == 'H2'
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_JACOCO_REPORTS_NAME }}-${{ matrix.module }}
|
||||
name: ${{ env.ARTIFACTS_JACOCO_REPORTS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_JACOCO_REPORTS_PATH }}
|
||||
if-no-files-found: ignore
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
release_artifacts:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-20.04
|
||||
name: Release artifacts to OSS Sonatype
|
||||
if: github.repository == 'Taskana/taskana' && ( startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master' ) && github.head_ref == ''
|
||||
needs: [ test_frontend, test_e2e, test_backend ]
|
||||
|
@ -354,23 +357,23 @@ jobs:
|
|||
# source: https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/7
|
||||
token: ${{ secrets.ADMIN_PERSONAL_ACCESS_TOKEN }}
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Download taskana-web dist artifact
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
|
@ -383,7 +386,7 @@ jobs:
|
|||
- name: Release artifacts to OSS Sonatype
|
||||
run: |
|
||||
./mvnw -B deploy -P $([[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot") \
|
||||
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -Djacoco.skip \
|
||||
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip -Djacoco.skip \
|
||||
-pl :taskana-parent,\
|
||||
:taskana-common-parent,:taskana-common-logging,:taskana-common,:taskana-common-security,\
|
||||
:taskana-common-data,:taskana-common-test,\
|
||||
|
@ -406,7 +409,7 @@ jobs:
|
|||
GH_USERNAME: ${{ secrets.GH_USERNAME }}
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
deploy_to_azure:
|
||||
runs-on: ubuntu-20.04
|
||||
|
@ -417,23 +420,23 @@ jobs:
|
|||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Download taskana-web dist artifact
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
|
@ -441,16 +444,18 @@ jobs:
|
|||
run: ./mvnw -B install -pl :taskana-web
|
||||
- name: Generate Javadoc
|
||||
run: ./mvnw -B clean javadoc:jar -pl :taskana-core,:taskana-cdi,:taskana-spring
|
||||
- name: Generate Rest Documentation
|
||||
run: ./mvnw -B test asciidoctor:process-asciidoc -Dtest=*DocTest -pl :taskana-rest-spring,:taskana-simplehistory-rest-spring,:taskana-routing-rest -Dcheckstyle.skip -Djacoco.skip
|
||||
- name: Build Example Application
|
||||
run: ./mvnw -B install -P history.plugin -P dmn-routing.plugin -pl :taskana-rest-spring-example-boot -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip -Djacoco.skip
|
||||
- name: Verify Example Application contains documentation
|
||||
run: ci/verify_docs_jar.sh
|
||||
- name: Login to Microsoft Azure
|
||||
uses: Azure/login@v2
|
||||
uses: Azure/login@v1
|
||||
with:
|
||||
creds: '{"clientId":"${{ secrets.CLIENT_ID }}","clientSecret":"${{ secrets.CLIENT_SECRET }}","subscriptionId":"${{ secrets.SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TENANT_ID }}"}'
|
||||
- name: Deploy to Microsoft Azure
|
||||
uses: Azure/webapps-deploy@v3
|
||||
uses: Azure/webapps-deploy@v2
|
||||
with:
|
||||
app-name: taskana
|
||||
package: rest/taskana-rest-spring-example-boot/target/taskana-rest-spring-example-boot.jar
|
||||
|
@ -462,7 +467,7 @@ jobs:
|
|||
run: ci/verify_docs_alive.sh
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
||||
upload_to_sonar:
|
||||
runs-on: ubuntu-20.04
|
||||
|
@ -476,29 +481,28 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: adopt
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-${{ env.CACHE_SONAR_NAME }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_SONAR_NAME }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download JaCoCo reports
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
pattern: ${{ env.ARTIFACTS_JACOCO_REPORTS_NAME }}-*
|
||||
merge-multiple: true
|
||||
name: ${{ env.ARTIFACTS_JACOCO_REPORTS_NAME }}
|
||||
- name: Install taskana
|
||||
run: ./mvnw -B install -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip
|
||||
run: ./mvnw -B install -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip -Dmaven.javadoc.skip
|
||||
- name: Upload SonarQube analysis
|
||||
run: ./mvnw -B sonar:sonar
|
||||
env:
|
||||
|
@ -508,4 +512,4 @@ jobs:
|
|||
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.5
|
||||
uses: andymckay/cancel-action@0.3
|
||||
|
|
|
@ -14,5 +14,5 @@
|
|||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
|
||||
|
|
223
README.md
|
@ -8,224 +8,37 @@ TASKANA - The open source task management library
|
|||
[](https://maven-badges.herokuapp.com/maven-central/pro.taskana/taskana-core)
|
||||
[](http://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
|
||||
TASKANA is a task management component open source library. It can be embedded into your application
|
||||
or be operated standalone if appropriate. Beside the basic task management functionalities,
|
||||
TASKANA adds workbaskets and classifications to control and monitor a large amount of Tasks within
|
||||
a larger organization.
|
||||
TASKANA is a task management component open source library. It can be embedded into your application or be operated standalone if appropriate. Beside the basic task management functionalities, TASKANA adds workbaskets and classifications to control and monitor a large amount of tasks within a larger organization.
|
||||
|
||||
* Web Site: http://taskana.pro/
|
||||
* Demo Environment: https://taskana.azurewebsites.net/taskana
|
||||
* Getting Started: https://taskana.atlassian.net/wiki/spaces/TAS/pages/228655109/Getting+started
|
||||
* Issue Tracker: https://github.com/Taskana/taskana/issues
|
||||
* Issue Tracker: https://taskana.atlassian.net
|
||||
* Contribution Guildelines: https://taskana.atlassian.net/wiki/spaces/TAS/pages/274202625/Contribution+Guide
|
||||
* License: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
---
|
||||
_We're not aware of all installations of our Open Source project. However, we love_
|
||||
* _listening to your feedback,_
|
||||
* _discussing possible use cases with you,_
|
||||
* _aligning the roadmap to your needs!_
|
||||
Components
|
||||
----------
|
||||
|
||||
📨 _Please [contact](#contact) us if you need consulting support._
|
||||
TASKANA splits up into five components:
|
||||
|
||||
---
|
||||
#### TASKANA core
|
||||
* The Java library providing the task management functions
|
||||
|
||||
# Table of Contents
|
||||
|
||||
* ✨ [Overview](#Overview)
|
||||
* [Tasks](#Tasks)
|
||||
* [Workbasket](#workbasket)
|
||||
* [Classification](#classification)
|
||||
* [Routing](#routing)
|
||||
* [Prioritization](#prioritization)
|
||||
* [Components](#components)
|
||||
* [TASKANA Lib](#Taskana-lib)
|
||||
* [TASKANA REST API](#Taskana-rest-api)
|
||||
* [TASKANA workplace](#Taskana-workplace)
|
||||
* [TASKANA admin](#Taskana-admin)
|
||||
* [TASKANA monitor](#Taskana-monitor)
|
||||
* 🚀 [Getting Started](#getting-started)
|
||||
* [Requirements](#requirements)
|
||||
* [Wrapper Application](#wrapper-application)
|
||||
* [Spring Boot Example](#spring-boot-example)
|
||||
* [EJB Example](#ejb-example)
|
||||
* [Customize Behaviour](#customize-behaviour)
|
||||
* 📚 [Releases](#releases)
|
||||
* 📨 [Contact](#contact)
|
||||
|
||||
|
||||
# ✨Overview
|
||||
|
||||
## TASKS
|
||||
|
||||
Tasks are the main entity of TASKANA. Each Task has its describing attributes like priority and due
|
||||
date.
|
||||
|
||||
Furthermore each Task has a state.
|
||||
|
||||
And a Task holds a reference to the system and business object, it is associated with. This is
|
||||
important since is meant to be a standalone component.
|
||||
|
||||
All Tasks are placed in a Workbasket to control and direct the handling of the Tasks.
|
||||
|
||||

|
||||
|
||||
## WORKBASKETS
|
||||
|
||||
Workbaskets are the main structure to distribute the Tasks to the available users. There are
|
||||
personal, group/team and topic Workbaskets.
|
||||
|
||||
Workbaskets indicate the responsibility for a Task. The concepts of Workbaskets allow to
|
||||
differentiate between the permissions or the skills required to complete a Tasks and the
|
||||
determination who should complete the Tasks. This can diverge a lot in a larger organization.
|
||||
|
||||

|
||||
|
||||
## CLASSIFICATIONS
|
||||
|
||||
Classifications allow to identify the type of a Task. The Task derives some major attributes from
|
||||
the Classification, such as the service level and the priority.
|
||||
|
||||
Classifications can be configured by a responsible business administrator to control the handling
|
||||
of the Tasks.
|
||||
|
||||
## Routing
|
||||
|
||||
It offers various routing and distribution functions to assign incoming Tasks to the correct
|
||||
Workbaskets, or to redistribute them between Workbaskets.
|
||||
|
||||

|
||||
|
||||
## Prioritization
|
||||
|
||||
The dynamic prioritization functions in allow you to control the processing sequence of
|
||||
Tasks at any time. This ensures that the most important Tasks are always addressed first.
|
||||
|
||||

|
||||
|
||||
# Components
|
||||
|
||||

|
||||
|
||||
It splits up into five components:
|
||||
|
||||
* TASKANA Lib
|
||||
* The Java library providing the Task management functions
|
||||
* TASKANA REST API
|
||||
#### TASKANA REST API
|
||||
* REST API to allow remote access to the TASKANA system.
|
||||
* TASKANA workplace
|
||||
* Angular based web application to work on the Tasks
|
||||
* Sample Tasklist application you can use if appropriate
|
||||
* TASKANA admin
|
||||
|
||||
#### TASKANA workplace
|
||||
* Angular based web application to work on the tasks
|
||||
* Sample tasklist application you can use if appropriate
|
||||
|
||||
#### TASKANA admin
|
||||
* Angular based web application to configure the system
|
||||
* Supports Workbaskets and Classifications
|
||||
* TASKANA monitor
|
||||
* Angular based web application to monitor the status of the entire Task pool
|
||||
* Supports workbaskets and classifications
|
||||
|
||||
#### TASKANA monitor
|
||||
* Angular based web application to monitor the status of the entire task pool
|
||||
* Provides views and statistics about the conformance with defined services levels
|
||||
* Shows the workload of your organization and the individual teams
|
||||
|
||||
## Demo App Components Diagram
|
||||
|
||||

|
||||
|
||||
# 🚀Getting Started
|
||||
|
||||
As TASKANA is meant to be integrated in the development environment and process of your organisation, you have to create your own small integration project as a wrapper and starting point for your customisations.
|
||||
|
||||
We currently provide examples how to run TASKANA as a Spring Boot Application or as a an Enterprise Application on Wildfly Application Server.
|
||||
|
||||
If you are only interested in how TASKANA looks and feel, you can try our Demo Environment instead.
|
||||
|
||||
## Requirements
|
||||
|
||||
Runtime Environment at least Java 17
|
||||
|
||||
Supported Databases:
|
||||
|
||||
* H2 (We test with 2.1.214*)
|
||||
* Postgres (We test with 14.7*)
|
||||
* DB2 (We test with 11.5.6*)
|
||||
* Oracle (We test with 18c*)
|
||||
|
||||
_* other versions of the named databases should work also, but haven't been tested_
|
||||
|
||||
## Wrapper Application
|
||||
|
||||
### Spring Boot Example
|
||||
|
||||
We use the h2 database in this example.
|
||||
|
||||
See `rest/taskana-rest-spring-example-boot` and it dependencies
|
||||
|
||||
### EJB Example
|
||||
|
||||
We use a Wildfly Application Server in this example.
|
||||
|
||||
See `lib/taskana-cdi`.
|
||||
|
||||
# Customize Behaviour
|
||||
|
||||
TASKANA allows to customize and modify it’s behaviour through the use of dedicated Service
|
||||
Provider Interfaces (SPI). Each SPI defines an interface that can be implemented by custom code.
|
||||
This is a common approach for Java developers to extend their applications. You can find out more
|
||||
about the background and the details in the Java documentation:
|
||||
https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html
|
||||
|
||||
In order to use an SPI within TASKANA, you must
|
||||
|
||||
* create a class that implements the relevant interface.
|
||||
* place that class into the classpath of your application
|
||||
* provide a control file with full name of the SPI
|
||||
(e. g. pro.taskana.spi.task.api.CreateTaskPreprocessor) in the subdirectory META-INF/services of
|
||||
the classpath. This control file must contain the fully qualified classname (including the
|
||||
package) of the class that implements the relevant interface. This control file is used by the
|
||||
ServiceLoader to load the custom class at runtime. The control file may contain multiple classes
|
||||
has implement the interface. Each implementation should be declared in a new line.
|
||||
|
||||
All implementations will be used consecutively in the declaration order of the control file.
|
||||
|
||||
If you provide one or multiple implementations according to the description above, TASKANA will invoke the implementations at a specific point. The Javadoc of each SPI describes the conditions for the implementation to be executed.
|
||||
|
||||
Currently, TASKANA provides the following SPIs:
|
||||
|
||||
* [`pro.taskana.spi.history.api.TaskanaHistory`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/history/api/TaskanaHistory.java)
|
||||
* [`pro.taskana.spi.priority.api.PriorityServiceProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/priority/api/PriorityServiceProvider.java)
|
||||
* [`pro.taskana.spi.routing.api.TaskRoutingProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/routing/api/TaskRoutingProvider.java)
|
||||
* [`pro.taskana.spi.task.api.AfterRequestChangesProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/AfterRequestChangesProvider.java)
|
||||
* [`pro.taskana.spi.task.api.AfterRequestReviewProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/AfterRequestReviewProvider.java)
|
||||
* [`pro.taskana.spi.task.api.BeforeRequestChangesProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/BeforeRequestChangesProvider.java)
|
||||
* [`pro.taskana.spi.task.api.BeforeRequestReviewProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/BeforeRequestReviewProvider.java)
|
||||
* [`pro.taskana.spi.task.api.CreateTaskPreprocessor`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/CreateTaskPreprocessor.java)
|
||||
* [`pro.taskana.spi.task.api.ReviewRequiredProvider`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/task/api/ReviewRequiredProvider.java)
|
||||
* [`pro.taskana.spi.user.api.RefreshUserPostprocessor`](https://github.com/Taskana/taskana/blob/master/lib/taskana-core/src/main/java/pro/taskana/spi/user/api/RefreshUserPostprocessor.java)
|
||||
|
||||
# 📚Releases
|
||||
|
||||
The list of [releases](https://github.com/Taskana/taskana/releases) contains a detailed changelog.
|
||||
|
||||
We use [Semantic Versioning](https://semver.org/).
|
||||
|
||||
The following compatibility matrix shows the officially supported Spring version for each release.
|
||||
Other combinations might also work but have not been tested.
|
||||
|
||||
| Release | SpringBoot |
|
||||
|---------|------------|
|
||||
| 7.0.0 | 2.7.16 |
|
||||
| 6.3.2 | 2.7.14 |
|
||||
| 6.2.2 | 2.7.12 |
|
||||
| 6.1.1 | 2.7.10 |
|
||||
|
||||
|
||||
# 📨Contact
|
||||
|
||||
If you have any questions or ideas feel free to create an [issue](https://github.com/Taskana/taskana/issues) or contact us via [GitHub Discussions](https://github.com/orgs/Taskana/discussions).
|
||||
|
||||
We love listening to your feedback, and of course also discussing the project roadmap and possible use cases with you!
|
||||
|
||||
This open source project is being developed by [Novatec Consulting GmbH](https://www.novatec-gmbh.de/en/) and [envite consulting GmbH](https://envite.de/) with the support of the open source community.
|
||||
|
||||
---
|
||||
[](https://www.novatec-gmbh.de)
|
||||
---
|
||||
[](https://envite.de/)
|
||||
---
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -3,8 +3,9 @@ set -e # fail fast
|
|||
set -x
|
||||
BASE_URL=https://taskana.azurewebsites.net/taskana
|
||||
|
||||
test 200 -eq "$(curl -sw "%{http_code}" -o /dev/null "$BASE_URL/api-docs")"
|
||||
test 200 -eq "$(curl -sw "%{http_code}" -o /dev/null "$BASE_URL/swagger-ui/index.html")"
|
||||
test 200 -eq "$(curl -sw "%{http_code}" -o /dev/null "$BASE_URL/docs/rest/rest-api.html")"
|
||||
test 200 -eq "$(curl -sw "%{http_code}" -o /dev/null "$BASE_URL/docs/rest/simplehistory-rest-api.html")"
|
||||
test 200 -eq "$(curl -sw "%{http_code}" -o /dev/null "$BASE_URL/docs/rest/routing-rest-api.html")"
|
||||
for module in taskana-core taskana-spring; do
|
||||
test 200 -eq "$(curl -sw "%{http_code}" -o /dev/null "$BASE_URL/docs/java/$module/index.html")"
|
||||
done
|
||||
|
|
|
@ -21,5 +21,8 @@ verifyDocs "$REL/../lib/taskana-spring/target/apidocs" "/static/docs/java/taskan
|
|||
test -n "$(jar -tf "$JAR_FILE_LOCATION" | grep /static/docs/java/taskana-core/index.html)"
|
||||
test -n "$(jar -tf "$JAR_FILE_LOCATION" | grep /static/docs/java/taskana-spring/index.html)"
|
||||
test -n "$(jar -tf "$JAR_FILE_LOCATION" | grep /static/docs/java/taskana-cdi/pro/taskana/common/internal/package-summary.html)"
|
||||
test -n "$(jar -tf "$JAR_FILE_LOCATION" | grep /static/docs/rest/rest-api.html)"
|
||||
test -n "$(jar -tf "$JAR_FILE_LOCATION" | grep /static/docs/rest/simplehistory-rest-api.html)"
|
||||
test -n "$(jar -tf "$JAR_FILE_LOCATION" | grep /static/docs/rest/routing-rest-api.html)"
|
||||
set +x
|
||||
echo "the jar file '$JAR_FILE_LOCATION' contains documentation"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.time.ZonedDateTime;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import javax.sql.DataSource;
|
||||
import org.apache.ibatis.jdbc.RuntimeSqlException;
|
||||
|
@ -77,7 +78,9 @@ public class SampleDataGenerator {
|
|||
private List<String> parseScripts(Stream<String> scripts) {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
DB db = DB.getDB(connection);
|
||||
return scripts.map(script -> SqlReplacer.getScriptAsSql(db, now, script)).toList();
|
||||
return scripts
|
||||
.map(script -> SqlReplacer.getScriptAsSql(db, now, script))
|
||||
.collect(Collectors.toList());
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeSqlException("Connection to database failed.", e);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L
|
|||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000006', 'L110105' , 'CLI:100000000000000000000000000000000004', 'L11010' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Dynamik-Ausschluss' , 'Dynamik-Ausschluss' , 5 , 'P16D' , '' , 'VNR,RVNR,KOLVNR' , 'TEXT_2' , '' , '' , '' , '' , '' , '' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000007', 'L110107' , 'CLI:100000000000000000000000000000000004', 'L11010' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Dynamik-Einschluss/Änd.' , 'Dynamik-Einschluss/Änd.' , 5 , 'P5D' , 'point0815' , 'VNR,RVNR,KOLVNR' , 'TEXT_1' , '' , '' , '' , '' , '' , '' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000008', 'L12010' , '' , '' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gewährung-Policendarlehen' , 'Gewährung-Policendarlehen' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101' , '' , '' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE ,'2018-02-01 12:00:00','2018-02-01 12:00:00', 'Zustimmungserklärung' , 'Zustimmungserklärung' , 2 , 'P2D' , '' , 'VNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101' , '' , '' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Zustimmungserklärung' , 'Zustimmungserklärung' , 2 , 'P2D' , '' , 'VNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000010', 'T2100' , '' , '' , 'MANUAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'T-Vertragstermin VERA' , 'T-Vertragstermin VERA' , 2 , 'P2D' , '' , 'VNR' , 'cust2' , 'cust3' , 'cust4' , 'cust5' , 'cust6' , 'cust7' , 'cust8' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000011', 'T6310' , '' , '' , 'AUTOMATIC' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'T-GUK Honorarrechnung erstellen', 'Unterstützungskasse Honorar wird fällig', 2 , 'P2D' , 'point0815' , 'VNR' , 'custom2' , 'custom3' , 'custom4' , 'custom5' , 'custom6' , 'custom7' , 'custom8' );
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000013', 'DOCTYPE_DEFAULT', '' , '' , 'EXTERNAL' , 'DOCUMENT' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'EP allgemein' , 'EP allgemein' , 99 , 'P2000D' , '' , 'VNR' , '' , '' , '' , '' , '' , '' , '' );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000000', 'ETI:000000000000000000000000000000000000', RELATIVE_DATE(-1) , RELATIVE_DATE(0) , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-1) , RELATIVE_DATE(0) , 'Task99' , 'creator_user_id' , 'Lorem ipsum was n Quatsch dolor sit amet.', 'Some custom Note' , 1 , -1 , 'CLAIMED' , 'MANUAL' , 'T2000' , 'CLI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , 'custom1' , 'custom2' , 'custom3' , 'custom4' , 'custom5' , 'custom6' , 'custom7' , 'custom8' , 'custom9' , 'custom10' , 'custom11' , 'custom12' , 'custom13' , 'abc' , 'custom15' , 'custom16' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 3 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000001', 'ETI:000000000000000000000000000000000001', RELATIVE_DATE(-2) , RELATIVE_DATE(0) , null , RELATIVE_DATE(0) , null , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Task01' , 'creator_user_id' , 'Lorem ipsum was n Quatsch dolor sit amet.', 'Some custom Note' , 2 , -1 , 'CLAIMED' , 'EXTERN' , 'L110102' , 'CLI:100000000000000000000000000000000005', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , 'pqr' , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 2 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000002', 'ETI:000000000000000000000000000000000002', RELATIVE_DATE(-2) , RELATIVE_DATE(0) , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Task02' , 'creator_user_id' , 'Lorem ipsum was n Quatsch t. Aber stimmt.', 'Some custom Note' , 2 , -1 , 'CLAIMED' , 'MANUAL' , 'T2000' , 'CLI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , null , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 2 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000003', 'ETI:000000000000000000000000000000000003','2018-02-01 12:00:00', null , null , '2018-02-01 12:00:00', RELATIVE_DATE(0) , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000003' , 'DOC_0000000000000000003' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , 'efg' , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 0 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000003', 'ETI:000000000000000000000000000000000003', RELATIVE_DATE(-2) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000003' , 'DOC_0000000000000000003' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , 'efg' , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 0 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000004', 'ETI:000000000000000000000000000000000004', RELATIVE_DATE(-3) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-3) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000004' , 'DOC_0000000000000000004' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , null , 'ade' , null , null , null , '074' , '' , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000005', 'ETI:000000000000000000000000000000000005', RELATIVE_DATE(-4) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(-3) , RELATIVE_DATE(-4) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000005' , 'DOC_0000000000000000005' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , null , null , null , null , null , '074' , '' , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 0 );
|
||||
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000006', 'ETI:000000000000000000000000000000000006', RELATIVE_DATE(-5) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(-3) , RELATIVE_DATE(-5) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2000 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000006' , 'DOC_0000000000000000006' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , null , null , null , null , null , '075' , '' , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 0 );
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
-- sample-data is used for rest tests and for the example application
|
||||
|
||||
-- KSC authorizations (ID , WB_ID , ACCESS_ID , ACCESS_NAME , READ , OPEN , APPEND, TRANSFER, DISTRIBUTE, C1, .., C12)
|
||||
--SERT INTO WORKBASKET_ACCESS_LIST VALUES (ID , WB_ID , ACCESS_ID , ACCESS_NAME , READ , OPEN , APPEND, TRANSFER, DISTRIBUTE, C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8 , C9 , C10 , C11 , C12 , READTASKS, EDITTASKS)
|
||||
-- KSC authorizations
|
||||
-- PPKs
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000001', 'WBI:100000000000000000000000000000000004', 'teamlead-1' , 'Titus Toll' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000002', 'WBI:100000000000000000000000000000000005', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
|
@ -36,6 +37,7 @@ INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:10000000000000000000000000000000
|
|||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , false, false , false , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000018', 'WBI:100000000000000000000000000000000009', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , false, true , false , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
|
||||
|
||||
--SERT INTO WORKBASKET_ACCESS_LIST VALUES (ID , WB_ID , ACCESS_ID , ACCESS_NAME , READ , OPEN , APPEND, TRANSFER, DISTRIBUTE, C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8 , C9 , C10 , C11 , C12 ,READTASKS, EDITTASKS)
|
||||
-- Team GPK access
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000019', 'WBI:100000000000000000000000000000000002', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000020', 'WBI:100000000000000000000000000000000003', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
|
@ -62,8 +64,3 @@ INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:00000000000000000000000000000000
|
|||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000907', 'WBI:000000000000000000000000000000000907', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000908', 'WBI:000000000000000000000000000000000908', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000909', 'WBI:000000000000000000000000000000000909', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
|
||||
-- permissions
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:200000000000000000000000000000000002', 'WBI:100000000000000000000000000000000005', 'taskana:callcenter:ab:ab/a:callcenter' , 'PERM_1' , true , true , true , false , true , false, false, false, false, false, false, false, false, false, false, false, false, true , false);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:200000000000000000000000000000000003', 'WBI:100000000000000000000000000000000006', 'taskana:callcenter:ab:AB/a:callcenter' , 'PERM_1' , true , false, true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true );
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:200000000000000000000000000000000005', 'WBI:100000000000000000000000000000000012', 'taskana:callcenter:ab:AB/a:callcenter' , 'PERM_1' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false, false , false);
|
||||
|
|
|
@ -51,8 +51,3 @@ INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:00000000000000000000000000000000
|
|||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000907', 'WBI:000000000000000000000000000000000907', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000908', 'WBI:000000000000000000000000000000000908', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000909', 'WBI:000000000000000000000000000000000909', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
|
||||
|
||||
-- permissions
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:200000000000000000000000000000000002', 'WBI:100000000000000000000000000000000005', 'taskana:callcenter:ab:ab/a:callcenter' , 'PERM_1' , true , true , true , false , true , false, false, false, false, false, false, false, false, false, false, false, false, true , false);
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:200000000000000000000000000000000003', 'WBI:100000000000000000000000000000000006', 'taskana:callcenter:ab:ab/a:callcenter' , 'PERM_1' , true , false, true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true );
|
||||
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:200000000000000000000000000000000005', 'WBI:100000000000000000000000000000000012', 'taskana:callcenter:ab:ab/a:callcenter' , 'PERM_1' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false, false , false);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.valfirst</groupId>
|
||||
<groupId>uk.org.lidalia</groupId>
|
||||
<artifactId>slf4j-test</artifactId>
|
||||
<version>${version.slf4j-test}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -45,7 +45,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -2,9 +2,6 @@ package pro.taskana.common.internal.logging;
|
|||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.github.valfirst.slf4jtest.LoggingEvent;
|
||||
import com.github.valfirst.slf4jtest.TestLogger;
|
||||
import com.github.valfirst.slf4jtest.TestLoggerFactory;
|
||||
import org.assertj.core.api.Condition;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
@ -12,9 +9,12 @@ import org.junit.jupiter.api.Test;
|
|||
import org.mockito.MockedStatic;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.internal.stubbing.answers.CallsRealMethods;
|
||||
import org.slf4j.event.Level;
|
||||
import outside.of.pro.taskana.OutsideOfProTaskanaPackageLoggingTestClass;
|
||||
import pro.taskana.AtProTaskanaRootPackageLoggingTestClass;
|
||||
import uk.org.lidalia.slf4jext.Level;
|
||||
import uk.org.lidalia.slf4jtest.LoggingEvent;
|
||||
import uk.org.lidalia.slf4jtest.TestLogger;
|
||||
import uk.org.lidalia.slf4jtest.TestLoggerFactory;
|
||||
|
||||
@NoLogging
|
||||
class LoggingAspectTest {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.security.auth.Subject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -50,7 +51,7 @@ public class CurrentUserContextImpl implements CurrentUserContext {
|
|||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
public List<String> getGroupIds() {
|
||||
// TODO replace with Subject.current() when migrating to newer Version than 17
|
||||
// TODO replace with Subject.current() when migrating to newer Version then 17
|
||||
Subject subject = Subject.getSubject(AccessController.getContext());
|
||||
LOGGER.trace("Subject of caller: {}", subject);
|
||||
if (subject != null) {
|
||||
|
@ -60,7 +61,7 @@ public class CurrentUserContextImpl implements CurrentUserContext {
|
|||
.map(Principal::getName)
|
||||
.filter(Objects::nonNull)
|
||||
.map(this::convertAccessId)
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
LOGGER.trace("No groupIds found in subject!");
|
||||
return Collections.emptyList();
|
||||
|
@ -128,7 +129,7 @@ public class CurrentUserContextImpl implements CurrentUserContext {
|
|||
|
||||
@SuppressWarnings("removal")
|
||||
private String getUserIdFromJaasSubject() {
|
||||
// TODO replace with Subject.current() when migrating to newer Version than 17
|
||||
// TODO replace with Subject.current() when migrating to newer Version then 17
|
||||
Subject subject = Subject.getSubject(AccessController.getContext());
|
||||
LOGGER.trace("Subject of caller: {}", subject);
|
||||
if (subject != null) {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -52,9 +52,9 @@
|
|||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<version>${version.jakarta.servlet}</version>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>${version.javax.servlet}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
@ -82,6 +82,19 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.restdocs</groupId>
|
||||
<artifactId>spring-restdocs-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.restdocs</groupId>
|
||||
<artifactId>spring-restdocs-mockmvc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>capital.scalable</groupId>
|
||||
<artifactId>spring-auto-restdocs-core</artifactId>
|
||||
<version>${version.auto-restdocs}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
|
|
|
@ -111,7 +111,7 @@ public class JaasExtension implements InvocationInterceptor, TestTemplateInvocat
|
|||
newChildrenForDynamicContainer = Collections.singleton((DynamicNode) factoryResult);
|
||||
} else if (factoryResult instanceof Stream) {
|
||||
Stream<DynamicNode> nodes = (Stream<DynamicNode>) factoryResult;
|
||||
newChildrenForDynamicContainer = nodes.toList();
|
||||
newChildrenForDynamicContainer = nodes.collect(Collectors.toList());
|
||||
} else if (factoryResult instanceof Iterable) {
|
||||
newChildrenForDynamicContainer = (Iterable<DynamicNode>) factoryResult;
|
||||
} else if (factoryResult instanceof Iterator) {
|
||||
|
@ -142,11 +142,8 @@ public class JaasExtension implements InvocationInterceptor, TestTemplateInvocat
|
|||
Store store = getMethodLevelStore(extensionContext);
|
||||
return (T)
|
||||
Stream.of(annotation.value())
|
||||
.map(
|
||||
a -> {
|
||||
store.put(ACCESS_IDS_STORE_KEY, a);
|
||||
return wrapTestsInDynamicContainer.apply(a);
|
||||
});
|
||||
.peek(a -> store.put(ACCESS_IDS_STORE_KEY, a))
|
||||
.map(wrapTestsInDynamicContainer);
|
||||
}
|
||||
|
||||
return extractAccessIdAndPerformInvocation(invocation, invocationContext.getExecutable());
|
||||
|
@ -210,11 +207,8 @@ public class JaasExtension implements InvocationInterceptor, TestTemplateInvocat
|
|||
AnnotationSupport.findRepeatableAnnotations(context.getElement(), WithAccessId.class);
|
||||
Store store = getMethodLevelStore(context);
|
||||
return accessIds.stream()
|
||||
.map(
|
||||
a -> {
|
||||
store.put(ACCESS_IDS_STORE_KEY, a);
|
||||
return new JaasExtensionInvocationContext(a);
|
||||
});
|
||||
.peek(a -> store.put(ACCESS_IDS_STORE_KEY, a))
|
||||
.map(JaasExtensionInvocationContext::new);
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
@ -265,7 +259,7 @@ public class JaasExtension implements InvocationInterceptor, TestTemplateInvocat
|
|||
return Stream.concat(
|
||||
Stream.of(withAccessId.user()).map(UserPrincipal::new),
|
||||
Arrays.stream(withAccessId.groups()).map(GroupPrincipal::new))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@ public @interface WithAccessId {
|
|||
|
||||
String[] groups() default {};
|
||||
|
||||
String[] permissions() default {};
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@interface WithAccessIds {
|
||||
|
|
|
@ -7,6 +7,7 @@ import static org.junit.jupiter.api.DynamicTest.dynamicTest;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
|
@ -214,12 +215,11 @@ class JaasExtensionTest {
|
|||
assertThat(CURRENT_USER_CONTEXT.getUserid()).isEqualTo(accessId.user());
|
||||
}
|
||||
|
||||
@WithAccessId(user = "testtemplate1", groups = "abc", permissions = "perm")
|
||||
@WithAccessId(user = "testtemplate1", groups = "abc")
|
||||
@TestTemplate
|
||||
void should_InjectCorrectAccessId_When_AnnotationExists_On_TestTemplate(WithAccessId accessId) {
|
||||
assertThat(accessId.user()).isEqualTo("testtemplate1");
|
||||
assertThat(accessId.groups()).containsExactly("abc");
|
||||
assertThat(accessId.permissions()).containsExactly("perm");
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
@ -406,21 +406,21 @@ class JaasExtensionTest {
|
|||
|
||||
@TestFactory
|
||||
Iterable<DynamicTest> should_NotSetAccessIdForDynamicTestInIterable_When_AnnotationIsMissing() {
|
||||
return Stream.of(NULL_DYNAMIC_TEST, NULL_DYNAMIC_TEST).toList();
|
||||
return Stream.of(NULL_DYNAMIC_TEST, NULL_DYNAMIC_TEST).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
@TestFactory
|
||||
Iterable<DynamicTest> should_SetAccessIdForDynamicTestInIterable_When_AnnotationExists() {
|
||||
return Stream.of(DYNAMIC_TEST_USER_DYNAMIC_TEST, DYNAMIC_TEST_USER_DYNAMIC_TEST)
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
@TestFactory
|
||||
Iterable<DynamicTest> should_SetMultipleAccessIdForDynamicTestInIterable_When_AnnotationsExist() {
|
||||
return Stream.of(NOT_NULL_DYNAMIC_TEST, NOT_NULL_DYNAMIC_TEST).toList();
|
||||
return Stream.of(NOT_NULL_DYNAMIC_TEST, NOT_NULL_DYNAMIC_TEST).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// WITH DynamicContainer
|
||||
|
@ -431,7 +431,7 @@ class JaasExtensionTest {
|
|||
Supplier<DynamicContainer> supplier =
|
||||
() ->
|
||||
dynamicContainer("dynamic container", Stream.of(NULL_DYNAMIC_TEST, NULL_DYNAMIC_TEST));
|
||||
return Stream.generate(supplier).limit(2).toList();
|
||||
return Stream.generate(supplier).limit(2).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
|
@ -443,7 +443,7 @@ class JaasExtensionTest {
|
|||
dynamicContainer(
|
||||
"dynamic container",
|
||||
Stream.of(DYNAMIC_TEST_USER_DYNAMIC_TEST, DYNAMIC_TEST_USER_DYNAMIC_TEST));
|
||||
return Stream.generate(supplier).limit(2).toList();
|
||||
return Stream.generate(supplier).limit(2).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
|
@ -455,7 +455,7 @@ class JaasExtensionTest {
|
|||
() ->
|
||||
dynamicContainer(
|
||||
"dynamic container", Stream.of(NOT_NULL_DYNAMIC_TEST, NOT_NULL_DYNAMIC_TEST));
|
||||
return Stream.generate(supplier).limit(2).toList();
|
||||
return Stream.generate(supplier).limit(2).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// WITH nested DynamicContainer
|
||||
|
@ -467,7 +467,7 @@ class JaasExtensionTest {
|
|||
() -> dynamicContainer("inside container", Stream.of(NULL_DYNAMIC_TEST, NULL_DYNAMIC_TEST));
|
||||
Supplier<DynamicContainer> outsideSupplier =
|
||||
() -> dynamicContainer("outside container", Stream.of(supplier.get(), NULL_DYNAMIC_TEST));
|
||||
return Stream.generate(outsideSupplier).limit(2).toList();
|
||||
return Stream.generate(outsideSupplier).limit(2).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
|
@ -483,7 +483,7 @@ class JaasExtensionTest {
|
|||
() ->
|
||||
dynamicContainer(
|
||||
"outside container", Stream.of(supplier.get(), DYNAMIC_TEST_USER_DYNAMIC_TEST));
|
||||
return Stream.generate(outsideSupplier).limit(2).toList();
|
||||
return Stream.generate(outsideSupplier).limit(2).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@WithAccessId(user = INSIDE_DYNAMIC_TEST_USER)
|
||||
|
@ -498,7 +498,7 @@ class JaasExtensionTest {
|
|||
Supplier<DynamicContainer> outsideSupplier =
|
||||
() ->
|
||||
dynamicContainer("outside container", Stream.of(supplier.get(), NOT_NULL_DYNAMIC_TEST));
|
||||
return Stream.generate(outsideSupplier).limit(2).toList();
|
||||
return Stream.generate(outsideSupplier).limit(2).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.common.internal.util.ReflectionUtil;
|
||||
|
||||
|
@ -42,6 +43,6 @@ public class SimpleParser<T> implements PropertyParser<T> {
|
|||
return Arrays.stream(str.split(Pattern.quote(separator)))
|
||||
.filter(not(String::isEmpty))
|
||||
.map(String::trim)
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,8 +199,7 @@ public class ComparableVersion implements Comparable<ComparableVersion> {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return (o instanceof ComparableVersion comparableVersion)
|
||||
&& items.equals(comparableVersion.items);
|
||||
return (o instanceof ComparableVersion) && items.equals(((ComparableVersion) o).items);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.lang.reflect.Field;
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import org.json.JSONObject;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
|
||||
|
@ -39,8 +40,7 @@ public class ObjectAttributeChangeDetector {
|
|||
|
||||
// this has to be checked after we deal with List data types, because
|
||||
// we want to allow different implementations of the List interface to work as well.
|
||||
if (!oldObject.getClass().equals(newObject.getClass())
|
||||
&& !oldObject.getClass().isAssignableFrom(newObject.getClass())) {
|
||||
if (!oldObject.getClass().equals(newObject.getClass())) {
|
||||
throw new SystemException(
|
||||
String.format(
|
||||
"The classes differ between the oldObject(%s) and newObject(%s). "
|
||||
|
@ -55,7 +55,7 @@ public class ObjectAttributeChangeDetector {
|
|||
.map(wrap(field -> Triplet.of(field, field.get(oldObject), field.get(newObject))))
|
||||
.filter(not(t -> Objects.equals(t.getMiddle(), t.getRight())))
|
||||
.map(t -> generateChangedAttribute(t.getLeft(), t.getMiddle(), t.getRight()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
JSONObject changes = new JSONObject();
|
||||
changes.put("changes", changedAttributes);
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Arrays;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ReflectionUtil {
|
||||
|
||||
|
@ -37,12 +38,12 @@ public class ReflectionUtil {
|
|||
fields.addAll(Arrays.asList(currentClass.getDeclaredFields()));
|
||||
currentClass = currentClass.getSuperclass();
|
||||
}
|
||||
return fields.stream().filter(not(Field::isSynthetic)).toList();
|
||||
return fields.stream().filter(not(Field::isSynthetic)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static Class<?> getRawClass(Type type) {
|
||||
if (type instanceof ParameterizedType parameterizedType) {
|
||||
return getRawClass(parameterizedType.getRawType());
|
||||
if (type instanceof ParameterizedType) {
|
||||
return getRawClass(((ParameterizedType) type).getRawType());
|
||||
}
|
||||
return (Class<?>) type;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package pro.taskana.common.internal.util;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
public class SpiLoader {
|
||||
|
@ -12,6 +13,6 @@ public class SpiLoader {
|
|||
|
||||
public static <T> List<T> load(Class<T> clazz) {
|
||||
ServiceLoader<T> serviceLoader = ServiceLoader.load(clazz);
|
||||
return StreamSupport.stream(serviceLoader.spliterator(), false).toList();
|
||||
return StreamSupport.stream(serviceLoader.spliterator(), false).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ CREATE SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ
|
|||
|
||||
-- The VERSION value must be equal or higher then the value of TaskanaEngineImpl.MINIMAL_TASKANA_SCHEMA_VERSION
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.1.0', CURRENT_TIMESTAMP);
|
||||
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.0.0', CURRENT_TIMESTAMP);
|
||||
|
||||
CREATE TABLE CLASSIFICATION
|
||||
(
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
-- this script updates the TASKANA database schema from version 8.1.0. to version 8.2.0.
|
||||
SET SCHEMA %schemaName%;
|
||||
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.1.0', CURRENT_TIMESTAMP);
|
||||
|
||||
ALTER TABLE TASK
|
||||
ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0;
|
||||
|
||||
UPDATE TASK t
|
||||
SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT
|
||||
FROM (
|
||||
SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT
|
||||
FROM TASK t
|
||||
RIGHT OUTER JOIN TASK_COMMENT tc
|
||||
ON t.ID = tc.TASK_ID
|
||||
GROUP BY t.ID
|
||||
) AS subquery
|
||||
WHERE t.ID = subquery.ID;
|
|
@ -22,7 +22,7 @@ CREATE SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ
|
|||
|
||||
-- The VERSION value must be equal or higher then the value of TaskanaEngineImpl.MINIMAL_TASKANA_SCHEMA_VERSION
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP);
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
|
||||
|
||||
CREATE TABLE CLASSIFICATION
|
||||
(
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
-- this script updates the TASKANA database schema from version 8.1.0 to version 8.2.0.
|
||||
SET SCHEMA %schemaName%;
|
||||
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP);
|
||||
|
||||
ALTER TABLE TASK
|
||||
ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0;
|
||||
|
||||
UPDATE TASK t
|
||||
SET NUMBER_OF_COMMENTS = (
|
||||
SELECT COUNT(tc.ID)
|
||||
FROM TASK_COMMENT tc
|
||||
WHERE tc.TASK_ID = t.ID
|
||||
)
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM TASK_COMMENT tc
|
||||
WHERE tc.TASK_ID = t.ID
|
||||
);
|
|
@ -14,7 +14,7 @@ CREATE SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ
|
|||
|
||||
-- The VERSION value must be equal or higher then the value of TaskanaEngineImpl.MINIMAL_TASKANA_SCHEMA_VERSION
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.1.0', CURRENT_TIMESTAMP);
|
||||
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.0.0', CURRENT_TIMESTAMP);
|
||||
|
||||
CREATE TABLE CLASSIFICATION
|
||||
(
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
-- this script updates the TASKANA database schema from version 8.1.0 to version 8.2.0.
|
||||
ALTER SESSION SET CURRENT_SCHEMA = %schemaName%;
|
||||
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP);
|
||||
|
||||
ALTER TABLE TASK
|
||||
ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0;
|
||||
|
||||
UPDATE TASK t
|
||||
SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT
|
||||
FROM (
|
||||
SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT
|
||||
FROM TASK t
|
||||
RIGHT OUTER JOIN TASK_COMMENT tc
|
||||
ON t.ID = tc.TASK_ID
|
||||
GROUP BY t.ID
|
||||
) AS subquery
|
||||
WHERE t.ID = subquery.ID;
|
|
@ -18,7 +18,7 @@ CREATE SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ
|
|||
|
||||
-- The VERSION value must be equal or higher then the value of TaskanaEngineImpl.MINIMAL_TASKANA_SCHEMA_VERSION
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP);
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
|
||||
|
||||
CREATE TABLE CLASSIFICATION
|
||||
(
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
-- this script updates the TASKANA database schema from version 8.1.0 to version 8.2.0.
|
||||
|
||||
SET search_path = %schemaName%;
|
||||
|
||||
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
|
||||
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.1.0', CURRENT_TIMESTAMP);
|
||||
|
||||
ALTER TABLE TASK
|
||||
ADD COLUMN NUMBER_OF_COMMENTS INT DEFAULT 0;
|
||||
|
||||
UPDATE TASK t
|
||||
SET NUMBER_OF_COMMENTS = subquery.COMMENT_COUNT
|
||||
FROM (
|
||||
SELECT t.ID, COUNT(tc.ID) AS COMMENT_COUNT
|
||||
FROM TASK t
|
||||
RIGHT OUTER JOIN TASK_COMMENT tc
|
||||
ON t.ID = tc.TASK_ID
|
||||
GROUP BY t.ID
|
||||
) AS subquery
|
||||
WHERE t.ID = subquery.ID;
|
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 5.1 KiB |
|
@ -12,7 +12,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana.history</groupId>
|
||||
<artifactId>taskana-history-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
|||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>com.github.valfirst</groupId>
|
||||
<groupId>uk.org.lidalia</groupId>
|
||||
<artifactId>slf4j-test</artifactId>
|
||||
<version>${version.slf4j-test}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -59,7 +59,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -4,8 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.github.valfirst.slf4jtest.TestLogger;
|
||||
import com.github.valfirst.slf4jtest.TestLoggerFactory;
|
||||
import java.time.Instant;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
@ -19,6 +17,8 @@ import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
|||
import pro.taskana.spi.history.api.events.task.TaskHistoryEventType;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEventType;
|
||||
import uk.org.lidalia.slf4jtest.TestLogger;
|
||||
import uk.org.lidalia.slf4jtest.TestLoggerFactory;
|
||||
|
||||
class LogfileHistoryServiceImplTest {
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana.history</groupId>
|
||||
<artifactId>taskana-history-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -91,12 +91,7 @@
|
|||
<version>${version.oracle}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-test-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package pro.taskana.simplehistory;
|
||||
|
||||
import pro.taskana.common.api.TaskanaRole;
|
||||
import pro.taskana.common.api.exceptions.NotAuthorizedException;
|
||||
import pro.taskana.spi.history.api.TaskanaHistory;
|
||||
|
||||
/** The TaskanaHistoryEngine represents an overall set of all needed services. */
|
||||
public interface TaskanaHistoryEngine {
|
||||
/**
|
||||
* The TaskanaHistory can be used for operations on all history events.
|
||||
*
|
||||
* @return the HistoryService
|
||||
*/
|
||||
TaskanaHistory getTaskanaHistoryService();
|
||||
|
||||
/**
|
||||
* check whether the current user is member of one of the roles specified.
|
||||
*
|
||||
* @param roles The roles that are checked for membership of the current user
|
||||
* @return true if the current user is a member of at least one of the specified groups
|
||||
*/
|
||||
boolean isUserInRole(TaskanaRole... roles);
|
||||
|
||||
/**
|
||||
* Checks whether current user is member of any of the specified roles.
|
||||
*
|
||||
* @param roles The roles that are checked for membership of the current user
|
||||
* @throws NotAuthorizedException If the current user is not member of any specified role
|
||||
*/
|
||||
void checkRoleMembership(TaskanaRole... roles) throws NotAuthorizedException;
|
||||
}
|
|
@ -2,6 +2,7 @@ package pro.taskana.simplehistory.impl;
|
|||
|
||||
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
@ -11,7 +12,6 @@ import pro.taskana.classification.api.ClassificationCustomField;
|
|||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
|
||||
|
@ -33,7 +33,7 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
private static final String SQL_EXCEPTION_MESSAGE =
|
||||
"Method openConnection() could not open a connection to the database.";
|
||||
|
||||
private final InternalTaskanaEngine internalTaskanaEngine;
|
||||
private final TaskanaHistoryEngineImpl taskanaHistoryEngine;
|
||||
|
||||
private final List<String> orderBy = new ArrayList<>();
|
||||
private final List<String> orderColumns = new ArrayList<>();
|
||||
|
@ -82,8 +82,8 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
private String[] custom7Like;
|
||||
private String[] custom8Like;
|
||||
|
||||
public ClassificationHistoryQueryImpl(InternalTaskanaEngine internalTaskanaEngine) {
|
||||
this.internalTaskanaEngine = internalTaskanaEngine;
|
||||
public ClassificationHistoryQueryImpl(TaskanaHistoryEngineImpl internalTaskanaHistoryEngine) {
|
||||
this.taskanaHistoryEngine = internalTaskanaHistoryEngine;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -415,13 +415,16 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
|
||||
@Override
|
||||
public List<ClassificationHistoryEvent> list() {
|
||||
List<ClassificationHistoryEvent> result;
|
||||
List<ClassificationHistoryEvent> result = new ArrayList<>();
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -429,12 +432,15 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
public List<ClassificationHistoryEvent> list(int offset, int limit) {
|
||||
List<ClassificationHistoryEvent> result = new ArrayList<>();
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
taskanaHistoryEngine.openConnection();
|
||||
RowBounds rowBounds = new RowBounds(offset, limit);
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -448,14 +454,17 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
this.addOrderCriteria(columnName.toString(), sortDirection);
|
||||
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
this.orderBy.addAll(cacheOrderBy);
|
||||
this.columnName = null;
|
||||
this.orderColumns.remove(orderColumns.size() - 1);
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,12 +473,15 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
ClassificationHistoryEvent result = null;
|
||||
try {
|
||||
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -477,11 +489,14 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
|||
public long count() {
|
||||
Long rowCount = null;
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
rowCount = internalTaskanaEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
rowCount = taskanaHistoryEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this);
|
||||
return (rowCount == null) ? 0L : rowCount;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return -1;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,20 @@
|
|||
package pro.taskana.simplehistory.impl;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import pro.taskana.common.api.TaskanaEngine;
|
||||
import pro.taskana.common.api.TaskanaRole;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.common.api.exceptions.NotAuthorizedException;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.common.internal.TaskanaEngineImpl;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQueryMapper;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQueryMapper;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQueryMapper;
|
||||
import pro.taskana.spi.history.api.TaskanaHistory;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
|
@ -34,136 +27,95 @@ import pro.taskana.user.internal.UserMapper;
|
|||
public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SimpleHistoryServiceImpl.class);
|
||||
private TaskanaHistoryEngineImpl taskanaHistoryEngine;
|
||||
private TaskHistoryEventMapper taskHistoryEventMapper;
|
||||
private WorkbasketHistoryEventMapper workbasketHistoryEventMapper;
|
||||
private ClassificationHistoryEventMapper classificationHistoryEventMapper;
|
||||
private UserMapper userMapper;
|
||||
|
||||
private InternalTaskanaEngine internalTaskanaEngine;
|
||||
|
||||
public void initialize(TaskanaEngine taskanaEngine) {
|
||||
LOGGER.info(
|
||||
|
||||
this.taskanaHistoryEngine = getTaskanaEngine(taskanaEngine);
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(
|
||||
"Simple history service implementation initialized with schemaName: {} ",
|
||||
taskanaEngine.getConfiguration().getSchemaName());
|
||||
|
||||
Field sessionManager = null;
|
||||
try {
|
||||
Field internalTaskanaEngineImpl =
|
||||
TaskanaEngineImpl.class.getDeclaredField("internalTaskanaEngineImpl");
|
||||
internalTaskanaEngineImpl.setAccessible(true);
|
||||
this.internalTaskanaEngine =
|
||||
(InternalTaskanaEngine) internalTaskanaEngineImpl.get(taskanaEngine);
|
||||
sessionManager = TaskanaEngineImpl.class.getDeclaredField("sessionManager");
|
||||
sessionManager.setAccessible(true);
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new SystemException("SQL Session could not be retrieved. Aborting Startup");
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new SystemException(e.getMessage());
|
||||
}
|
||||
try {
|
||||
SqlSession sqlSession = (SqlSession) sessionManager.get(taskanaEngine);
|
||||
if (!sqlSession
|
||||
.getConfiguration()
|
||||
.getMapperRegistry()
|
||||
.hasMapper(TaskHistoryEventMapper.class)) {
|
||||
sqlSession.getConfiguration().addMapper(TaskHistoryEventMapper.class);
|
||||
}
|
||||
if (!sqlSession
|
||||
.getConfiguration()
|
||||
.getMapperRegistry()
|
||||
.hasMapper(WorkbasketHistoryEventMapper.class)) {
|
||||
|
||||
sqlSession.getConfiguration().addMapper(WorkbasketHistoryEventMapper.class);
|
||||
}
|
||||
if (!sqlSession
|
||||
.getConfiguration()
|
||||
.getMapperRegistry()
|
||||
.hasMapper(ClassificationHistoryEventMapper.class)) {
|
||||
|
||||
sqlSession.getConfiguration().addMapper(ClassificationHistoryEventMapper.class);
|
||||
}
|
||||
|
||||
if (!sqlSession
|
||||
.getConfiguration()
|
||||
.getMapperRegistry()
|
||||
.hasMapper(ClassificationHistoryQueryMapper.class)) {
|
||||
|
||||
sqlSession.getConfiguration().addMapper(ClassificationHistoryQueryMapper.class);
|
||||
}
|
||||
|
||||
if (!sqlSession
|
||||
.getConfiguration()
|
||||
.getMapperRegistry()
|
||||
.hasMapper(TaskHistoryQueryMapper.class)) {
|
||||
|
||||
sqlSession.getConfiguration().addMapper(TaskHistoryQueryMapper.class);
|
||||
}
|
||||
|
||||
if (!sqlSession
|
||||
.getConfiguration()
|
||||
.getMapperRegistry()
|
||||
.hasMapper(WorkbasketHistoryQueryMapper.class)) {
|
||||
|
||||
sqlSession.getConfiguration().addMapper(WorkbasketHistoryQueryMapper.class);
|
||||
}
|
||||
|
||||
this.taskHistoryEventMapper = sqlSession.getMapper(TaskHistoryEventMapper.class);
|
||||
this.workbasketHistoryEventMapper = sqlSession.getMapper(WorkbasketHistoryEventMapper.class);
|
||||
this.taskHistoryEventMapper =
|
||||
this.taskanaHistoryEngine.getSqlSession().getMapper(TaskHistoryEventMapper.class);
|
||||
this.workbasketHistoryEventMapper =
|
||||
this.taskanaHistoryEngine.getSqlSession().getMapper(WorkbasketHistoryEventMapper.class);
|
||||
this.classificationHistoryEventMapper =
|
||||
sqlSession.getMapper(ClassificationHistoryEventMapper.class);
|
||||
this.userMapper = sqlSession.getMapper(UserMapper.class);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new SystemException(
|
||||
"TASKANA engine of Session Manager could not be retrieved. Aborting Startup");
|
||||
}
|
||||
this.taskanaHistoryEngine.getSqlSession().getMapper(ClassificationHistoryEventMapper.class);
|
||||
this.userMapper = taskanaHistoryEngine.getSqlSession().getMapper(UserMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(TaskHistoryEvent event) {
|
||||
|
||||
try {
|
||||
taskanaHistoryEngine.openConnection();
|
||||
if (event.getCreated() == null) {
|
||||
Instant now = Instant.now();
|
||||
event.setCreated(now);
|
||||
}
|
||||
taskHistoryEventMapper.insert(event);
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Error while inserting task history event into database", e);
|
||||
} finally {
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(WorkbasketHistoryEvent event) {
|
||||
|
||||
try {
|
||||
taskanaHistoryEngine.openConnection();
|
||||
if (event.getCreated() == null) {
|
||||
Instant now = Instant.now();
|
||||
event.setCreated(now);
|
||||
}
|
||||
workbasketHistoryEventMapper.insert(event);
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Error while inserting workbasket history event into database", e);
|
||||
} finally {
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(ClassificationHistoryEvent event) {
|
||||
|
||||
try {
|
||||
taskanaHistoryEngine.openConnection();
|
||||
if (event.getCreated() == null) {
|
||||
Instant now = Instant.now();
|
||||
event.setCreated(now);
|
||||
}
|
||||
classificationHistoryEventMapper.insert(event);
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Error while inserting classification history event into database", e);
|
||||
} finally {
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteHistoryEventsByTaskIds(List<String> taskIds)
|
||||
throws InvalidArgumentException, NotAuthorizedException {
|
||||
|
||||
internalTaskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN);
|
||||
taskanaHistoryEngine.checkRoleMembership(TaskanaRole.ADMIN);
|
||||
|
||||
if (taskIds == null) {
|
||||
throw new InvalidArgumentException("List of taskIds must not be null.");
|
||||
}
|
||||
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
taskanaHistoryEngine.openConnection();
|
||||
taskHistoryEventMapper.deleteMultipleByTaskIds(taskIds);
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Caught exception while trying to delete history events", e);
|
||||
} finally {
|
||||
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,14 +123,14 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
|||
throws TaskanaHistoryEventNotFoundException {
|
||||
TaskHistoryEvent resultEvent = null;
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
taskanaHistoryEngine.openConnection();
|
||||
resultEvent = taskHistoryEventMapper.findById(historyEventId);
|
||||
|
||||
if (resultEvent == null) {
|
||||
throw new TaskanaHistoryEventNotFoundException(historyEventId);
|
||||
}
|
||||
|
||||
if (internalTaskanaEngine.getEngine().getConfiguration().isAddAdditionalUserInfo()) {
|
||||
if (taskanaHistoryEngine.getConfiguration().isAddAdditionalUserInfo()) {
|
||||
User user = userMapper.findById(resultEvent.getUserId());
|
||||
if (user != null) {
|
||||
resultEvent.setUserLongName(user.getLongName());
|
||||
|
@ -186,20 +138,30 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
|||
}
|
||||
return resultEvent;
|
||||
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error("Caught exception while trying to retrieve a history event", e);
|
||||
return resultEvent;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public TaskHistoryQuery createTaskHistoryQuery() {
|
||||
return new TaskHistoryQueryImpl(internalTaskanaEngine);
|
||||
return new TaskHistoryQueryImpl(taskanaHistoryEngine);
|
||||
}
|
||||
|
||||
public WorkbasketHistoryQuery createWorkbasketHistoryQuery() {
|
||||
return new WorkbasketHistoryQueryImpl(internalTaskanaEngine);
|
||||
return new WorkbasketHistoryQueryImpl(taskanaHistoryEngine);
|
||||
}
|
||||
|
||||
public ClassificationHistoryQuery createClassificationHistoryQuery() {
|
||||
return new ClassificationHistoryQueryImpl(internalTaskanaEngine);
|
||||
return new ClassificationHistoryQueryImpl(taskanaHistoryEngine);
|
||||
}
|
||||
|
||||
/*
|
||||
* ATTENTION: This method exists for testing purposes.
|
||||
*/
|
||||
TaskanaHistoryEngineImpl getTaskanaEngine(TaskanaEngine taskanaEngine) {
|
||||
return TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngine);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package pro.taskana.simplehistory.impl;
|
|||
|
||||
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
@ -9,7 +10,6 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryCustomField;
|
||||
|
@ -30,7 +30,7 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
private static final String SQL_EXCEPTION_MESSAGE =
|
||||
"Method openConnection() could not open a connection to the database.";
|
||||
|
||||
private final InternalTaskanaEngine internalTaskanaEngine;
|
||||
private final TaskanaHistoryEngineImpl taskanaHistoryEngine;
|
||||
private final List<String> orderBy;
|
||||
private final List<String> orderColumns;
|
||||
private boolean joinWithUserInfo;
|
||||
|
@ -83,12 +83,11 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
private String[] custom3Like;
|
||||
private String[] custom4Like;
|
||||
|
||||
public TaskHistoryQueryImpl(InternalTaskanaEngine internalTaskanaEngine) {
|
||||
this.internalTaskanaEngine = internalTaskanaEngine;
|
||||
public TaskHistoryQueryImpl(TaskanaHistoryEngineImpl taskanaHistoryEngine) {
|
||||
this.taskanaHistoryEngine = taskanaHistoryEngine;
|
||||
this.orderBy = new ArrayList<>();
|
||||
this.orderColumns = new ArrayList<>();
|
||||
this.joinWithUserInfo =
|
||||
internalTaskanaEngine.getEngine().getConfiguration().isAddAdditionalUserInfo();
|
||||
this.joinWithUserInfo = taskanaHistoryEngine.getConfiguration().isAddAdditionalUserInfo();
|
||||
}
|
||||
|
||||
public String[] getIdIn() {
|
||||
|
@ -632,11 +631,14 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
public List<TaskHistoryEvent> list() {
|
||||
List<TaskHistoryEvent> result = new ArrayList<>();
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,12 +646,15 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
public List<TaskHistoryEvent> list(int offset, int limit) {
|
||||
List<TaskHistoryEvent> result = new ArrayList<>();
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
taskanaHistoryEngine.openConnection();
|
||||
RowBounds rowBounds = new RowBounds(offset, limit);
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -667,12 +672,15 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
}
|
||||
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
this.orderColumns.remove(orderColumns.size() - 1);
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -680,13 +688,16 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
public TaskHistoryEvent single() {
|
||||
TaskHistoryEvent result = null;
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
|
||||
return result;
|
||||
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -694,11 +705,14 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
|||
public long count() {
|
||||
Long rowCount;
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
rowCount = internalTaskanaEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
rowCount = taskanaHistoryEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this);
|
||||
return (rowCount == null) ? 0L : rowCount;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return -1;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,255 @@
|
|||
package pro.taskana.simplehistory.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Arrays;
|
||||
import java.util.Deque;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.apache.ibatis.mapping.Environment;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
|
||||
import org.apache.ibatis.session.SqlSessionManager;
|
||||
import org.apache.ibatis.transaction.TransactionFactory;
|
||||
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
|
||||
import org.apache.ibatis.transaction.managed.ManagedTransactionFactory;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import pro.taskana.TaskanaConfiguration;
|
||||
import pro.taskana.common.api.TaskanaEngine;
|
||||
import pro.taskana.common.api.TaskanaRole;
|
||||
import pro.taskana.common.api.exceptions.NotAuthorizedException;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.common.internal.OracleSqlSessionFactory;
|
||||
import pro.taskana.common.internal.configuration.DB;
|
||||
import pro.taskana.common.internal.persistence.InstantTypeHandler;
|
||||
import pro.taskana.common.internal.persistence.MapTypeHandler;
|
||||
import pro.taskana.common.internal.persistence.StringTypeHandler;
|
||||
import pro.taskana.simplehistory.TaskanaHistoryEngine;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryQueryMapper;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQueryMapper;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQueryMapper;
|
||||
import pro.taskana.spi.history.api.TaskanaHistory;
|
||||
import pro.taskana.user.internal.UserMapper;
|
||||
|
||||
/** This is the implementation of TaskanaHistoryEngine. */
|
||||
public class TaskanaHistoryEngineImpl implements TaskanaHistoryEngine {
|
||||
|
||||
protected static final ThreadLocal<Deque<SqlSessionManager>> SESSION_STACK = new ThreadLocal<>();
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaHistoryEngineImpl.class);
|
||||
private static final String DEFAULT = "default";
|
||||
private final SqlSessionManager sessionManager;
|
||||
private final TaskanaConfiguration taskanaConfiguration;
|
||||
private final TaskanaEngine taskanaEngine;
|
||||
private TransactionFactory transactionFactory;
|
||||
private TaskanaHistory taskanaHistoryService;
|
||||
|
||||
protected TaskanaHistoryEngineImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaConfiguration = taskanaEngine.getConfiguration();
|
||||
this.taskanaEngine = taskanaEngine;
|
||||
|
||||
createTransactionFactory(taskanaConfiguration.isUseManagedTransactions());
|
||||
sessionManager = createSqlSessionManager();
|
||||
}
|
||||
|
||||
public static TaskanaHistoryEngineImpl createTaskanaEngine(TaskanaEngine taskanaEngine) {
|
||||
return new TaskanaHistoryEngineImpl(taskanaEngine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskanaHistory getTaskanaHistoryService() {
|
||||
if (taskanaHistoryService == null) {
|
||||
SimpleHistoryServiceImpl historyService = new SimpleHistoryServiceImpl();
|
||||
historyService.initialize(taskanaEngine);
|
||||
taskanaHistoryService = historyService;
|
||||
}
|
||||
return taskanaHistoryService;
|
||||
}
|
||||
|
||||
public boolean isUserInRole(TaskanaRole... roles) {
|
||||
if (!getConfiguration().isSecurityEnabled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Set<String> rolesMembers =
|
||||
Arrays.stream(roles)
|
||||
.map(role -> getConfiguration().getRoleMap().get(role))
|
||||
.collect(HashSet::new, Set::addAll, Set::addAll);
|
||||
|
||||
return taskanaEngine.getCurrentUserContext().getAccessIds().stream()
|
||||
.anyMatch(rolesMembers::contains);
|
||||
}
|
||||
|
||||
public void checkRoleMembership(TaskanaRole... roles) throws NotAuthorizedException {
|
||||
if (!isUserInRole(roles)) {
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(
|
||||
"Throwing NotAuthorizedException because accessIds {} are not member of roles {}",
|
||||
taskanaEngine.getCurrentUserContext().getAccessIds(),
|
||||
Arrays.toString(roles));
|
||||
}
|
||||
throw new NotAuthorizedException(taskanaEngine.getCurrentUserContext().getUserid(), roles);
|
||||
}
|
||||
}
|
||||
|
||||
public TaskanaConfiguration getConfiguration() {
|
||||
return this.taskanaConfiguration;
|
||||
}
|
||||
|
||||
protected SqlSessionManager createSqlSessionManager() {
|
||||
Environment environment =
|
||||
new Environment(DEFAULT, this.transactionFactory, taskanaConfiguration.getDataSource());
|
||||
Configuration configuration = new Configuration(environment);
|
||||
|
||||
// set databaseId
|
||||
DB db;
|
||||
try (Connection con = taskanaConfiguration.getDataSource().getConnection()) {
|
||||
db = DB.getDB(con);
|
||||
configuration.setDatabaseId(db.dbProductId);
|
||||
} catch (SQLException e) {
|
||||
throw new SystemException("Could not open a connection to set the databaseId", e);
|
||||
}
|
||||
|
||||
// register type handlers
|
||||
if (DB.ORACLE == db) {
|
||||
// Use NULL instead of OTHER when jdbcType is not specified for null values,
|
||||
// otherwise oracle driver will chunck on null values
|
||||
configuration.setJdbcTypeForNull(JdbcType.NULL);
|
||||
configuration.getTypeHandlerRegistry().register(String.class, new StringTypeHandler());
|
||||
}
|
||||
configuration.getTypeHandlerRegistry().register(new MapTypeHandler());
|
||||
configuration.getTypeHandlerRegistry().register(Instant.class, new InstantTypeHandler());
|
||||
configuration.getTypeHandlerRegistry().register(JdbcType.TIMESTAMP, new InstantTypeHandler());
|
||||
|
||||
// add mappers
|
||||
configuration.addMapper(TaskHistoryEventMapper.class);
|
||||
configuration.addMapper(TaskHistoryQueryMapper.class);
|
||||
configuration.addMapper(WorkbasketHistoryEventMapper.class);
|
||||
configuration.addMapper(WorkbasketHistoryQueryMapper.class);
|
||||
configuration.addMapper(ClassificationHistoryEventMapper.class);
|
||||
configuration.addMapper(ClassificationHistoryQueryMapper.class);
|
||||
configuration.addMapper(UserMapper.class);
|
||||
|
||||
SqlSessionFactory localSessionFactory;
|
||||
if (DB.ORACLE == db) {
|
||||
localSessionFactory =
|
||||
new SqlSessionFactoryBuilder() {
|
||||
@Override
|
||||
public SqlSessionFactory build(Configuration config) {
|
||||
return new OracleSqlSessionFactory(config);
|
||||
}
|
||||
}.build(configuration);
|
||||
} else {
|
||||
localSessionFactory = new SqlSessionFactoryBuilder().build(configuration);
|
||||
}
|
||||
return SqlSessionManager.newInstance(localSessionFactory);
|
||||
}
|
||||
|
||||
protected static void pushSessionToStack(SqlSessionManager session) {
|
||||
getSessionStack().push(session);
|
||||
}
|
||||
|
||||
protected static void popSessionFromStack() {
|
||||
Deque<SqlSessionManager> stack = getSessionStack();
|
||||
if (!stack.isEmpty()) {
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* With sessionStack, we maintain a Stack of SqlSessionManager objects on a per thread basis.
|
||||
* SqlSessionManager is the MyBatis object that wraps database connections. The purpose of this
|
||||
* stack is to keep track of nested calls. Each external API call is wrapped into
|
||||
* taskanaEngineImpl.openConnection(); ..... taskanaEngineImpl.returnConnection(); calls. In order
|
||||
* to avoid duplicate opening / closing of connections, we use the sessionStack in the following
|
||||
* way: Each time, an openConnection call is received, we push the current sessionManager onto the
|
||||
* stack. On the first call to openConnection, we call sessionManager.startManagedSession() to
|
||||
* open a database connection. On each call to returnConnection() we pop one instance of
|
||||
* sessionManager from the stack. When the stack becomes empty, we close the database connection
|
||||
* by calling sessionManager.close()
|
||||
*
|
||||
* @return Stack of SqlSessionManager
|
||||
*/
|
||||
protected static Deque<SqlSessionManager> getSessionStack() {
|
||||
Deque<SqlSessionManager> stack = SESSION_STACK.get();
|
||||
if (stack == null) {
|
||||
stack = new ArrayDeque<>();
|
||||
SESSION_STACK.set(stack);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
protected static SqlSessionManager getSessionFromStack() {
|
||||
Deque<SqlSessionManager> stack = getSessionStack();
|
||||
if (stack.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return stack.peek();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the connection to the database. to be called at the begin of each Api call that accesses
|
||||
* the database
|
||||
*
|
||||
* @throws SQLException thrown if the connection could not be opened.
|
||||
*/
|
||||
void openConnection() throws SQLException {
|
||||
initSqlSession();
|
||||
this.sessionManager.getConnection().setSchema(taskanaConfiguration.getSchemaName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the database connection into the pool. In the case of nested calls, simply pops the
|
||||
* latest session from the session stack. Closes the connection if the session stack is empty. In
|
||||
* mode AUTOCOMMIT commits before the connection is closed. To be called at the end of each Api
|
||||
* call that accesses the database
|
||||
*/
|
||||
void returnConnection() {
|
||||
popSessionFromStack();
|
||||
if (getSessionStack().isEmpty()
|
||||
&& this.sessionManager != null
|
||||
&& this.sessionManager.isManagedSessionStarted()) {
|
||||
try {
|
||||
this.sessionManager.commit();
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
this.sessionManager.close();
|
||||
}
|
||||
}
|
||||
|
||||
/** Initializes the SqlSessionManager. */
|
||||
void initSqlSession() {
|
||||
this.sessionManager.startManagedSession();
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieve the SqlSession used by taskana.
|
||||
*
|
||||
* @return the myBatis SqlSession object used by taskana
|
||||
*/
|
||||
SqlSession getSqlSession() {
|
||||
return this.sessionManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* creates the MyBatis transaction factory.
|
||||
*
|
||||
* @param useManagedTransactions true if TASKANA should use a ManagedTransactionFactory.
|
||||
*/
|
||||
private void createTransactionFactory(boolean useManagedTransactions) {
|
||||
if (useManagedTransactions) {
|
||||
this.transactionFactory = new ManagedTransactionFactory();
|
||||
} else {
|
||||
this.transactionFactory = new JdbcTransactionFactory();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package pro.taskana.simplehistory.impl;
|
|||
|
||||
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
@ -10,7 +11,6 @@ import org.slf4j.LoggerFactory;
|
|||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQuery;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQueryColumnName;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
|
||||
|
@ -30,7 +30,7 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
private static final String SQL_EXCEPTION_MESSAGE =
|
||||
"Method openConnection() could not open a connection to the database.";
|
||||
|
||||
private final InternalTaskanaEngine internalTaskanaEngine;
|
||||
private final TaskanaHistoryEngineImpl taskanaHistoryEngine;
|
||||
private final List<String> orderColumns;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -71,8 +71,8 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
private String[] orgLevel3Like;
|
||||
private String[] orgLevel4Like;
|
||||
|
||||
public WorkbasketHistoryQueryImpl(InternalTaskanaEngine internalTaskanaEngine) {
|
||||
this.internalTaskanaEngine = internalTaskanaEngine;
|
||||
public WorkbasketHistoryQueryImpl(TaskanaHistoryEngineImpl internalTaskanaHistoryEngine) {
|
||||
this.taskanaHistoryEngine = internalTaskanaHistoryEngine;
|
||||
this.orderBy = new ArrayList<>();
|
||||
this.orderColumns = new ArrayList<>();
|
||||
}
|
||||
|
@ -475,11 +475,14 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
public List<WorkbasketHistoryEvent> list() {
|
||||
List<WorkbasketHistoryEvent> result = new ArrayList<>();
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_MAPPER, this);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -487,12 +490,15 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
public List<WorkbasketHistoryEvent> list(int offset, int limit) {
|
||||
List<WorkbasketHistoryEvent> result = new ArrayList<>();
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
taskanaHistoryEngine.openConnection();
|
||||
RowBounds rowBounds = new RowBounds(offset, limit);
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,14 +512,17 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
this.addOrderCriteria(columnName.toString(), sortDirection);
|
||||
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this);
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
this.orderBy = cacheOrderBy;
|
||||
this.columnName = null;
|
||||
this.orderColumns.remove(orderColumns.size() - 1);
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -521,12 +530,15 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
public WorkbasketHistoryEvent single() {
|
||||
WorkbasketHistoryEvent result = null;
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
result = internalTaskanaEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
result = taskanaHistoryEngine.getSqlSession().selectOne(LINK_TO_MAPPER, this);
|
||||
|
||||
return result;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return result;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -534,11 +546,14 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
|||
public long count() {
|
||||
Long rowCount;
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
rowCount = internalTaskanaEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this);
|
||||
taskanaHistoryEngine.openConnection();
|
||||
rowCount = taskanaHistoryEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this);
|
||||
return (rowCount == null) ? 0L : rowCount;
|
||||
} catch (SQLException e) {
|
||||
LOGGER.error(SQL_EXCEPTION_MESSAGE, e.getCause());
|
||||
return -1;
|
||||
} finally {
|
||||
internalTaskanaEngine.returnConnection();
|
||||
taskanaHistoryEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,29 +25,32 @@ import pro.taskana.common.internal.jobs.AbstractTaskanaJob;
|
|||
import pro.taskana.common.internal.transaction.TaskanaTransactionProvider;
|
||||
import pro.taskana.common.internal.util.CollectionUtil;
|
||||
import pro.taskana.simplehistory.impl.SimpleHistoryServiceImpl;
|
||||
import pro.taskana.simplehistory.impl.TaskanaHistoryEngineImpl;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEventType;
|
||||
|
||||
public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(HistoryCleanupJob.class);
|
||||
|
||||
private final TaskanaHistoryEngineImpl taskanaHistoryEngine =
|
||||
TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngineImpl);
|
||||
|
||||
private final boolean allCompletedSameParentBusiness =
|
||||
taskanaEngineImpl
|
||||
.getConfiguration()
|
||||
.isSimpleHistoryCleanupJobAllCompletedSameParentBusiness();
|
||||
|
||||
private final Duration minimumAge =
|
||||
taskanaEngineImpl.getConfiguration().getSimpleHistoryCleanupJobMinimumAge();
|
||||
private final int batchSize =
|
||||
taskanaEngineImpl.getConfiguration().getSimpleHistoryCleanupJobBatchSize();
|
||||
private SimpleHistoryServiceImpl simpleHistoryService = null;
|
||||
|
||||
public HistoryCleanupJob(
|
||||
TaskanaEngine taskanaEngine,
|
||||
TaskanaTransactionProvider txProvider,
|
||||
ScheduledJob scheduledJob) {
|
||||
super(taskanaEngine, txProvider, scheduledJob, true);
|
||||
simpleHistoryService = new SimpleHistoryServiceImpl();
|
||||
simpleHistoryService.initialize(taskanaEngine);
|
||||
}
|
||||
|
||||
public static Duration getLockExpirationPeriod(TaskanaConfiguration taskanaConfiguration) {
|
||||
|
@ -59,6 +62,9 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
|||
Instant createdBefore = Instant.now().minus(minimumAge);
|
||||
LOGGER.info("Running job to delete all history events created before ({})", createdBefore);
|
||||
try {
|
||||
SimpleHistoryServiceImpl simpleHistoryService =
|
||||
(SimpleHistoryServiceImpl) taskanaHistoryEngine.getTaskanaHistoryService();
|
||||
|
||||
List<TaskHistoryEvent> historyEventCandidatesToClean =
|
||||
simpleHistoryService
|
||||
.createTaskHistoryQuery()
|
||||
|
@ -66,8 +72,7 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
|||
.eventTypeIn(
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
TaskHistoryEventType.CANCELLED.getName(),
|
||||
TaskHistoryEventType.TERMINATED.getName(),
|
||||
TaskHistoryEventType.DELETED.getName())
|
||||
TaskHistoryEventType.TERMINATED.getName())
|
||||
.list();
|
||||
|
||||
Set<String> taskIdsToDeleteHistoryEventsFor;
|
||||
|
@ -175,6 +180,9 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
|||
|
||||
private int deleteEvents(List<String> taskIdsToDeleteHistoryEventsFor)
|
||||
throws InvalidArgumentException, NotAuthorizedException {
|
||||
SimpleHistoryServiceImpl simpleHistoryService =
|
||||
(SimpleHistoryServiceImpl) taskanaHistoryEngine.getTaskanaHistoryService();
|
||||
|
||||
int deletedTasksCount =
|
||||
(int)
|
||||
simpleHistoryService
|
||||
|
|
|
@ -19,6 +19,7 @@ import pro.taskana.common.internal.util.IdGenerator;
|
|||
import pro.taskana.common.test.config.DataSourceGenerator;
|
||||
import pro.taskana.sampledata.SampleDataGenerator;
|
||||
import pro.taskana.simplehistory.impl.SimpleHistoryServiceImpl;
|
||||
import pro.taskana.simplehistory.impl.TaskanaHistoryEngineImpl;
|
||||
import pro.taskana.simplehistory.impl.classification.ClassificationHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQueryMapper;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryEventMapper;
|
||||
|
@ -32,6 +33,7 @@ import pro.taskana.task.internal.models.ObjectReferenceImpl;
|
|||
public abstract class AbstractAccTest {
|
||||
|
||||
protected static TaskanaConfiguration taskanaConfiguration;
|
||||
protected static TaskanaHistoryEngineImpl taskanaHistoryEngine;
|
||||
protected static TaskanaEngine taskanaEngine;
|
||||
protected static SimpleHistoryServiceImpl historyService;
|
||||
|
||||
|
@ -114,6 +116,7 @@ public abstract class AbstractAccTest {
|
|||
taskanaConfiguration = configuration;
|
||||
taskanaEngine =
|
||||
TaskanaEngine.buildTaskanaEngine(taskanaConfiguration, ConnectionManagementMode.AUTOCOMMIT);
|
||||
taskanaHistoryEngine = TaskanaHistoryEngineImpl.createTaskanaEngine(taskanaEngine);
|
||||
taskService = taskanaEngine.getTaskService();
|
||||
historyService = new SimpleHistoryServiceImpl();
|
||||
historyService.initialize(taskanaEngine);
|
||||
|
@ -126,10 +129,10 @@ public abstract class AbstractAccTest {
|
|||
protected TaskHistoryQueryMapper getHistoryQueryMapper()
|
||||
throws NoSuchFieldException, IllegalAccessException {
|
||||
|
||||
Field sessionManagerField = TaskanaEngineImpl.class.getDeclaredField("sessionManager");
|
||||
Field sessionManagerField = TaskanaHistoryEngineImpl.class.getDeclaredField("sessionManager");
|
||||
sessionManagerField.setAccessible(true);
|
||||
SqlSessionManager sqlSessionManager =
|
||||
(SqlSessionManager) sessionManagerField.get(taskanaEngine);
|
||||
(SqlSessionManager) sessionManagerField.get(taskanaHistoryEngine);
|
||||
|
||||
return sqlSessionManager.getMapper(TaskHistoryQueryMapper.class);
|
||||
}
|
||||
|
@ -157,32 +160,32 @@ public abstract class AbstractAccTest {
|
|||
|
||||
protected static WorkbasketHistoryEventMapper getWorkbasketHistoryEventMapper() {
|
||||
try {
|
||||
Field sessionManager = TaskanaEngineImpl.class.getDeclaredField("sessionManager");
|
||||
Field sessionManager = TaskanaHistoryEngineImpl.class.getDeclaredField("sessionManager");
|
||||
sessionManager.setAccessible(true);
|
||||
SqlSessionManager manager = (SqlSessionManager) sessionManager.get(taskanaEngine);
|
||||
SqlSessionManager manager = (SqlSessionManager) sessionManager.get(taskanaHistoryEngine);
|
||||
return manager.getMapper(WorkbasketHistoryEventMapper.class);
|
||||
} catch (Exception e) {
|
||||
throw new JUnitException(
|
||||
String.format(
|
||||
"Could not extract %s from %s",
|
||||
WorkbasketHistoryEventMapper.class, TaskanaEngineImpl.class));
|
||||
WorkbasketHistoryEventMapper.class, TaskanaHistoryEngineImpl.class));
|
||||
}
|
||||
}
|
||||
|
||||
protected static ClassificationHistoryEventMapper getClassificationHistoryEventMapper() {
|
||||
try {
|
||||
Field sessionManager = TaskanaEngineImpl.class.getDeclaredField("sessionManager");
|
||||
Field sessionManager = TaskanaHistoryEngineImpl.class.getDeclaredField("sessionManager");
|
||||
|
||||
sessionManager.setAccessible(true);
|
||||
|
||||
SqlSessionManager manager = (SqlSessionManager) sessionManager.get(taskanaEngine);
|
||||
SqlSessionManager manager = (SqlSessionManager) sessionManager.get(taskanaHistoryEngine);
|
||||
return manager.getMapper(ClassificationHistoryEventMapper.class);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new JUnitException(
|
||||
String.format(
|
||||
"Could not extract %s from %s",
|
||||
ClassificationHistoryEventMapper.class, TaskanaEngineImpl.class));
|
||||
ClassificationHistoryEventMapper.class, TaskanaHistoryEngineImpl.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,123 +0,0 @@
|
|||
package acceptance.events.task;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import pro.taskana.classification.api.ClassificationService;
|
||||
import pro.taskana.classification.api.models.ClassificationSummary;
|
||||
import pro.taskana.common.api.TaskanaEngine;
|
||||
import pro.taskana.common.test.security.JaasExtension;
|
||||
import pro.taskana.common.test.security.WithAccessId;
|
||||
import pro.taskana.simplehistory.impl.SimpleHistoryServiceImpl;
|
||||
import pro.taskana.spi.history.api.TaskanaHistory;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEventType;
|
||||
import pro.taskana.task.api.TaskService;
|
||||
import pro.taskana.task.api.TaskState;
|
||||
import pro.taskana.task.api.models.Task;
|
||||
import pro.taskana.testapi.DefaultTestEntities;
|
||||
import pro.taskana.testapi.TaskanaInject;
|
||||
import pro.taskana.testapi.TaskanaIntegrationTest;
|
||||
import pro.taskana.testapi.WithServiceProvider;
|
||||
import pro.taskana.testapi.builder.TaskBuilder;
|
||||
import pro.taskana.workbasket.api.WorkbasketService;
|
||||
import pro.taskana.workbasket.api.models.WorkbasketSummary;
|
||||
|
||||
@TaskanaIntegrationTest
|
||||
@WithServiceProvider(
|
||||
serviceProviderInterface = TaskanaHistory.class,
|
||||
serviceProviders = SimpleHistoryServiceImpl.class)
|
||||
@ExtendWith(JaasExtension.class)
|
||||
class CreateHistoryEventOnTaskDeletionAccTest {
|
||||
@TaskanaInject TaskanaEngine taskanaEngine;
|
||||
@TaskanaInject TaskService taskService;
|
||||
@TaskanaInject WorkbasketService workbasketService;
|
||||
@TaskanaInject ClassificationService classificationService;
|
||||
ClassificationSummary defaultClassificationSummary;
|
||||
WorkbasketSummary defaultWorkbasketSummary;
|
||||
Task task1;
|
||||
Task task2;
|
||||
Task task3;
|
||||
Task task4;
|
||||
SimpleHistoryServiceImpl historyService;
|
||||
|
||||
@WithAccessId(user = "admin")
|
||||
@BeforeAll
|
||||
void setUp() throws Exception {
|
||||
|
||||
defaultClassificationSummary =
|
||||
DefaultTestEntities.defaultTestClassification()
|
||||
.buildAndStoreAsSummary(classificationService);
|
||||
defaultWorkbasketSummary =
|
||||
DefaultTestEntities.defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
|
||||
|
||||
task1 = createTask().buildAndStore(taskService);
|
||||
task2 = createTask().state(TaskState.COMPLETED).buildAndStore(taskService);
|
||||
task3 = createTask().state(TaskState.COMPLETED).buildAndStore(taskService);
|
||||
task4 = createTask().state(TaskState.COMPLETED).buildAndStore(taskService);
|
||||
|
||||
historyService = new SimpleHistoryServiceImpl();
|
||||
historyService.initialize(taskanaEngine);
|
||||
}
|
||||
|
||||
@WithAccessId(user = "admin")
|
||||
@Test
|
||||
void should_CreateDeleteHistoryEvent_When_TaskIsDeleted() throws Exception {
|
||||
|
||||
historyService.deleteHistoryEventsByTaskIds(List.of(task4.getId()));
|
||||
|
||||
taskService.deleteTask(task4.getId());
|
||||
|
||||
List<TaskHistoryEvent> events =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(task4.getId()).list();
|
||||
assertThat(events).hasSize(1);
|
||||
assertDeleteHistoryEvent(events.get(0).getId(), "admin", task4.getId());
|
||||
}
|
||||
|
||||
@WithAccessId(user = "admin")
|
||||
@Test
|
||||
void should_CreateDeleteHistoryEvent_When_TaskIsForceDeleted() throws Exception {
|
||||
historyService.deleteHistoryEventsByTaskIds(List.of(task1.getId()));
|
||||
|
||||
taskService.forceDeleteTask(task1.getId());
|
||||
|
||||
List<TaskHistoryEvent> events =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(task1.getId()).list();
|
||||
assertThat(events).hasSize(1);
|
||||
assertDeleteHistoryEvent(events.get(0).getId(), "admin", task1.getId());
|
||||
}
|
||||
|
||||
@WithAccessId(user = "admin")
|
||||
@Test
|
||||
void should_CreateDeleteHistoryEvents_When_MultipleTasksAreDeleted() throws Exception {
|
||||
List<String> taskIds = List.of(task2.getId(), task3.getId());
|
||||
historyService.deleteHistoryEventsByTaskIds(taskIds);
|
||||
|
||||
taskService.deleteTasks(taskIds);
|
||||
|
||||
TaskHistoryEvent eventTask2 =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(task2.getId()).single();
|
||||
TaskHistoryEvent eventTask3 =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(task3.getId()).single();
|
||||
assertDeleteHistoryEvent(eventTask2.getId(), "admin", task2.getId());
|
||||
assertDeleteHistoryEvent(eventTask3.getId(), "admin", task3.getId());
|
||||
}
|
||||
|
||||
private void assertDeleteHistoryEvent(String eventId, String expectedUser, String taskId)
|
||||
throws Exception {
|
||||
TaskHistoryEvent event = historyService.getTaskHistoryEvent(eventId);
|
||||
assertThat(event.getUserId()).isEqualTo(expectedUser);
|
||||
assertThat(event.getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
|
||||
assertThat(event.getTaskId()).isEqualTo(taskId);
|
||||
}
|
||||
|
||||
private TaskBuilder createTask() {
|
||||
return TaskBuilder.newTask()
|
||||
.classificationSummary(defaultClassificationSummary)
|
||||
.workbasketSummary(defaultWorkbasketSummary)
|
||||
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build());
|
||||
}
|
||||
}
|
|
@ -15,7 +15,6 @@ import pro.taskana.common.test.security.WithAccessId;
|
|||
import pro.taskana.simplehistory.impl.TaskHistoryQueryImpl;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQueryMapper;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEventType;
|
||||
import pro.taskana.task.api.exceptions.TaskNotFoundException;
|
||||
|
||||
@ExtendWith(JaasExtension.class)
|
||||
|
@ -48,8 +47,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
|||
listEvents =
|
||||
taskHistoryQueryMapper.queryHistoryEvents(
|
||||
(TaskHistoryQueryImpl) historyService.createTaskHistoryQuery().taskIdIn(taskid));
|
||||
assertThat(listEvents).hasSize(1);
|
||||
assertThat(listEvents.get(0).getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
|
||||
assertThat(listEvents).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -89,9 +87,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
|||
taskHistoryQueryMapper.queryHistoryEvents(
|
||||
(TaskHistoryQueryImpl)
|
||||
historyService.createTaskHistoryQuery().taskIdIn(taskId_1, taskId_2));
|
||||
assertThat(listEvents).hasSize(2);
|
||||
assertThat(listEvents.get(0).getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
|
||||
assertThat(listEvents.get(1).getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
|
||||
assertThat(listEvents).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -123,7 +119,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
|||
listEvents =
|
||||
taskHistoryQueryMapper.queryHistoryEvents(
|
||||
(TaskHistoryQueryImpl) historyService.createTaskHistoryQuery().taskIdIn(taskId));
|
||||
assertThat(listEvents).hasSize(3);
|
||||
assertThat(listEvents).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -156,7 +152,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
|||
taskHistoryQueryMapper.queryHistoryEvents(
|
||||
(TaskHistoryQueryImpl)
|
||||
historyService.createTaskHistoryQuery().taskIdIn(taskId_1, taskId_2));
|
||||
assertThat(listEvents).hasSize(4);
|
||||
assertThat(listEvents).hasSize(2);
|
||||
}
|
||||
|
||||
private void createTaskanaEngineWithNewConfig(boolean deleteHistoryOnTaskDeletionEnabled)
|
||||
|
|
|
@ -0,0 +1,519 @@
|
|||
package acceptance.jobs;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import acceptance.AbstractAccTest;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DynamicTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestFactory;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.junit.jupiter.api.function.ThrowingConsumer;
|
||||
import pro.taskana.TaskanaConfiguration;
|
||||
import pro.taskana.classification.internal.jobs.ClassificationChangedJob;
|
||||
import pro.taskana.common.api.ScheduledJob;
|
||||
import pro.taskana.common.internal.jobs.AbstractTaskanaJob;
|
||||
import pro.taskana.common.internal.util.Pair;
|
||||
import pro.taskana.common.test.config.DataSourceGenerator;
|
||||
import pro.taskana.common.test.security.JaasExtension;
|
||||
import pro.taskana.common.test.security.WithAccessId;
|
||||
import pro.taskana.simplehistory.impl.jobs.HistoryCleanupJob;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEventType;
|
||||
import pro.taskana.task.internal.jobs.TaskRefreshJob;
|
||||
|
||||
@ExtendWith(JaasExtension.class)
|
||||
class HistoryCleanupJobAccTest extends AbstractAccTest {
|
||||
|
||||
@BeforeEach
|
||||
void before() throws Exception {
|
||||
resetDb(DataSourceGenerator.getSchemaName());
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithAccessId(user = "admin")
|
||||
void should_CleanHistoryEventsUntilDate_When_SameParentBusinessTrueAndEventsQualified()
|
||||
throws Exception {
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned2 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned2.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned2.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned3 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned3.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned3.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned4 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CANCELLED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned4.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned4.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned5 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId3",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned5.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned5.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned6 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId3",
|
||||
TaskHistoryEventType.TERMINATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned6.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned6.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
getHistoryService().create(eventToBeCleaned);
|
||||
getHistoryService().create(eventToBeCleaned2);
|
||||
getHistoryService().create(eventToBeCleaned3);
|
||||
getHistoryService().create(eventToBeCleaned4);
|
||||
getHistoryService().create(eventToBeCleaned5);
|
||||
getHistoryService().create(eventToBeCleaned6);
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(20);
|
||||
|
||||
createTaskanaEngineWithNewConfig(true);
|
||||
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
job.run();
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithAccessId(user = "admin")
|
||||
void should_NotCleanHistoryEventsUntilDate_When_MinimumAgeNotReached() throws Exception {
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned2 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned2.setCreated(Instant.now().minus(5, ChronoUnit.DAYS));
|
||||
eventToBeCleaned2.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
getHistoryService().create(eventToBeCleaned);
|
||||
getHistoryService().create(eventToBeCleaned2);
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(16);
|
||||
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
job.run();
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(16);
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithAccessId(user = "admin")
|
||||
void should_NotCleanHistoryEvents_When_SameParentBusinessTrueAndActiveTaskInParentBusiness()
|
||||
throws Exception {
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned2 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned2.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned2.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned3 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned3.setCreated(Instant.now().minus(1, ChronoUnit.DAYS));
|
||||
eventToBeCleaned3.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
getHistoryService().create(eventToBeCleaned);
|
||||
getHistoryService().create(eventToBeCleaned2);
|
||||
getHistoryService().create(eventToBeCleaned3);
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(17);
|
||||
|
||||
createTaskanaEngineWithNewConfig(true);
|
||||
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
job.run();
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(17);
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithAccessId(user = "admin")
|
||||
void should_NotCleanHistoryEvents_When_MinimumAgeOfOtherEndtstateEventInParentBusinessNotReached()
|
||||
throws Exception {
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned2 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned2.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned2.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned3 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned3.setCreated(Instant.now().minus(3, ChronoUnit.DAYS));
|
||||
eventToBeCleaned3.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned4 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CANCELLED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned4.setCreated(Instant.now().minus(5, ChronoUnit.DAYS));
|
||||
eventToBeCleaned4.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
getHistoryService().create(eventToBeCleaned);
|
||||
getHistoryService().create(eventToBeCleaned2);
|
||||
getHistoryService().create(eventToBeCleaned3);
|
||||
getHistoryService().create(eventToBeCleaned4);
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(18);
|
||||
|
||||
createTaskanaEngineWithNewConfig(true);
|
||||
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
job.run();
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(18);
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithAccessId(user = "admin")
|
||||
void should_CleanHistoryEventsUntilDate_When_SameParentBusinessFalse() throws Exception {
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned2 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned2.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned2.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned3 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned3.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned3.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned4 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.CANCELLED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned4.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned4.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned5 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId3",
|
||||
TaskHistoryEventType.CREATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned5.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
eventToBeCleaned5.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
TaskHistoryEvent eventToBeCleaned6 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId3",
|
||||
TaskHistoryEventType.TERMINATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
eventToBeCleaned6.setCreated(Instant.now().minus(5, ChronoUnit.DAYS));
|
||||
eventToBeCleaned6.setParentBusinessProcessId("sameParentId");
|
||||
|
||||
getHistoryService().create(eventToBeCleaned);
|
||||
getHistoryService().create(eventToBeCleaned2);
|
||||
getHistoryService().create(eventToBeCleaned3);
|
||||
getHistoryService().create(eventToBeCleaned4);
|
||||
getHistoryService().create(eventToBeCleaned5);
|
||||
getHistoryService().create(eventToBeCleaned6);
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(20);
|
||||
|
||||
createTaskanaEngineWithNewConfig(false);
|
||||
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
job.run();
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(16);
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithAccessId(user = "admin")
|
||||
void should_NotCleanEvents_When_NoCreatedEventsForParentBusinessProcessIdExist()
|
||||
throws Exception {
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(14);
|
||||
|
||||
TaskHistoryEvent toBeIgnored1 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId1",
|
||||
TaskHistoryEventType.CANCELLED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
toBeIgnored1.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
toBeIgnored1.setParentBusinessProcessId("toBeIgnored1");
|
||||
|
||||
TaskHistoryEvent toBeIgnored2 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId2",
|
||||
TaskHistoryEventType.COMPLETED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
toBeIgnored2.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
toBeIgnored2.setParentBusinessProcessId("toBeIgnored2");
|
||||
|
||||
TaskHistoryEvent toBeIgnored3 =
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
"taskId3",
|
||||
TaskHistoryEventType.TERMINATED.getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails");
|
||||
toBeIgnored3.setCreated(Instant.now().minus(20, ChronoUnit.DAYS));
|
||||
toBeIgnored3.setParentBusinessProcessId("toBeIgnored3");
|
||||
|
||||
getHistoryService().create(toBeIgnored1);
|
||||
getHistoryService().create(toBeIgnored2);
|
||||
getHistoryService().create(toBeIgnored3);
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(17);
|
||||
|
||||
createTaskanaEngineWithNewConfig(true);
|
||||
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
job.run();
|
||||
|
||||
assertThat(getHistoryService().createTaskHistoryQuery().count()).isEqualTo(17);
|
||||
}
|
||||
|
||||
@WithAccessId(user = "admin")
|
||||
@Test
|
||||
void should_DeleteOldHistoryCleanupJobs_When_InitializingSchedule() throws Exception {
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
ScheduledJob job = new ScheduledJob();
|
||||
job.setType(HistoryCleanupJob.class.getName());
|
||||
taskanaEngine.getJobService().createJob(job);
|
||||
job.setType(TaskRefreshJob.class.getName());
|
||||
taskanaEngine.getJobService().createJob(job);
|
||||
job.setType(ClassificationChangedJob.class.getName());
|
||||
taskanaEngine.getJobService().createJob(job);
|
||||
}
|
||||
|
||||
List<ScheduledJob> jobsToRun = getJobMapper().findJobsToRun(Instant.now());
|
||||
|
||||
assertThat(jobsToRun).hasSize(30);
|
||||
|
||||
List<ScheduledJob> historyCleanupJobs =
|
||||
jobsToRun.stream()
|
||||
.filter(
|
||||
scheduledJob -> scheduledJob.getType().equals(HistoryCleanupJob.class.getName()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
AbstractTaskanaJob.initializeSchedule(taskanaEngine, HistoryCleanupJob.class);
|
||||
|
||||
jobsToRun = getJobMapper().findJobsToRun(Instant.now());
|
||||
|
||||
assertThat(jobsToRun).doesNotContainAnyElementsOf(historyCleanupJobs);
|
||||
}
|
||||
|
||||
@WithAccessId(user = "admin")
|
||||
@TestFactory
|
||||
Stream<DynamicTest>
|
||||
should_CleanTaskHistoryEventsWithParentProcessIdEmptyOrNull_When_TaskCompleted()
|
||||
throws SQLException {
|
||||
Iterator<String> iterator = Arrays.asList("", null).iterator();
|
||||
String taskId1 = "taskId1";
|
||||
String taskId2 = "taskId2";
|
||||
List<TaskHistoryEvent> events =
|
||||
Stream.of(
|
||||
Pair.of(taskId1, TaskHistoryEventType.CREATED),
|
||||
Pair.of(taskId1, TaskHistoryEventType.COMPLETED),
|
||||
Pair.of(taskId2, TaskHistoryEventType.CREATED))
|
||||
.map(
|
||||
pair ->
|
||||
createTaskHistoryEvent(
|
||||
"wbKey1",
|
||||
pair.getLeft(),
|
||||
pair.getRight().getName(),
|
||||
"wbKey2",
|
||||
"someUserId",
|
||||
"someDetails"))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
createTaskanaEngineWithNewConfig(true);
|
||||
HistoryCleanupJob job = new HistoryCleanupJob(taskanaEngine, null, null);
|
||||
|
||||
ThrowingConsumer<String> test =
|
||||
parentBusinessId -> {
|
||||
getHistoryService().deleteHistoryEventsByTaskIds(List.of(taskId1, taskId2));
|
||||
events.forEach(x -> x.setCreated(Instant.now().minus(20, ChronoUnit.DAYS)));
|
||||
events.forEach(x -> x.setParentBusinessProcessId(parentBusinessId));
|
||||
events.forEach(x -> getHistoryService().create(x));
|
||||
|
||||
job.run();
|
||||
List<TaskHistoryEvent> eventsAfterCleanup =
|
||||
getHistoryService().createTaskHistoryQuery().taskIdIn(taskId1, taskId2).list();
|
||||
|
||||
assertThat(eventsAfterCleanup)
|
||||
.extracting(TaskHistoryEvent::getTaskId)
|
||||
.containsExactly(taskId2);
|
||||
};
|
||||
|
||||
return DynamicTest.stream(iterator, c -> "for parentBusinessProcessId = '" + c + "'", test);
|
||||
}
|
||||
|
||||
private void createTaskanaEngineWithNewConfig(
|
||||
boolean simpleHistoryCleanupJobAllCompletedSameParentBusiness) throws SQLException {
|
||||
|
||||
TaskanaConfiguration configuration =
|
||||
new TaskanaConfiguration.Builder(AbstractAccTest.taskanaConfiguration)
|
||||
.simpleHistoryCleanupJobAllCompletedSameParentBusiness(
|
||||
simpleHistoryCleanupJobAllCompletedSameParentBusiness)
|
||||
.build();
|
||||
initTaskanaEngine(configuration);
|
||||
}
|
||||
}
|
|
@ -14,7 +14,6 @@ import org.junit.jupiter.api.Test;
|
|||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.common.internal.util.IdGenerator;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEventType;
|
||||
|
@ -25,13 +24,13 @@ class ClassificationHistoryQueryImplTest {
|
|||
|
||||
private ClassificationHistoryQueryImpl historyQueryImpl;
|
||||
|
||||
@Mock private InternalTaskanaEngine internalTaskanaEngineMock;
|
||||
@Mock private TaskanaHistoryEngineImpl taskanaHistoryEngineMock;
|
||||
|
||||
@Mock private SqlSession sqlSessionMock;
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
historyQueryImpl = new ClassificationHistoryQueryImpl(internalTaskanaEngineMock);
|
||||
historyQueryImpl = new ClassificationHistoryQueryImpl(taskanaHistoryEngineMock);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -41,9 +40,9 @@ class ClassificationHistoryQueryImplTest {
|
|||
createHistoryEvent(
|
||||
ClassificationHistoryEventType.CREATED.getName(), "admin", "someDetails"));
|
||||
|
||||
doNothing().when(internalTaskanaEngineMock).openConnection();
|
||||
doNothing().when(internalTaskanaEngineMock).returnConnection();
|
||||
when(internalTaskanaEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
doNothing().when(taskanaHistoryEngineMock).openConnection();
|
||||
doNothing().when(taskanaHistoryEngineMock).returnConnection();
|
||||
when(taskanaHistoryEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
when(sqlSessionMock.selectList(any(), any())).thenReturn(new ArrayList<>(returnList));
|
||||
|
||||
List<ClassificationHistoryEvent> result =
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.mockito.Spy;
|
|||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import pro.taskana.TaskanaConfiguration;
|
||||
import pro.taskana.common.api.TaskanaEngine;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryEventMapper;
|
||||
import pro.taskana.simplehistory.impl.task.TaskHistoryQueryMapper;
|
||||
import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryEventMapper;
|
||||
|
@ -41,12 +40,13 @@ class SimpleHistoryServiceImplTest {
|
|||
@Mock private WorkbasketHistoryEventMapper workbasketHistoryEventMapperMock;
|
||||
|
||||
@Mock private WorkbasketHistoryQueryMapper workbasketHistoryQueryMapperMock;
|
||||
|
||||
@Mock private TaskanaHistoryEngineImpl taskanaHistoryEngineMock;
|
||||
|
||||
@Mock private TaskanaConfiguration taskanaConfiguration;
|
||||
|
||||
@Mock private TaskanaEngine taskanaEngine;
|
||||
|
||||
@Mock private InternalTaskanaEngine internalTaskanaEngine;
|
||||
|
||||
@Mock private SqlSessionManager sqlSessionManagerMock;
|
||||
|
||||
@Mock private SqlSession sqlSessionMock;
|
||||
|
@ -58,7 +58,9 @@ class SimpleHistoryServiceImplTest {
|
|||
"wbKey1", "taskId1", "type1", "wbKey2", "someUserId", "someDetails");
|
||||
|
||||
cutSpy.create(expectedWb);
|
||||
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
||||
verify(taskHistoryEventMapperMock, times(1)).insert(expectedWb);
|
||||
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
||||
assertThat(expectedWb.getCreated()).isNotNull();
|
||||
}
|
||||
|
||||
|
@ -69,7 +71,9 @@ class SimpleHistoryServiceImplTest {
|
|||
"wbKey1", WorkbasketHistoryEventType.CREATED.getName(), "someUserId", "someDetails");
|
||||
|
||||
cutSpy.create(expectedEvent);
|
||||
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
||||
verify(workbasketHistoryEventMapperMock, times(1)).insert(expectedEvent);
|
||||
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
||||
assertThat(expectedEvent.getCreated()).isNotNull();
|
||||
}
|
||||
|
||||
|
@ -80,21 +84,20 @@ class SimpleHistoryServiceImplTest {
|
|||
AbstractAccTest.createTaskHistoryEvent(
|
||||
"wbKey1", "taskId1", "type1", "wbKey2", "someUserId", "someDetails"));
|
||||
|
||||
when(taskanaHistoryEngineMock.getConfiguration()).thenReturn(taskanaConfiguration);
|
||||
when(taskanaConfiguration.isAddAdditionalUserInfo()).thenReturn(false);
|
||||
|
||||
when(internalTaskanaEngine.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
when(taskanaHistoryEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
when(sqlSessionMock.selectList(any(), any())).thenReturn(new ArrayList<>(returnList));
|
||||
|
||||
when(internalTaskanaEngine.getEngine()).thenReturn(taskanaEngine);
|
||||
when(taskanaEngine.getConfiguration()).thenReturn(taskanaConfiguration);
|
||||
final List<TaskHistoryEvent> result =
|
||||
cutSpy.createTaskHistoryQuery().taskIdIn("taskId1").list();
|
||||
|
||||
verify(internalTaskanaEngine, times(1)).openConnection();
|
||||
verify(internalTaskanaEngine, times(1)).getSqlSession();
|
||||
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
||||
verify(taskanaHistoryEngineMock, times(1)).getSqlSession();
|
||||
verify(sqlSessionMock, times(1)).selectList(any(), any());
|
||||
|
||||
verify(internalTaskanaEngine, times(1)).returnConnection();
|
||||
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
||||
assertThat(result).hasSize(returnList.size());
|
||||
assertThat(result.get(0).getWorkbasketKey()).isEqualTo(returnList.get(0).getWorkbasketKey());
|
||||
}
|
||||
|
@ -105,15 +108,16 @@ class SimpleHistoryServiceImplTest {
|
|||
returnList.add(
|
||||
AbstractAccTest.createWorkbasketHistoryEvent(
|
||||
"wbKey1", WorkbasketHistoryEventType.CREATED.getName(), "someUserId", "someDetails"));
|
||||
when(taskanaHistoryEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
when(sqlSessionMock.selectList(any(), any())).thenReturn(new ArrayList<>(returnList));
|
||||
when(internalTaskanaEngine.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
|
||||
final List<WorkbasketHistoryEvent> result =
|
||||
cutSpy.createWorkbasketHistoryQuery().keyIn("wbKey1").list();
|
||||
|
||||
verify(internalTaskanaEngine, times(1)).openConnection();
|
||||
verify(internalTaskanaEngine, times(1)).getSqlSession();
|
||||
verify(taskanaHistoryEngineMock, times(1)).openConnection();
|
||||
verify(taskanaHistoryEngineMock, times(1)).getSqlSession();
|
||||
verify(sqlSessionMock, times(1)).selectList(any(), any());
|
||||
verify(internalTaskanaEngine, times(1)).returnConnection();
|
||||
verify(taskanaHistoryEngineMock, times(1)).returnConnection();
|
||||
assertThat(result).hasSize(returnList.size());
|
||||
assertThat(result.get(0).getKey()).isEqualTo(returnList.get(0).getKey());
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import pro.taskana.common.api.TimeInterval;
|
||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||
import pro.taskana.common.internal.util.IdGenerator;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEventType;
|
||||
|
@ -25,7 +24,7 @@ import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEventType;
|
|||
@ExtendWith(MockitoExtension.class)
|
||||
class WorkbasketHistoryQueryImplTest {
|
||||
|
||||
@Mock private InternalTaskanaEngine internalTaskanaEngineMock;
|
||||
@Mock private TaskanaHistoryEngineImpl taskanaHistoryEngineMock;
|
||||
|
||||
private WorkbasketHistoryQueryImpl historyQueryImpl;
|
||||
|
||||
|
@ -33,7 +32,7 @@ class WorkbasketHistoryQueryImplTest {
|
|||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
historyQueryImpl = new WorkbasketHistoryQueryImpl(internalTaskanaEngineMock);
|
||||
historyQueryImpl = new WorkbasketHistoryQueryImpl(taskanaHistoryEngineMock);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -48,9 +47,9 @@ class WorkbasketHistoryQueryImplTest {
|
|||
null));
|
||||
TimeInterval interval = new TimeInterval(Instant.now().minusNanos(1000), Instant.now());
|
||||
|
||||
doNothing().when(internalTaskanaEngineMock).openConnection();
|
||||
doNothing().when(internalTaskanaEngineMock).returnConnection();
|
||||
when(internalTaskanaEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
doNothing().when(taskanaHistoryEngineMock).openConnection();
|
||||
doNothing().when(taskanaHistoryEngineMock).returnConnection();
|
||||
when(taskanaHistoryEngineMock.getSqlSession()).thenReturn(sqlSessionMock);
|
||||
when(sqlSessionMock.selectList(any(), any())).thenReturn(new ArrayList<>(returnList));
|
||||
|
||||
List<WorkbasketHistoryEvent> result =
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana.history</groupId>
|
||||
<artifactId>taskana-history-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -44,13 +44,13 @@
|
|||
<artifactId>spring-hateoas</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.plugin</groupId>
|
||||
<artifactId>spring-plugin-core</artifactId>
|
||||
<version>${version.spring.plugin.core}</version>
|
||||
<version>${version.spring.core}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -112,6 +112,11 @@
|
|||
<artifactId>spring-security-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.restdocs</groupId>
|
||||
<artifactId>spring-restdocs-mockmvc</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
|
@ -127,6 +132,12 @@
|
|||
<artifactId>h2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>capital.scalable</groupId>
|
||||
<artifactId>spring-auto-restdocs-core</artifactId>
|
||||
<version>${version.auto-restdocs}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
|
@ -136,6 +147,28 @@
|
|||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${version.maven.resources}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/generated-javadoc-json</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>../../rest/taskana-rest-spring/target/generated-javadoc-json
|
||||
</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
|
@ -149,6 +182,61 @@
|
|||
</tag>
|
||||
</tags>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-javadoc-json</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>javadoc-no-fork</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
|
||||
<docletArtifact>
|
||||
<groupId>capital.scalable</groupId>
|
||||
<artifactId>spring-auto-restdocs-json-doclet-jdk9</artifactId>
|
||||
<version>${version.auto-restdocs}</version>
|
||||
</docletArtifact>
|
||||
<destDir>generated-javadoc-json</destDir>
|
||||
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
|
||||
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||
<show>package</show>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<version>${version.maven.asciidoctor}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-docs</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<backend>html5</backend>
|
||||
<doctype>book</doctype>
|
||||
<attributes>
|
||||
<snippets>${project.build.directory}/generated-snippets</snippets>
|
||||
<doctype>book</doctype>
|
||||
<icons>font</icons>
|
||||
<source-highlighter>highlightjs</source-highlighter>
|
||||
<toc>left</toc>
|
||||
<docinfo>shared</docinfo>
|
||||
<toclevels>4</toclevels>
|
||||
<sectlinks/>
|
||||
</attributes>
|
||||
<logHandler>
|
||||
<outputToConsole>false</outputToConsole>
|
||||
<failIf>
|
||||
<severity>ERROR</severity>
|
||||
</failIf>
|
||||
</logHandler>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
<!-- Sourcecode at https://stackoverflow.com/questions/34481638/how-to-use-tocify-with-asciidoctor-for-a-dynamic-toc -->
|
||||
<!-- Generate a nice TOC -->
|
||||
<script src="jquery-1.12.4.min.js"></script>
|
||||
<script src="jquery-ui.min.js"></script>
|
||||
<script src="jquery.tocify.min.js"></script>
|
||||
<!-- We do not need the tocify CSS because the asciidoc CSS already provides most of what we need -->
|
||||
|
||||
<style>
|
||||
.tocify-header {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.tocify-subheader {
|
||||
font-style: normal;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.tocify ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tocify-focus {
|
||||
color: #7a2518;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.tocify-focus > a {
|
||||
color: #7a2518;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1750px) {
|
||||
#toc.toc2 {
|
||||
width: 25em;
|
||||
}
|
||||
|
||||
#header, #content, #footer, #footnotes {
|
||||
max-width: 80em;
|
||||
}
|
||||
}
|
||||
|
||||
.sect1:not(#_overview) .sect2 + .sect2 {
|
||||
margin-top: 5em;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
// Add a new container for the tocify toc into the existing toc so we can re-use its
|
||||
// styling
|
||||
$("#toc").append("<div id='generated-toc'></div>");
|
||||
$("#generated-toc").tocify({
|
||||
extendPage: true,
|
||||
context: "#content",
|
||||
highlightOnScroll: true,
|
||||
hideEffect: "slideUp",
|
||||
// Use the IDs that asciidoc already provides so that TOC links and intra-document
|
||||
// links are the same. Anything else might confuse users when they create bookmarks.
|
||||
hashGenerator: function (text, element) {
|
||||
return $(element).attr("id");
|
||||
},
|
||||
// Smooth scrolling doesn't work properly if we use the asciidoc IDs
|
||||
smoothScroll: false,
|
||||
// Set to 'none' to use the tocify classes
|
||||
theme: "none",
|
||||
// Handle book (may contain h1) and article (only h2 deeper)
|
||||
selectors: $("#content").has("h1").size() > 0 ? "h1,h2,h3,h4,h5" : "h2,h3,h4,h5",
|
||||
ignoreSelector: ".discrete"
|
||||
});
|
||||
|
||||
// Switch between static asciidoc toc and dynamic tocify toc based on browser size
|
||||
// This is set to match the media selectors in the asciidoc CSS
|
||||
// Without this, we keep the dynamic toc even if it is moved from the side to preamble
|
||||
// position which will cause odd scrolling behavior
|
||||
const handleTocOnResize = function () {
|
||||
if ($(document).width() < 768) {
|
||||
$("#generated-toc").hide();
|
||||
$(".sectlevel0").show();
|
||||
$(".sectlevel1").show();
|
||||
} else {
|
||||
$("#generated-toc").show();
|
||||
$(".sectlevel0").hide();
|
||||
$(".sectlevel1").hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(window).resize(handleTocOnResize);
|
||||
handleTocOnResize();
|
||||
});
|
||||
</script>
|
5
history/taskana-simplehistory-rest-spring/src/docs/asciidoc/jquery-1.12.4.min.js
vendored
Normal file
13
history/taskana-simplehistory-rest-spring/src/docs/asciidoc/jquery-ui.min.js
vendored
Normal file
4
history/taskana-simplehistory-rest-spring/src/docs/asciidoc/jquery.tocify.min.js
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
= TASKANA History module RESTful API Documentation
|
||||
|
||||
== Overview
|
||||
This is the REST documentation for http://taskana.pro)[TASKANA]'s simplehistory REST endpoints.
|
||||
|
||||
*For all Query Parameters:* +
|
||||
Whenever a parameter is an array type, several values can be passed by declaring that parameter multiple times.
|
||||
|
||||
Whenever a parameter is a complex type, the attributes of the value-object can be passed as a json.
|
||||
For example, a complex parameter with the name "complex-query-param" and attributes "attribute1" and "attribute2"
|
||||
would be specified in the following way: +
|
||||
complex-query-param={"attribute1":"value1","attribute2":"value2"}
|
||||
|
||||
=== Hypermedia Support
|
||||
|
||||
NOTE: HATEOAS support is still in development.
|
||||
Please have a look at example responses for each resource to determine the available links.
|
||||
|
||||
TASKANA uses the https://restfulapi.net/hateoas/)[HATEOAS] (Hypermedia as the Engine of Application State) REST constraint.
|
||||
Most of our resources contain a `_links` section which contains navigation links.
|
||||
Besides, helping to navigate through our REST API, the navigation links also encapsulate the API.
|
||||
Using HATEOAS allows us to change some endpoints without modifying your frontend.
|
||||
|
||||
=== Errors
|
||||
|
||||
In order to support multilingual websites, TASKANA uses error codes to define which error occurred.
|
||||
Additionally, an optional set of message variables, containing some technical information, is added, so that the website can describe the error with all details.
|
||||
|
||||
The table below is an addition to the already documented TASKANA REST Service ErrorCodes
|
||||
|
||||
[%autowidth,width="100%"]
|
||||
|===
|
||||
| Status Code | Key | Message Variables
|
||||
| *404 NOT_FOUND* | HISTORY_EVENT_NOT_FOUND | historyEventId
|
||||
|===
|
||||
|
||||
== History event
|
||||
|
||||
include::{snippets}/TaskHistoryEventControllerRestDocTest/getAllTaskHistoryEventsDocTest/auto-section.adoc[]
|
||||
include::{snippets}/TaskHistoryEventControllerRestDocTest/getSpecificTaskHistoryEventDocTest/auto-section.adoc[]
|
|
@ -1,15 +1,10 @@
|
|||
package pro.taskana.simplehistory.rest;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.beans.ConstructorProperties;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.MediaTypes;
|
||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||
|
@ -19,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import pro.taskana.TaskanaConfiguration;
|
||||
import pro.taskana.common.api.BaseQuery.SortDirection;
|
||||
import pro.taskana.common.api.TaskanaEngine;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
|
@ -39,17 +35,19 @@ import pro.taskana.spi.history.api.exceptions.TaskanaHistoryEventNotFoundExcepti
|
|||
@RestController
|
||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||
public class TaskHistoryEventController {
|
||||
|
||||
private final SimpleHistoryServiceImpl simpleHistoryService;
|
||||
private final TaskHistoryEventRepresentationModelAssembler assembler;
|
||||
|
||||
@Autowired
|
||||
public TaskHistoryEventController(
|
||||
TaskanaEngine taskanaEngine,
|
||||
TaskanaConfiguration taskanaConfiguration,
|
||||
SimpleHistoryServiceImpl simpleHistoryServiceImpl,
|
||||
TaskHistoryEventRepresentationModelAssembler assembler) {
|
||||
TaskHistoryEventRepresentationModelAssembler assembler)
|
||||
throws SQLException {
|
||||
|
||||
this.simpleHistoryService = simpleHistoryServiceImpl;
|
||||
this.simpleHistoryService.initialize(taskanaEngine);
|
||||
this.simpleHistoryService.initialize(TaskanaEngine.buildTaskanaEngine(taskanaConfiguration));
|
||||
this.assembler = assembler;
|
||||
}
|
||||
|
||||
|
@ -63,31 +61,13 @@ public class TaskHistoryEventController {
|
|||
* @param pagingParameter the paging parameters
|
||||
* @return the Task History Events with the given filter, sort and paging options.
|
||||
*/
|
||||
@Operation(
|
||||
summary = "Get a list of all Task History Events",
|
||||
description =
|
||||
"This endpoint retrieves a list of existing Task History Events. Filters can be applied.",
|
||||
parameters = {
|
||||
@Parameter(name = "page", example = "1"),
|
||||
@Parameter(name = "page-size", example = "3")
|
||||
},
|
||||
responses = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "the Task History Events with the given filter, sort and paging options.",
|
||||
content = {
|
||||
@Content(
|
||||
mediaType = MediaTypes.HAL_JSON_VALUE,
|
||||
schema = @Schema(implementation = TaskHistoryEventPagedRepresentationModel.class))
|
||||
})
|
||||
})
|
||||
@GetMapping(path = HistoryRestEndpoints.URL_HISTORY_EVENTS, produces = MediaTypes.HAL_JSON_VALUE)
|
||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||
public ResponseEntity<TaskHistoryEventPagedRepresentationModel> getTaskHistoryEvents(
|
||||
HttpServletRequest request,
|
||||
@ParameterObject TaskHistoryQueryFilterParameter filterParameter,
|
||||
@ParameterObject TaskHistoryQuerySortParameter sortParameter,
|
||||
@ParameterObject QueryPagingParameter<TaskHistoryEvent, TaskHistoryQuery> pagingParameter) {
|
||||
TaskHistoryQueryFilterParameter filterParameter,
|
||||
TaskHistoryQuerySortParameter sortParameter,
|
||||
QueryPagingParameter<TaskHistoryEvent, TaskHistoryQuery> pagingParameter) {
|
||||
|
||||
QueryParamsValidator.validateParams(
|
||||
request,
|
||||
|
@ -116,31 +96,10 @@ public class TaskHistoryEventController {
|
|||
* @throws TaskanaHistoryEventNotFoundException If a Task History Event can't be found by the
|
||||
* provided historyEventId
|
||||
*/
|
||||
@Operation(
|
||||
summary = "Get a single Task History Event",
|
||||
description = "This endpoint retrieves a single Task History Event.",
|
||||
parameters = {
|
||||
@Parameter(
|
||||
name = "historyEventId",
|
||||
description = "the Id of the requested Task History Event.",
|
||||
example = "THI:000000000000000000000000000000000000",
|
||||
required = true),
|
||||
},
|
||||
responses = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "the requested Task History Event",
|
||||
content = {
|
||||
@Content(
|
||||
mediaType = MediaTypes.HAL_JSON_VALUE,
|
||||
schema = @Schema(implementation = TaskHistoryEventRepresentationModel.class))
|
||||
})
|
||||
})
|
||||
@GetMapping(path = HistoryRestEndpoints.URL_HISTORY_EVENTS_ID)
|
||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||
public ResponseEntity<TaskHistoryEventRepresentationModel> getTaskHistoryEvent(
|
||||
@PathVariable("historyEventId") String historyEventId)
|
||||
throws TaskanaHistoryEventNotFoundException {
|
||||
@PathVariable String historyEventId) throws TaskanaHistoryEventNotFoundException {
|
||||
TaskHistoryEvent resultEvent = simpleHistoryService.getTaskHistoryEvent(historyEventId);
|
||||
|
||||
TaskHistoryEventRepresentationModel taskEventResource = assembler.toModel(resultEvent);
|
||||
|
|
|
@ -3,7 +3,6 @@ package pro.taskana.simplehistory.rest;
|
|||
import static java.util.Optional.ofNullable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.beans.ConstructorProperties;
|
||||
import java.time.Instant;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
|
@ -12,437 +11,235 @@ import pro.taskana.simplehistory.impl.task.TaskHistoryQuery;
|
|||
import pro.taskana.spi.history.api.events.task.TaskHistoryCustomField;
|
||||
|
||||
public class TaskHistoryQueryFilterParameter implements QueryParameter<TaskHistoryQuery, Void> {
|
||||
public String[] getEventType() {
|
||||
return eventType;
|
||||
}
|
||||
|
||||
public String[] getEventTypeLike() {
|
||||
return eventTypeLike;
|
||||
}
|
||||
|
||||
public String[] getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public String[] getUserIdLike() {
|
||||
return userIdLike;
|
||||
}
|
||||
|
||||
public Instant[] getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public String[] getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public String[] getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public String[] getTaskIdLike() {
|
||||
return taskIdLike;
|
||||
}
|
||||
|
||||
public String[] getBusinessProcessId() {
|
||||
return businessProcessId;
|
||||
}
|
||||
|
||||
public String[] getBusinessProcessIdLike() {
|
||||
return businessProcessIdLike;
|
||||
}
|
||||
|
||||
public String[] getParentBusinessProcessId() {
|
||||
return parentBusinessProcessId;
|
||||
}
|
||||
|
||||
public String[] getParentBusinessProcessIdLike() {
|
||||
return parentBusinessProcessIdLike;
|
||||
}
|
||||
|
||||
public String[] getTaskClassificationKey() {
|
||||
return taskClassificationKey;
|
||||
}
|
||||
|
||||
public String[] getTaskClassificationKeyLike() {
|
||||
return taskClassificationKeyLike;
|
||||
}
|
||||
|
||||
public String[] getTaskClassificationCategory() {
|
||||
return taskClassificationCategory;
|
||||
}
|
||||
|
||||
public String[] getTaskClassificationCategoryLike() {
|
||||
return taskClassificationCategoryLike;
|
||||
}
|
||||
|
||||
public String[] getAttachmentClassificationKey() {
|
||||
return attachmentClassificationKey;
|
||||
}
|
||||
|
||||
public String[] getAttachmentClassificationKeyLike() {
|
||||
return attachmentClassificationKeyLike;
|
||||
}
|
||||
|
||||
public String[] getWorkbasketKey() {
|
||||
return workbasketKey;
|
||||
}
|
||||
|
||||
public String[] getWorkbasketKeyLike() {
|
||||
return workbasketKeyLike;
|
||||
}
|
||||
|
||||
public String[] getPorCompany() {
|
||||
return porCompany;
|
||||
}
|
||||
|
||||
public String[] getPorCompanyLike() {
|
||||
return porCompanyLike;
|
||||
}
|
||||
|
||||
public String[] getPorSystem() {
|
||||
return porSystem;
|
||||
}
|
||||
|
||||
public String[] getPorSystemLike() {
|
||||
return porSystemLike;
|
||||
}
|
||||
|
||||
public String[] getPorInstance() {
|
||||
return porInstance;
|
||||
}
|
||||
|
||||
public String[] getPorInstanceLike() {
|
||||
return porInstanceLike;
|
||||
}
|
||||
|
||||
public String[] getPorValue() {
|
||||
return porValue;
|
||||
}
|
||||
|
||||
public String[] getPorValueLike() {
|
||||
return porValueLike;
|
||||
}
|
||||
|
||||
public String[] getCustom1() {
|
||||
return custom1;
|
||||
}
|
||||
|
||||
public String[] getCustom1Like() {
|
||||
return custom1Like;
|
||||
}
|
||||
|
||||
public String[] getCustom2() {
|
||||
return custom2;
|
||||
}
|
||||
|
||||
public String[] getCustom2Like() {
|
||||
return custom2Like;
|
||||
}
|
||||
|
||||
public String[] getCustom3() {
|
||||
return custom3;
|
||||
}
|
||||
|
||||
public String[] getCustom3Like() {
|
||||
return custom3Like;
|
||||
}
|
||||
|
||||
public String[] getCustom4() {
|
||||
return custom4;
|
||||
}
|
||||
|
||||
public String[] getCustom4Like() {
|
||||
return custom4Like;
|
||||
}
|
||||
|
||||
@Schema(
|
||||
name = "event-type",
|
||||
description = "Filter by the event type of the Task History Event. This is an exact match.")
|
||||
/** Filter by the event type of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("event-type")
|
||||
private final String[] eventType;
|
||||
|
||||
@Schema(
|
||||
name = "event-type-like",
|
||||
description =
|
||||
"Filter by the event type of the Task History Event. This results in a substring search.."
|
||||
+ " (% is appended to the beginning and end of the requested value). Further SQL "
|
||||
+ "\"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the event type of the Task History Event. This results in a substring search.. (% is
|
||||
* appended to the beginning and end of the requested value). Further SQL "LIKE" wildcard
|
||||
* characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("event-type-like")
|
||||
private final String[] eventTypeLike;
|
||||
|
||||
@Schema(
|
||||
name = "user-id",
|
||||
description = "Filter by the user id of the Task History Event. This is an exact match.")
|
||||
/** Filter by the user id of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("user-id")
|
||||
private final String[] userId;
|
||||
|
||||
@Schema(
|
||||
name = "user-id-like",
|
||||
description =
|
||||
"Filter by the user id of the Task History Event. This results in a substring search.. "
|
||||
+ "(% is appended to the beginning and end of the requested value). Further SQL "
|
||||
+ "\"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the user id of the Task History Event. This results in a substring search.. (% is
|
||||
* appended to the beginning and end of the requested value). Further SQL "LIKE" wildcard
|
||||
* characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("user-id-like")
|
||||
private final String[] userIdLike;
|
||||
|
||||
@Schema(
|
||||
name = "created",
|
||||
description =
|
||||
"Filter by a created time interval. The length of the provided values has to be even. To "
|
||||
+ "create an open interval you can either use 'null' or just leave it blank.<p>The "
|
||||
+ "format is ISO-8601.")
|
||||
/**
|
||||
* Filter by a created time interval. The length of the provided values has to be even. To create
|
||||
* an open interval you can either use 'null' or just leave it blank.
|
||||
*
|
||||
* <p>The format is ISO-8601.
|
||||
*/
|
||||
private final Instant[] created;
|
||||
|
||||
@Schema(
|
||||
name = "domain",
|
||||
description = "Filter by the domain of the Task History Event. This is an exact match.")
|
||||
/** Filter by the domain of the Task History Event. This is an exact match. */
|
||||
private final String[] domain;
|
||||
|
||||
@Schema(
|
||||
name = "task-id",
|
||||
description = "Filter by the task id of the Task History Event. This is an exact match.")
|
||||
/** Filter by the task id of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("task-id")
|
||||
private final String[] taskId;
|
||||
|
||||
@Schema(
|
||||
name = "task-id-like",
|
||||
description =
|
||||
"Filter by the task id of the Task History Event. This results in a substring search.. (%"
|
||||
+ " is appended to the beginning and end of the requested value). Further SQL "
|
||||
+ "\"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the task id of the Task History Event. This results in a substring search.. (% is
|
||||
* appended to the beginning and end of the requested value). Further SQL "LIKE" wildcard
|
||||
* characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("task-id-like")
|
||||
private final String[] taskIdLike;
|
||||
|
||||
@Schema(
|
||||
name = "business-process-id",
|
||||
description =
|
||||
"Filter by the business process id of the Task History Event. This is an exact match.")
|
||||
/** Filter by the business process id of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("business-process-id")
|
||||
private final String[] businessProcessId;
|
||||
|
||||
@Schema(
|
||||
name = "business-process-id-like",
|
||||
description =
|
||||
"Filter by the business process id of the Task History Event. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the business process id of the Task History Event. This results into a substring
|
||||
* search. (% is appended to the beginning and end of the requested value). Further SQL "LIKE"
|
||||
* wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("business-process-id-like")
|
||||
private final String[] businessProcessIdLike;
|
||||
|
||||
@Schema(
|
||||
name = "parent-business-process-id",
|
||||
description =
|
||||
"Filter by the parent business process id of the Task History Event. This is an exact "
|
||||
+ "match.")
|
||||
/** Filter by the parent business process id of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("parent-business-process-id")
|
||||
private final String[] parentBusinessProcessId;
|
||||
|
||||
@Schema(
|
||||
name = "parent-business-process-id-like",
|
||||
description =
|
||||
"Filter by the parent business process id of the Task History Event. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"Like\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the parent business process id of the Task History Event. This results into a
|
||||
* substring search. (% is appended to the beginning and end of the requested value). Further SQL
|
||||
* "Like" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("parent-business-process-id-like")
|
||||
private final String[] parentBusinessProcessIdLike;
|
||||
|
||||
@Schema(
|
||||
name = "task-classification-key",
|
||||
description =
|
||||
"Filter by the task classification key of the Task History Event. This is an exact "
|
||||
+ "match.")
|
||||
/** Filter by the task classification key of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("task-classification-key")
|
||||
private final String[] taskClassificationKey;
|
||||
|
||||
@Schema(
|
||||
name = "task-classification-key-like",
|
||||
description =
|
||||
"Filter by the task classification key of the Task History Event. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the task classification key of the Task History Event. This results into a substring
|
||||
* search. (% is appended to the beginning and end of the requested value). Further SQL "LIKE"
|
||||
* wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("task-classification-key-like")
|
||||
private final String[] taskClassificationKeyLike;
|
||||
|
||||
@Schema(
|
||||
name = "task-classification-category",
|
||||
description =
|
||||
"Filter by the task classification category of the Task History Event. This is an exact "
|
||||
+ "match.")
|
||||
/**
|
||||
* Filter by the task classification category of the Task History Event. This is an exact match.
|
||||
*/
|
||||
@JsonProperty("task-classification-category")
|
||||
private final String[] taskClassificationCategory;
|
||||
|
||||
@Schema(
|
||||
name = "task-classification-category-like",
|
||||
description =
|
||||
"Filter by the task classification category of the Task History Event. This results into "
|
||||
+ "a substring search. (% is appended to the beginning and end of the requested "
|
||||
+ "value). Further SQL \"Like\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the task classification category of the Task History Event. This results into a
|
||||
* substring search. (% is appended to the beginning and end of the requested value). Further SQL
|
||||
* "Like" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("task-classification-category-like")
|
||||
private final String[] taskClassificationCategoryLike;
|
||||
|
||||
@Schema(
|
||||
name = "attachment-classification-key",
|
||||
description =
|
||||
"Filter by the attachment classification key of the Task History Event. This is an exact "
|
||||
+ "match.")
|
||||
/**
|
||||
* Filter by the attachment classification key of the Task History Event. This is an exact match.
|
||||
*/
|
||||
@JsonProperty("attachment-classification-key")
|
||||
private final String[] attachmentClassificationKey;
|
||||
|
||||
@Schema(
|
||||
name = "attachment-classification-key-like",
|
||||
description =
|
||||
"Filter by the attachment classification key of the Task History Event. This results into"
|
||||
+ " a substring search. (% is appended to the beginning and end of the requested "
|
||||
+ "value). Further SQL \"Like\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the attachment classification key of the Task History Event. This results into a
|
||||
* substring search. (% is appended to the beginning and end of the requested value). Further SQL
|
||||
* "Like" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("attachment-classification-key-like")
|
||||
private final String[] attachmentClassificationKeyLike;
|
||||
|
||||
@Schema(
|
||||
name = "workbasket-key",
|
||||
description =
|
||||
"Filter by the workbasket key of the Task History Event. This is an exact match.")
|
||||
/** Filter by the workbasket key of the Task History Event. This is an exact match. */
|
||||
@JsonProperty("workbasket-key")
|
||||
private final String[] workbasketKey;
|
||||
|
||||
@Schema(
|
||||
name = "workbasket-key-like",
|
||||
description =
|
||||
"Filter by the workbasket key of the Task History Event. This results in a substring "
|
||||
+ "search.. (% is appended to the beginning and end of the requested value). Further "
|
||||
+ "SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the workbasket key of the Task History Event. This results in a substring search.. (%
|
||||
* is appended to the beginning and end of the requested value). Further SQL "LIKE" wildcard
|
||||
* characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("workbasket-key-like")
|
||||
private final String[] workbasketKeyLike;
|
||||
|
||||
@Schema(
|
||||
name = "por-company",
|
||||
description =
|
||||
"* Filter by the company of the primary object reference of the Task History Event. This "
|
||||
+ "is an exact match.")
|
||||
/**
|
||||
* Filter by the company of the primary object reference of the Task History Event. This is an
|
||||
* exact match.
|
||||
*/
|
||||
@JsonProperty("por-company")
|
||||
private final String[] porCompany;
|
||||
|
||||
@Schema(
|
||||
name = "por-company-like",
|
||||
description =
|
||||
"Filter by the company of the primary object reference of the Task History Event. This "
|
||||
+ "results into a substring search. (% is appended to the beginning and end of the "
|
||||
+ "requested value). Further SQL \"LIKE\" wildcard characters will be resolved "
|
||||
+ "correctly.")
|
||||
/**
|
||||
* Filter by the company of the primary object reference of the Task History Event. This results
|
||||
* into a substring search. (% is appended to the beginning and end of the requested value).
|
||||
* Further SQL "LIKE" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("por-company-like")
|
||||
private final String[] porCompanyLike;
|
||||
|
||||
@Schema(
|
||||
name = "por-system",
|
||||
description =
|
||||
"Filter by the system of the primary object reference of the Task History Event. This is "
|
||||
+ "an exact match.")
|
||||
/**
|
||||
* Filter by the system of the primary object reference of the Task History Event. This is an
|
||||
* exact match.
|
||||
*/
|
||||
@JsonProperty("por-system")
|
||||
private final String[] porSystem;
|
||||
|
||||
@Schema(
|
||||
name = "por-system-like",
|
||||
description =
|
||||
"Filter by the system of the primary object reference of the Task History Event. This "
|
||||
+ "results into a substring search. (% is appended to the beginning and end of the "
|
||||
+ "requested value). Further SQL \"LIKE\" wildcard characters will be resolved "
|
||||
+ "correctly.")
|
||||
/**
|
||||
* Filter by the system of the primary object reference of the Task History Event. This results
|
||||
* into a substring search. (% is appended to the beginning and end of the requested value).
|
||||
* Further SQL "LIKE" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("por-system-like")
|
||||
private final String[] porSystemLike;
|
||||
|
||||
@Schema(
|
||||
name = "por-instance",
|
||||
description =
|
||||
"Filter by the system instance of the primary object reference of the Task History Event."
|
||||
+ " This is an exact match.")
|
||||
/**
|
||||
* Filter by the system instance of the primary object reference of the Task History Event. This
|
||||
* is an exact match.
|
||||
*/
|
||||
@JsonProperty("por-instance")
|
||||
private final String[] porInstance;
|
||||
|
||||
@Schema(
|
||||
name = "por-instance-like",
|
||||
description =
|
||||
"Filter by the system instance of the primary object reference of the Task History Event."
|
||||
+ " This results into a substring search. (% is appended to the beginning and end of "
|
||||
+ "the requested value). Further SQL \"LIKE\" wildcard characters will be resolved "
|
||||
+ "correctly.")
|
||||
/**
|
||||
* Filter by the system instance of the primary object reference of the Task History Event. This
|
||||
* results into a substring search. (% is appended to the beginning and end of the requested
|
||||
* value). Further SQL "LIKE" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("por-instance-like")
|
||||
private final String[] porInstanceLike;
|
||||
|
||||
@Schema(
|
||||
name = "por-value",
|
||||
description =
|
||||
"Filter by the value of the primary object reference of the Task History Event. This is "
|
||||
+ "an exact match.")
|
||||
/**
|
||||
* Filter by the value of the primary object reference of the Task History Event. This is an exact
|
||||
* match.
|
||||
*/
|
||||
@JsonProperty("por-value")
|
||||
private final String[] porValue;
|
||||
|
||||
@Schema(
|
||||
name = "por-value-like",
|
||||
description =
|
||||
"Filter by the value of the primary object reference of the Task History Event. This "
|
||||
+ "results into a substring search. (% is appended to the beginning and end of the "
|
||||
+ "requested value). Further SQL \"LIKE\" wildcard characters will be resolved "
|
||||
+ "correctly.")
|
||||
/**
|
||||
* Filter by the value of the primary object reference of the Task History Event. This results
|
||||
* into a substring search. (% is appended to the beginning and end of the requested value).
|
||||
* Further SQL "LIKE" wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("por-value-like")
|
||||
private final String[] porValueLike;
|
||||
|
||||
@Schema(
|
||||
name = "custom-1",
|
||||
description = "Filter by the value of the field custom1. This is an exact match.")
|
||||
/** Filter by the value of the field custom1. This is an exact match. */
|
||||
@JsonProperty("custom-1")
|
||||
private final String[] custom1;
|
||||
|
||||
@Schema(
|
||||
name = "custom-1-like",
|
||||
description =
|
||||
"Filter by the value of the field custom1. This is an exact match. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the value of the field custom1. This is an exact match. This results into a substring
|
||||
* search. (% is appended to the beginning and end of the requested value). Further SQL "LIKE"
|
||||
* wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("custom-1-like")
|
||||
private final String[] custom1Like;
|
||||
|
||||
@Schema(
|
||||
name = "custom-2",
|
||||
description = "Filter by the value of the field custom2. This is an exact match.")
|
||||
/** Filter by the value of the field custom2. This is an exact match. */
|
||||
@JsonProperty("custom-2")
|
||||
private final String[] custom2;
|
||||
|
||||
@Schema(
|
||||
name = "custom-2-like",
|
||||
description =
|
||||
"Filter by the value of the field custom2. This is an exact match. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the value of the field custom2. This is an exact match. This results into a substring
|
||||
* search. (% is appended to the beginning and end of the requested value). Further SQL "LIKE"
|
||||
* wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("custom-2-like")
|
||||
private final String[] custom2Like;
|
||||
|
||||
@Schema(
|
||||
name = "custom-3",
|
||||
description = "Filter by the value of the field custom3. This is an exact match.")
|
||||
/** Filter by the value of the field custom3. This is an exact match. */
|
||||
@JsonProperty("custom-3")
|
||||
private final String[] custom3;
|
||||
|
||||
@Schema(
|
||||
name = "custom-3-like",
|
||||
description =
|
||||
"Filter by the value of the field custom3. This is an exact match. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the value of the field custom3. This is an exact match. This results into a substring
|
||||
* search. (% is appended to the beginning and end of the requested value). Further SQL "LIKE"
|
||||
* wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("custom-3-like")
|
||||
private final String[] custom3Like;
|
||||
|
||||
@Schema(
|
||||
name = "custom-4",
|
||||
description = "Filter by the value of the field custom4. This is an exact match.")
|
||||
/** Filter by the value of the field custom4. This is an exact match. */
|
||||
@JsonProperty("custom-4")
|
||||
private final String[] custom4;
|
||||
|
||||
@Schema(
|
||||
name = "custom-4-like",
|
||||
description =
|
||||
"Filter by the value of the field custom4. This is an exact match. This results into a "
|
||||
+ "substring search. (% is appended to the beginning and end of the requested value)."
|
||||
+ " Further SQL \"LIKE\" wildcard characters will be resolved correctly.")
|
||||
/**
|
||||
* Filter by the value of the field custom4. This is an exact match. This results into a substring
|
||||
* search. (% is appended to the beginning and end of the requested value). Further SQL "LIKE"
|
||||
* wildcard characters will be resolved correctly.
|
||||
*/
|
||||
@JsonProperty("custom-4-like")
|
||||
private final String[] custom4Like;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package pro.taskana.simplehistory.rest.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.beans.ConstructorProperties;
|
||||
import java.util.Collection;
|
||||
import pro.taskana.common.rest.models.PageMetadata;
|
||||
|
@ -17,7 +16,6 @@ public class TaskHistoryEventPagedRepresentationModel
|
|||
}
|
||||
|
||||
/** the embedded task history events. */
|
||||
@Schema(name = "taskHistoryEvents", description = "the embedded task history events.")
|
||||
@JsonProperty("taskHistoryEvents")
|
||||
@Override
|
||||
public Collection<TaskHistoryEventRepresentationModel> getContent() {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package pro.taskana.simplehistory.rest.models;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.Instant;
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
|
@ -10,101 +9,60 @@ public class TaskHistoryEventRepresentationModel
|
|||
extends RepresentationModel<TaskHistoryEventRepresentationModel> {
|
||||
|
||||
/** Unique Id. */
|
||||
@Schema(name = "taskHistoryId", description = "Unique Id.")
|
||||
private String taskHistoryId;
|
||||
/** The Id of the business process. */
|
||||
@Schema(name = "businessProcessId", description = "The Id of the business process.")
|
||||
private String businessProcessId;
|
||||
/** The Id of the parent business process. */
|
||||
@Schema(name = "parentBusinessProcessId", description = "The Id of the parent business process.")
|
||||
private String parentBusinessProcessId;
|
||||
/** The Id of the task. */
|
||||
@Schema(name = "taskId", description = "The Id of the task.")
|
||||
private String taskId;
|
||||
/** The type of the event. */
|
||||
@Schema(name = "eventType", description = "The type of the event.")
|
||||
private String eventType;
|
||||
/**
|
||||
* The time of event creation.
|
||||
*
|
||||
* <p>The format is ISO-8601.
|
||||
*/
|
||||
@Schema(name = "created", description = "The time of event creation.<p>The format is ISO-8601.")
|
||||
private Instant created;
|
||||
/** The Id of the user. */
|
||||
@Schema(name = "userId", description = "The Id of the user.")
|
||||
private String userId;
|
||||
/** The long name of the user. */
|
||||
@Schema(name = "userLongName", description = "The long name of the user.")
|
||||
private String userLongName;
|
||||
/** Domain. */
|
||||
@Schema(name = "domain", description = "Domain.")
|
||||
private String domain;
|
||||
/** The key of the Workbasket. */
|
||||
@Schema(name = "workbasketKey", description = "The key of the Workbasket.")
|
||||
private String workbasketKey;
|
||||
/** The company the referenced primary object belongs to. */
|
||||
@Schema(
|
||||
name = "porCompany",
|
||||
description = "The company the referenced primary object belongs to.")
|
||||
private String porCompany;
|
||||
/** The type of the referenced primary object (contract, claim, policy, customer, ...). */
|
||||
@Schema(
|
||||
name = "porType",
|
||||
description =
|
||||
"The type of the referenced primary object (contract, claim, policy, customer, ...).")
|
||||
private String porType;
|
||||
/** The (kind of) system, the referenced primary object resides in (e.g. SAP, MySystem A, ...). */
|
||||
@Schema(
|
||||
name = "porSystem",
|
||||
description =
|
||||
"The (kind of) system, the referenced primary object resides in (e.g. SAP, MySystem A, "
|
||||
+ "...).")
|
||||
private String porSystem;
|
||||
/** The instance of the system where the referenced primary object is located. */
|
||||
@Schema(
|
||||
name = "porInstance",
|
||||
description = "The instance of the system where the referenced primary object is located.")
|
||||
private String porInstance;
|
||||
/** The value of the primary object reference. */
|
||||
@Schema(name = "porValue", description = "The value of the primary object reference.")
|
||||
private String porValue;
|
||||
/** The long name of the task owner. */
|
||||
@Schema(name = "taskOwnerLongName", description = "The long name of the task owner.")
|
||||
private String taskOwnerLongName;
|
||||
/** The key of the task's classification. */
|
||||
@Schema(name = "taskClassificationKey", description = "The key of the task's classification.")
|
||||
private String taskClassificationKey;
|
||||
/** The category of the task's classification. */
|
||||
@Schema(
|
||||
name = "taskClassificationCategory",
|
||||
description = "The category of the task's classification.")
|
||||
private String taskClassificationCategory;
|
||||
/** The classification key of the task's attachment. */
|
||||
@Schema(
|
||||
name = "attachmentClassificationKey",
|
||||
description = "The classification key of the task's attachment.")
|
||||
private String attachmentClassificationKey;
|
||||
/** The old value. */
|
||||
@Schema(name = "oldValue", description = "The old value.")
|
||||
private String oldValue;
|
||||
/** The new value. */
|
||||
@Schema(name = "newValue", description = "The new value.")
|
||||
private String newValue;
|
||||
/** A custom property with name "1". */
|
||||
@Schema(name = "custom1", description = "A custom property with name '1'.")
|
||||
private String custom1;
|
||||
/** A custom property with name "2". */
|
||||
@Schema(name = "custom2", description = "A custom property with name '2'.")
|
||||
private String custom2;
|
||||
/** A custom property with name "3". */
|
||||
@Schema(name = "custom3", description = "A custom property with name '3'.")
|
||||
private String custom3;
|
||||
/** A custom property with name "4". */
|
||||
@Schema(name = "custom4", description = "A custom property with name '4'.")
|
||||
private String custom4;
|
||||
/** details of changes within the task. */
|
||||
@Schema(name = "details", description = "details of changes within the task.")
|
||||
private String details;
|
||||
|
||||
public String getTaskHistoryId() {
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package pro.taskana.simplehistory.rest;
|
||||
|
||||
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||
import pro.taskana.rest.test.BaseRestDocTest;
|
||||
|
||||
class TaskHistoryEventControllerRestDocTest extends BaseRestDocTest {
|
||||
|
||||
@Test
|
||||
void getAllTaskHistoryEventsDocTest() throws Exception {
|
||||
mockMvc
|
||||
.perform(get(HistoryRestEndpoints.URL_HISTORY_EVENTS + "?page=1&page-size=3"))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk());
|
||||
}
|
||||
|
||||
@Test
|
||||
void getSpecificTaskHistoryEventDocTest() throws Exception {
|
||||
mockMvc
|
||||
.perform(
|
||||
get(
|
||||
HistoryRestEndpoints.URL_HISTORY_EVENTS_ID,
|
||||
"THI:000000000000000000000000000000000000"))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk());
|
||||
}
|
||||
}
|
|
@ -34,12 +34,6 @@ taskana.ldap.groupNameAttribute=cn
|
|||
taskana.ldap.minSearchForLength=3
|
||||
taskana.ldap.maxNumberOfReturnedAccessIds=50
|
||||
taskana.ldap.groupsOfUser=memberUid
|
||||
taskana.ldap.permissionSearchBase=cn=groups
|
||||
taskana.ldap.permissionSearchFilterName=objectclass
|
||||
taskana.ldap.permissionSearchFilterValue=groupofuniquenames
|
||||
taskana.ldap.permissionNameAttribute=permission
|
||||
taskana.ldap.permissionsOfUser=uniquemember
|
||||
taskana.ldap.useDnForGroups=true
|
||||
# Embedded Spring LDAP server
|
||||
spring.ldap.embedded.base-dn=OU=Test,O=TASKANA
|
||||
spring.ldap.embedded.credential.username=uid=admin
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-lib-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -19,29 +19,16 @@
|
|||
<sonar.tests/>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.bom</groupId>
|
||||
<artifactId>wildfly-ee</artifactId>
|
||||
<version>${version.wildfly}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-logging</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.arquillian</groupId>
|
||||
<artifactId>arquillian-bom</artifactId>
|
||||
<version>${version.arquillian}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>jakarta.platform</groupId>
|
||||
<artifactId>jakarta.jakartaee-api</artifactId>
|
||||
<version>${version.jakartaee-api}</version>
|
||||
<groupId>javax</groupId>
|
||||
<artifactId>javaee-api</artifactId>
|
||||
<version>${version.javaee-api}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -49,171 +36,5 @@
|
|||
<artifactId>taskana-cdi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- TEST dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>${version.assertj}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.arquillian.junit</groupId>
|
||||
<artifactId>arquillian-junit-container</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.shrinkwrap.resolver</groupId>
|
||||
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.shrinkwrap.resolver</groupId>
|
||||
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.arquillian</groupId>
|
||||
<artifactId>wildfly-arquillian-container-managed</artifactId>
|
||||
<version>${version.arquillian.managed.wildfly}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>${version.maven.dependency}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-wildfly</id>
|
||||
<phase>process-test-classes</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.wildfly</groupId>
|
||||
<artifactId>wildfly-dist</artifactId>
|
||||
<version>${version.wildfly}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>false</overWrite>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-latest-h2-db-driver</id>
|
||||
<phase>process-test-classes</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/wildfly-${version.wildfly}/modules/system/layers/base/com/h2database/h2/main
|
||||
</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${version.maven.resources}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-h2-module-xml</id>
|
||||
<phase>process-test-classes</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/wildfly-${version.wildfly}/modules/system/layers/base/com/h2database/h2/main
|
||||
</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/test/resources</directory>
|
||||
<includes>
|
||||
<include>module.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-wildfly-config-xml</id>
|
||||
<phase>process-test-classes</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/wildfly-${version.wildfly}/standalone/configuration
|
||||
</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/test/resources</directory>
|
||||
<includes>
|
||||
<include>int-test-standalone.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jboss</id>
|
||||
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
|
|
|
@ -1,77 +1,57 @@
|
|||
package pro.taskana.example;
|
||||
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.enterprise.event.Observes;
|
||||
import jakarta.enterprise.event.Startup;
|
||||
import jakarta.inject.Inject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import pro.taskana.classification.api.models.Classification;
|
||||
import pro.taskana.common.api.exceptions.TaskanaException;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.ejb.EJB;
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.enterprise.context.Initialized;
|
||||
import javax.enterprise.event.Observes;
|
||||
import pro.taskana.classification.api.exceptions.ClassificationNotFoundException;
|
||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.task.api.exceptions.AttachmentPersistenceException;
|
||||
import pro.taskana.task.api.exceptions.InvalidOwnerException;
|
||||
import pro.taskana.task.api.exceptions.InvalidTaskStateException;
|
||||
import pro.taskana.task.api.exceptions.ObjectReferencePersistenceException;
|
||||
import pro.taskana.task.api.exceptions.TaskAlreadyExistException;
|
||||
import pro.taskana.task.api.exceptions.TaskNotFoundException;
|
||||
import pro.taskana.task.api.models.Task;
|
||||
import pro.taskana.task.internal.models.ObjectReferenceImpl;
|
||||
import pro.taskana.workbasket.api.WorkbasketType;
|
||||
import pro.taskana.workbasket.api.models.Workbasket;
|
||||
import pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException;
|
||||
import pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException;
|
||||
|
||||
/** Example Bootstrap Application. */
|
||||
@ApplicationScoped
|
||||
public class ExampleBootstrap {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ExampleBootstrap.class);
|
||||
@EJB private TaskanaEjb taskanaEjb;
|
||||
|
||||
private static final String CDIDOMAIN = "CDIDOMAIN";
|
||||
private static final String CLASSIFICATION_TYPE = "T1";
|
||||
|
||||
private final TaskanaEjb taskanaEjb;
|
||||
|
||||
public ExampleBootstrap() {
|
||||
this.taskanaEjb = null;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public ExampleBootstrap(TaskanaEjb taskanaEjb) {
|
||||
this.taskanaEjb = taskanaEjb;
|
||||
}
|
||||
|
||||
/**
|
||||
* The parameter `@Observes Startup` makes sure that the dependency injection framework calls this
|
||||
* method on system startup. And to do that, it needs to call `@PostConstruct start()` first.
|
||||
*
|
||||
* @param startup just the startup event
|
||||
* @throws ExampleStartupException in case of task creation fails
|
||||
*/
|
||||
public void init(@Observes Startup startup) throws ExampleStartupException {
|
||||
try {
|
||||
LOGGER.info("---------------------------> Start App -- {}", startup);
|
||||
Workbasket workbasket = taskanaEjb.getWorkbasketService().newWorkbasket("KEY", CDIDOMAIN);
|
||||
workbasket.setName("wb");
|
||||
workbasket.setType(WorkbasketType.PERSONAL);
|
||||
workbasket = taskanaEjb.getWorkbasketService().createWorkbasket(workbasket);
|
||||
Classification classification =
|
||||
taskanaEjb
|
||||
.getClassificationService()
|
||||
.newClassification("TEST", CDIDOMAIN, CLASSIFICATION_TYPE);
|
||||
taskanaEjb.getClassificationService().createClassification(classification);
|
||||
@PostConstruct
|
||||
public void init(@Observes @Initialized(ApplicationScoped.class) Object init)
|
||||
throws TaskNotFoundException,
|
||||
WorkbasketNotFoundException,
|
||||
ClassificationNotFoundException,
|
||||
InvalidOwnerException,
|
||||
TaskAlreadyExistException,
|
||||
InvalidArgumentException,
|
||||
AttachmentPersistenceException,
|
||||
ObjectReferencePersistenceException,
|
||||
NotAuthorizedOnWorkbasketException,
|
||||
InvalidTaskStateException {
|
||||
System.out.println("---------------------------> Start App");
|
||||
ObjectReferenceImpl objRef = new ObjectReferenceImpl();
|
||||
objRef.setCompany("aCompany");
|
||||
objRef.setSystem("aSystem");
|
||||
objRef.setSystemInstance("anInstance");
|
||||
objRef.setType("aType");
|
||||
objRef.setValue("aValue");
|
||||
Task task = taskanaEjb.getTaskService().newTask(workbasket.getId());
|
||||
task.setClassificationKey(classification.getKey());
|
||||
task.setName("BootstrapTask");
|
||||
Task task = taskanaEjb.getTaskService().newTask(null);
|
||||
task.setPrimaryObjRef(objRef);
|
||||
task = taskanaEjb.getTaskService().createTask(task);
|
||||
LOGGER.info("---------------------------> Task started: {}", task.getId());
|
||||
System.out.println("---------------------------> Task started: " + task.getId());
|
||||
taskanaEjb.getTaskService().claim(task.getId());
|
||||
LOGGER.info(
|
||||
"---------------------------> Task claimed: {}",
|
||||
taskanaEjb.getTaskService().getTask(task.getId()).getOwner());
|
||||
System.out.println(
|
||||
"---------------------------> Task claimed: "
|
||||
+ taskanaEjb.getTaskService().getTask(task.getId()).getOwner());
|
||||
taskanaEjb.getTaskService().completeTask(task.getId());
|
||||
LOGGER.info("---------------------------> Task completed");
|
||||
} catch (TaskanaException e) {
|
||||
throw new ExampleStartupException(e);
|
||||
}
|
||||
System.out.println("---------------------------> Task completed");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package pro.taskana.example;
|
||||
|
||||
public class ExampleStartupException extends RuntimeException {
|
||||
|
||||
public ExampleStartupException(Throwable cause) {
|
||||
super("Can't bootstrap CDI example application", cause);
|
||||
}
|
||||
}
|
|
@ -1,46 +1,16 @@
|
|||
package pro.taskana.example;
|
||||
|
||||
import jakarta.ejb.Stateless;
|
||||
import jakarta.inject.Inject;
|
||||
import pro.taskana.classification.api.ClassificationService;
|
||||
import javax.ejb.Stateless;
|
||||
import javax.inject.Inject;
|
||||
import pro.taskana.task.api.TaskService;
|
||||
import pro.taskana.workbasket.api.WorkbasketService;
|
||||
|
||||
/** example Taskana EJB. */
|
||||
@Stateless
|
||||
public class TaskanaEjb {
|
||||
|
||||
private final TaskService taskService;
|
||||
|
||||
private final ClassificationService classificationService;
|
||||
|
||||
private final WorkbasketService workbasketService;
|
||||
|
||||
public TaskanaEjb() {
|
||||
this.taskService = null;
|
||||
this.classificationService = null;
|
||||
this.workbasketService = null;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public TaskanaEjb(
|
||||
TaskService taskService,
|
||||
ClassificationService classificationService,
|
||||
WorkbasketService workbasketService) {
|
||||
this.taskService = taskService;
|
||||
this.classificationService = classificationService;
|
||||
this.workbasketService = workbasketService;
|
||||
}
|
||||
@Inject private TaskService taskService;
|
||||
|
||||
public TaskService getTaskService() {
|
||||
return taskService;
|
||||
}
|
||||
|
||||
public ClassificationService getClassificationService() {
|
||||
return classificationService;
|
||||
}
|
||||
|
||||
public WorkbasketService getWorkbasketService() {
|
||||
return workbasketService;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd">
|
||||
</beans>
|
|
@ -1,19 +1 @@
|
|||
datasource.jndi=java:jboss/datasources/Taskana
|
||||
taskana.domains=CDIDOMAIN
|
||||
taskana.classification.types=T1
|
||||
taskana.classification.categories.T1=DEFAULT
|
||||
# enable or disable the jobscheduler at all
|
||||
# set it to false and no jobs are running
|
||||
taskana.jobs.scheduler.enabled=true
|
||||
# wait time before the first job run
|
||||
taskana.jobs.scheduler.initialStartDelay=100
|
||||
# sleeping time befor the next job runs
|
||||
taskana.jobs.scheduler.period=1
|
||||
# timeunit for the initial start delay and the sleeping period
|
||||
# Possible values: MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS
|
||||
taskana.jobs.scheduler.periodTimeUnit=HOURS
|
||||
taskana.jobs.cleanup.task.enable=true
|
||||
taskana.jobs.priority.task.enable=true
|
||||
taskana.jobs.cleanup.workbasket.enable=true
|
||||
taskana.jobs.refresh.user.enable=false
|
||||
taskana.jobs.cleanup.history.simple.enable=false
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://java.sun.com/xml/ns/javaee
|
||||
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
|
||||
</beans>
|
|
@ -0,0 +1,4 @@
|
|||
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
|
||||
</web-app>
|
|
@ -1,111 +0,0 @@
|
|||
package pro.taskana.example;
|
||||
|
||||
import static org.awaitility.Awaitility.await;
|
||||
import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS;
|
||||
import static org.awaitility.Durations.TWO_SECONDS;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.h2.jdbc.JdbcSQLNonTransientConnectionException;
|
||||
import org.h2.jdbc.JdbcSQLSyntaxErrorException;
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.junit.Arquillian;
|
||||
import org.jboss.shrinkwrap.api.Archive;
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
|
||||
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(Arquillian.class)
|
||||
public class ExampleBootstrapTest {
|
||||
|
||||
@Deployment(testable = false, order = 10)
|
||||
public static Archive<?> createDeployment() throws Exception {
|
||||
EnterpriseArchive deployment = ShrinkWrap.create(EnterpriseArchive.class, "taskana.ear");
|
||||
|
||||
File[] libs =
|
||||
Maven.resolver()
|
||||
.loadPomFromFile("pom.xml")
|
||||
.importCompileAndRuntimeDependencies()
|
||||
.resolve()
|
||||
.withTransitivity()
|
||||
.asFile();
|
||||
deployment.addAsLibraries(libs);
|
||||
|
||||
JavaArchive ejbModule = ShrinkWrap.create(JavaArchive.class, "taskana.jar");
|
||||
ejbModule.addClasses(TaskanaEjb.class, ExampleBootstrap.class, ExampleStartupException.class);
|
||||
ejbModule.addAsResource("taskana.properties");
|
||||
deployment.addAsModule(ejbModule);
|
||||
|
||||
deployment.addAsManifestResource("META-INF/beans.xml", "beans.xml");
|
||||
return deployment;
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void cleanTaskanaH2DataFolder() throws IOException {
|
||||
// Delete Taskana folder if exists
|
||||
Path taskanaH2Data = Path.of(System.getProperty("user.home"), "taskana-h2-data");
|
||||
if (Files.exists(taskanaH2Data)) {
|
||||
FileUtils.forceDelete(taskanaH2Data.toFile());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_count_tasks_after_example_cdi_application_was_deployed() throws Exception {
|
||||
// this test method is started that fast that the commit
|
||||
// from pro.taskana.example.ExampleBootstrap.init is not completed
|
||||
// so we need to wait here a bit
|
||||
// https://www.baeldung.com/awaitility-testing
|
||||
await()
|
||||
.atLeast(ONE_HUNDRED_MILLISECONDS)
|
||||
.atMost(TWO_SECONDS)
|
||||
.with()
|
||||
.pollInterval(ONE_HUNDRED_MILLISECONDS)
|
||||
.until(
|
||||
() -> {
|
||||
try {
|
||||
return countTasksByName("BootstrapTask");
|
||||
} catch (JdbcSQLSyntaxErrorException | JdbcSQLNonTransientConnectionException e) {
|
||||
// ignore this Exception, because in the beginning the schema is not created
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
equalTo(1));
|
||||
}
|
||||
|
||||
private Connection getConnection() throws Exception {
|
||||
return DriverManager.getConnection(
|
||||
"jdbc:h2:~/taskana-h2-data/testdb;NON_KEYWORDS=KEY,VALUE;AUTO_SERVER=TRUE;"
|
||||
+ "IGNORECASE=TRUE;LOCK_MODE=0",
|
||||
"sa",
|
||||
"sa");
|
||||
}
|
||||
|
||||
private int countTasksByName(String taskName) throws Exception {
|
||||
|
||||
Class.forName("org.h2.Driver");
|
||||
int resultCount = 0;
|
||||
try (Connection conn = getConnection();
|
||||
PreparedStatement statement =
|
||||
conn.prepareStatement("SELECT COUNT(ID) FROM TASKANA.TASK WHERE NAME = ?")) {
|
||||
statement.setString(1, taskName);
|
||||
ResultSet rs = statement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
resultCount = rs.getInt(1);
|
||||
}
|
||||
}
|
||||
return resultCount;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
<arquillian xmlns="http://jboss.org/schema/arquillian"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://jboss.org/schema/arquillian
|
||||
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
|
||||
<defaultProtocol type="Servlet 6.0"/>
|
||||
<container qualifier="wildfly" default="true">
|
||||
<configuration>
|
||||
<property name="jbossHome">target/wildfly-31.0.1.Final</property>
|
||||
<property name="serverConfig">int-test-standalone.xml</property>
|
||||
<!-- <property name="javaVmArguments">-->
|
||||
<!-- -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y-->
|
||||
<!-- -Djava.util.logging.manager=org.jboss.logmanager.LogManager-->
|
||||
<!-- </property>-->
|
||||
<property name="javaVmArguments">
|
||||
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
|
||||
</property>
|
||||
</configuration>
|
||||
</container>
|
||||
</arquillian>
|
|
@ -1,703 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<server xmlns="urn:jboss:domain:20.0">
|
||||
<extensions>
|
||||
<extension module="org.jboss.as.clustering.infinispan"/>
|
||||
<extension module="org.jboss.as.connector"/>
|
||||
<extension module="org.jboss.as.deployment-scanner"/>
|
||||
<extension module="org.jboss.as.ee"/>
|
||||
<extension module="org.jboss.as.ejb3"/>
|
||||
<extension module="org.jboss.as.jaxrs"/>
|
||||
<extension module="org.jboss.as.jdr"/>
|
||||
<extension module="org.jboss.as.jmx"/>
|
||||
<extension module="org.jboss.as.jpa"/>
|
||||
<extension module="org.jboss.as.jsf"/>
|
||||
<extension module="org.jboss.as.logging"/>
|
||||
<extension module="org.jboss.as.mail"/>
|
||||
<extension module="org.jboss.as.naming"/>
|
||||
<extension module="org.jboss.as.pojo"/>
|
||||
<extension module="org.jboss.as.remoting"/>
|
||||
<extension module="org.jboss.as.sar"/>
|
||||
<extension module="org.jboss.as.transactions"/>
|
||||
<extension module="org.jboss.as.webservices"/>
|
||||
<extension module="org.jboss.as.weld"/>
|
||||
<extension module="org.wildfly.extension.batch.jberet"/>
|
||||
<extension module="org.wildfly.extension.bean-validation"/>
|
||||
<extension module="org.wildfly.extension.clustering.ejb"/>
|
||||
<extension module="org.wildfly.extension.clustering.web"/>
|
||||
<extension module="org.wildfly.extension.core-management"/>
|
||||
<extension module="org.wildfly.extension.discovery"/>
|
||||
<extension module="org.wildfly.extension.ee-security"/>
|
||||
<extension module="org.wildfly.extension.elytron"/>
|
||||
<extension module="org.wildfly.extension.elytron-oidc-client"/>
|
||||
<extension module="org.wildfly.extension.health"/>
|
||||
<extension module="org.wildfly.extension.io"/>
|
||||
<extension module="org.wildfly.extension.messaging-activemq"/>
|
||||
<extension module="org.wildfly.extension.metrics"/>
|
||||
<extension module="org.wildfly.extension.microprofile.config-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.jwt-smallrye"/>
|
||||
<extension module="org.wildfly.extension.request-controller"/>
|
||||
<extension module="org.wildfly.extension.security.manager"/>
|
||||
<extension module="org.wildfly.extension.undertow"/>
|
||||
<extension module="org.wildfly.iiop-openjdk"/>
|
||||
</extensions>
|
||||
<management>
|
||||
<audit-log>
|
||||
<formatters>
|
||||
<json-formatter name="json-formatter"/>
|
||||
</formatters>
|
||||
<handlers>
|
||||
<file-handler name="file" formatter="json-formatter" path="audit-log.log"
|
||||
relative-to="jboss.server.data.dir"/>
|
||||
</handlers>
|
||||
<logger log-boot="true" log-read-only="false" enabled="false">
|
||||
<handlers>
|
||||
<handler name="file"/>
|
||||
</handlers>
|
||||
</logger>
|
||||
</audit-log>
|
||||
<management-interfaces>
|
||||
<http-interface http-authentication-factory="management-http-authentication">
|
||||
<http-upgrade enabled="true" sasl-authentication-factory="management-sasl-authentication"/>
|
||||
<socket-binding http="management-http"/>
|
||||
</http-interface>
|
||||
</management-interfaces>
|
||||
<access-control provider="simple">
|
||||
<role-mapping>
|
||||
<role name="SuperUser">
|
||||
<include>
|
||||
<user name="$local"/>
|
||||
</include>
|
||||
</role>
|
||||
</role-mapping>
|
||||
</access-control>
|
||||
</management>
|
||||
<profile>
|
||||
<subsystem xmlns="urn:jboss:domain:logging:8.0">
|
||||
<console-handler name="CONSOLE">
|
||||
<level name="INFO"/>
|
||||
<formatter>
|
||||
<named-formatter name="COLOR-PATTERN"/>
|
||||
</formatter>
|
||||
</console-handler>
|
||||
<periodic-rotating-file-handler name="FILE" autoflush="true">
|
||||
<formatter>
|
||||
<named-formatter name="PATTERN"/>
|
||||
</formatter>
|
||||
<file relative-to="jboss.server.log.dir" path="server.log"/>
|
||||
<suffix value=".yyyy-MM-dd"/>
|
||||
<append value="true"/>
|
||||
</periodic-rotating-file-handler>
|
||||
<logger category="com.arjuna">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="com.networknt.schema">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="io.jaegertracing.Configuration">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="pro.taskana">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.config">
|
||||
<level name="DEBUG"/>
|
||||
</logger>
|
||||
<logger category="sun.rmi">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.slf4j"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.springframework.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.picketbox"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger
|
||||
category="org.jboss.as.domain.management.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.wildfly.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.wildfly.elytron"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.apache.catalina"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.wildfly.extension.undertow"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<root-logger>
|
||||
<level name="INFO"/>
|
||||
<handlers>
|
||||
<handler name="CONSOLE"/>
|
||||
<handler name="FILE"/>
|
||||
</handlers>
|
||||
</root-logger>
|
||||
<formatter name="PATTERN">
|
||||
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
<formatter name="COLOR-PATTERN">
|
||||
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:batch-jberet:3.0">
|
||||
<default-job-repository name="in-memory"/>
|
||||
<default-thread-pool name="batch"/>
|
||||
<security-domain name="ApplicationDomain"/>
|
||||
<job-repository name="in-memory">
|
||||
<in-memory/>
|
||||
</job-repository>
|
||||
<thread-pool name="batch">
|
||||
<max-threads count="10"/>
|
||||
<keepalive-time time="30" unit="seconds"/>
|
||||
</thread-pool>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:datasources:7.1">
|
||||
<datasources>
|
||||
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS"
|
||||
enabled="true" use-java-context="true"
|
||||
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security user-name="sa" password="sa"/>
|
||||
</datasource>
|
||||
<datasource jndi-name="java:jboss/datasources/Taskana"
|
||||
pool-name="TASKANA H2 Datasource"
|
||||
enabled="true"
|
||||
use-java-context="true"
|
||||
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<connection-url>
|
||||
jdbc:h2:~/taskana-h2-data/testdb;NON_KEYWORDS=KEY,VALUE;AUTO_SERVER=TRUE;IGNORECASE=TRUE;LOCK_MODE=0
|
||||
</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security user-name="sa" password="sa"/>
|
||||
</datasource>
|
||||
<drivers>
|
||||
<driver name="h2" module="com.h2database.h2">
|
||||
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
|
||||
</driver>
|
||||
</drivers>
|
||||
</datasources>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
|
||||
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir"
|
||||
scan-interval="5000"
|
||||
runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:discovery:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:distributable-ejb:1.0" default-bean-management="default">
|
||||
<infinispan-bean-management name="default" cache-container="ejb" cache="passivation"
|
||||
max-active-beans="10000"/>
|
||||
<local-client-mappings-registry/>
|
||||
<infinispan-timer-management name="persistent" cache-container="ejb" cache="persistent"
|
||||
max-active-timers="10000"/>
|
||||
<infinispan-timer-management name="transient" cache-container="ejb" cache="transient"
|
||||
max-active-timers="10000"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:distributable-web:4.0" default-session-management="default"
|
||||
default-single-sign-on-management="default">
|
||||
<infinispan-session-management name="default" cache-container="web" granularity="SESSION">
|
||||
<local-affinity/>
|
||||
</infinispan-session-management>
|
||||
<infinispan-single-sign-on-management name="default" cache-container="web" cache="sso"/>
|
||||
<local-routing/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ee:6.0">
|
||||
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
|
||||
<concurrent>
|
||||
<context-services>
|
||||
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" />
|
||||
</context-services>
|
||||
<managed-thread-factories>
|
||||
<managed-thread-factory name="default"
|
||||
jndi-name="java:jboss/ee/concurrency/factory/default"
|
||||
context-service="default"/>
|
||||
</managed-thread-factories>
|
||||
<managed-executor-services>
|
||||
<managed-executor-service name="default"
|
||||
jndi-name="java:jboss/ee/concurrency/executor/default"
|
||||
context-service="default" hung-task-termination-period="0"
|
||||
hung-task-threshold="60000" keepalive-time="5000"/>
|
||||
</managed-executor-services>
|
||||
<managed-scheduled-executor-services>
|
||||
<managed-scheduled-executor-service name="default"
|
||||
jndi-name="java:jboss/ee/concurrency/scheduler/default"
|
||||
context-service="default"
|
||||
hung-task-termination-period="0"
|
||||
hung-task-threshold="60000" keepalive-time="3000"/>
|
||||
</managed-scheduled-executor-services>
|
||||
</concurrent>
|
||||
<default-bindings context-service="java:jboss/ee/concurrency/context/default"
|
||||
datasource="java:jboss/datasources/ExampleDS"
|
||||
jms-connection-factory="java:jboss/DefaultJMSConnectionFactory"
|
||||
managed-executor-service="java:jboss/ee/concurrency/executor/default"
|
||||
managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"
|
||||
managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ee-security:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:ejb3:10.0">
|
||||
<session-bean>
|
||||
<stateless>
|
||||
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
|
||||
</stateless>
|
||||
<stateful default-access-timeout="5000" cache-ref="simple"
|
||||
passivation-disabled-cache-ref="simple"/>
|
||||
<singleton default-access-timeout="5000"/>
|
||||
</session-bean>
|
||||
<mdb>
|
||||
<resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
|
||||
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
|
||||
</mdb>
|
||||
<pools>
|
||||
<bean-instance-pools>
|
||||
<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count"
|
||||
instance-acquisition-timeout="5"
|
||||
instance-acquisition-timeout-unit="MINUTES"/>
|
||||
<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools"
|
||||
instance-acquisition-timeout="5"
|
||||
instance-acquisition-timeout-unit="MINUTES"/>
|
||||
</bean-instance-pools>
|
||||
</pools>
|
||||
<caches>
|
||||
<simple-cache name="simple"/>
|
||||
<distributable-cache name="distributable"/>
|
||||
</caches>
|
||||
<async thread-pool-name="default"/>
|
||||
<timer-service thread-pool-name="default" default-data-store="default-file-store">
|
||||
<data-stores>
|
||||
<file-data-store name="default-file-store" path="timer-service-data"
|
||||
relative-to="jboss.server.data.dir"/>
|
||||
</data-stores>
|
||||
</timer-service>
|
||||
<remote cluster="ejb" connectors="http-remoting-connector" thread-pool-name="default">
|
||||
<channel-creation-options>
|
||||
<option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
|
||||
</channel-creation-options>
|
||||
</remote>
|
||||
<thread-pools>
|
||||
<thread-pool name="default">
|
||||
<max-threads count="10"/>
|
||||
<keepalive-time time="60" unit="seconds"/>
|
||||
</thread-pool>
|
||||
</thread-pools>
|
||||
<iiop enable-by-default="false" use-qualified-name="false"/>
|
||||
<default-security-domain value="other"/>
|
||||
<application-security-domains>
|
||||
<application-security-domain name="other" security-domain="ApplicationDomain"/>
|
||||
</application-security-domains>
|
||||
<default-missing-method-permissions-deny-access value="true"/>
|
||||
<statistics enabled="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<log-system-exceptions value="true"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron:18.0" final-providers="combined-providers"
|
||||
disallowed-providers="OracleUcrypto">
|
||||
<providers>
|
||||
<aggregate-providers name="combined-providers">
|
||||
<providers name="elytron"/>
|
||||
<providers name="openssl"/>
|
||||
</aggregate-providers>
|
||||
<provider-loader name="elytron" module="org.wildfly.security.elytron"/>
|
||||
<provider-loader name="openssl" module="org.wildfly.openssl"/>
|
||||
</providers>
|
||||
<audit-logging>
|
||||
<file-audit-log name="local-audit" path="audit.log" relative-to="jboss.server.log.dir"
|
||||
format="JSON"/>
|
||||
</audit-logging>
|
||||
<security-domains>
|
||||
<security-domain name="ApplicationDomain" default-realm="ApplicationRealm"
|
||||
permission-mapper="default-permission-mapper">
|
||||
<realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local"/>
|
||||
</security-domain>
|
||||
<security-domain name="ManagementDomain" default-realm="ManagementRealm"
|
||||
permission-mapper="default-permission-mapper">
|
||||
<realm name="ManagementRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local" role-mapper="super-user-mapper"/>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
<security-realms>
|
||||
<identity-realm name="local" identity="$local"/>
|
||||
<properties-realm name="ApplicationRealm">
|
||||
<users-properties path="application-users.properties"
|
||||
relative-to="jboss.server.config.dir"
|
||||
digest-realm-name="ApplicationRealm"/>
|
||||
<groups-properties path="application-roles.properties"
|
||||
relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
<properties-realm name="ManagementRealm">
|
||||
<users-properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"
|
||||
digest-realm-name="ManagementRealm"/>
|
||||
<groups-properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
</security-realms>
|
||||
<mappers>
|
||||
<simple-permission-mapper name="default-permission-mapper" mapping-mode="first">
|
||||
<permission-mapping>
|
||||
<principal name="anonymous"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
<permission-mapping match-all="true">
|
||||
<permission-set name="login-permission"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
</simple-permission-mapper>
|
||||
<constant-realm-mapper name="local" realm-name="local"/>
|
||||
<simple-role-decoder name="groups-to-roles" attribute="groups"/>
|
||||
<constant-role-mapper name="super-user-mapper">
|
||||
<role name="SuperUser"/>
|
||||
</constant-role-mapper>
|
||||
</mappers>
|
||||
<permission-sets>
|
||||
<permission-set name="login-permission">
|
||||
<permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
|
||||
</permission-set>
|
||||
<permission-set name="default-permissions">
|
||||
<permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission"
|
||||
module="org.wildfly.transaction.client"/>
|
||||
<permission class-name="org.jboss.ejb.client.RemoteEJBPermission"
|
||||
module="org.jboss.ejb-client"/>
|
||||
<permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission"
|
||||
module="org.wildfly.extension.batch.jberet" target-name="*"/>
|
||||
</permission-set>
|
||||
</permission-sets>
|
||||
<http>
|
||||
<http-authentication-factory name="application-http-authentication"
|
||||
security-domain="ApplicationDomain"
|
||||
http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="BASIC">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<http-authentication-factory name="management-http-authentication"
|
||||
security-domain="ManagementDomain"
|
||||
http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="DIGEST">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<provider-http-server-mechanism-factory name="global"/>
|
||||
</http>
|
||||
<sasl>
|
||||
<sasl-authentication-factory name="application-sasl-authentication"
|
||||
sasl-server-factory="configured"
|
||||
security-domain="ApplicationDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<sasl-authentication-factory name="management-sasl-authentication"
|
||||
sasl-server-factory="configured"
|
||||
security-domain="ManagementDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
|
||||
<properties>
|
||||
<property name="wildfly.sasl.local-user.default-user" value="$local"/>
|
||||
<property name="wildfly.sasl.local-user.challenge-path"
|
||||
value="${jboss.server.temp.dir}/auth"/>
|
||||
</properties>
|
||||
</configurable-sasl-server-factory>
|
||||
<mechanism-provider-filtering-sasl-server-factory name="elytron"
|
||||
sasl-server-factory="global">
|
||||
<filters>
|
||||
<filter provider-name="WildFlyElytron"/>
|
||||
</filters>
|
||||
</mechanism-provider-filtering-sasl-server-factory>
|
||||
<provider-sasl-server-factory name="global"/>
|
||||
</sasl>
|
||||
<tls>
|
||||
<key-stores>
|
||||
<key-store name="applicationKS">
|
||||
<credential-reference clear-text="password"/>
|
||||
<implementation type="JKS"/>
|
||||
<file path="application.keystore" relative-to="jboss.server.config.dir"/>
|
||||
</key-store>
|
||||
</key-stores>
|
||||
<key-managers>
|
||||
<key-manager name="applicationKM" key-store="applicationKS"
|
||||
generate-self-signed-certificate-host="localhost">
|
||||
<credential-reference clear-text="password"/>
|
||||
</key-manager>
|
||||
</key-managers>
|
||||
<server-ssl-contexts>
|
||||
<server-ssl-context name="applicationSSC" key-manager="applicationKM"/>
|
||||
</server-ssl-contexts>
|
||||
</tls>
|
||||
<policy name="jacc">
|
||||
<jacc-policy/>
|
||||
</policy>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron-oidc-client:2.0"/>
|
||||
<subsystem xmlns="urn:wildfly:health:1.0" security-enabled="false"/>
|
||||
<subsystem xmlns="urn:jboss:domain:iiop-openjdk:3.0">
|
||||
<orb socket-binding="iiop"/>
|
||||
<initializers security="elytron" transactions="spec"/>
|
||||
<security server-requires-ssl="false" client-requires-ssl="false"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:infinispan:14.0">
|
||||
<cache-container name="hibernate" marshaller="JBOSS" modules="org.infinispan.hibernate-cache">
|
||||
<local-cache name="entity">
|
||||
<heap-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</local-cache>
|
||||
<local-cache name="local-query">
|
||||
<heap-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</local-cache>
|
||||
<local-cache name="timestamps">
|
||||
<expiration interval="0"/>
|
||||
</local-cache>
|
||||
<local-cache name="pending-puts">
|
||||
<expiration max-idle="60000"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="ejb" default-cache="passivation" marshaller="PROTOSTREAM"
|
||||
aliases="sfsb" modules="org.wildfly.clustering.ejb.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true"/>
|
||||
</local-cache>
|
||||
<local-cache name="persistent">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<expiration interval="0"/>
|
||||
<file-store preload="true"/>
|
||||
</local-cache>
|
||||
<local-cache name="transient">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true" purge="true"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="web" default-cache="passivation" marshaller="PROTOSTREAM"
|
||||
modules="org.wildfly.clustering.web.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true"/>
|
||||
</local-cache>
|
||||
<local-cache name="sso">
|
||||
<expiration interval="0"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:io:3.0">
|
||||
<worker name="default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jaxrs:3.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jca:6.0">
|
||||
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
|
||||
<bean-validation enabled="true"/>
|
||||
<default-workmanager>
|
||||
<short-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</short-running-threads>
|
||||
<long-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</long-running-threads>
|
||||
</default-workmanager>
|
||||
<cached-connection-manager/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
|
||||
<expose-resolved-model/>
|
||||
<expose-expression-model/>
|
||||
<remoting-connector/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
|
||||
<jpa default-extended-persistence-inheritance="DEEP"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jsf:1.1"/>
|
||||
<subsystem xmlns="urn:jboss:domain:mail:4.0">
|
||||
<mail-session name="default" jndi-name="java:jboss/mail/Default">
|
||||
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:messaging-activemq:16.0">
|
||||
<server name="default">
|
||||
<security elytron-domain="ApplicationDomain"/>
|
||||
<statistics
|
||||
enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<security-setting name="#">
|
||||
<role name="guest" send="true" consume="true" create-non-durable-queue="true"
|
||||
delete-non-durable-queue="true"/>
|
||||
</security-setting>
|
||||
<address-setting name="#" dead-letter-address="jms.queue.DLQ"
|
||||
expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760"
|
||||
page-size-bytes="2097152" message-counter-history-day-limit="10"/>
|
||||
<http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
|
||||
<http-connector name="http-connector-throughput" socket-binding="http"
|
||||
endpoint="http-acceptor-throughput">
|
||||
<param name="batch-delay" value="50"/>
|
||||
</http-connector>
|
||||
<in-vm-connector name="in-vm" server-id="0">
|
||||
<param name="buffer-pooling" value="false"/>
|
||||
</in-vm-connector>
|
||||
<http-acceptor name="http-acceptor" http-listener="default"/>
|
||||
<http-acceptor name="http-acceptor-throughput" http-listener="default">
|
||||
<param name="batch-delay" value="50"/>
|
||||
<param name="direct-deliver" value="false"/>
|
||||
</http-acceptor>
|
||||
<in-vm-acceptor name="in-vm" server-id="0">
|
||||
<param name="buffer-pooling" value="false"/>
|
||||
</in-vm-acceptor>
|
||||
<jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
|
||||
<jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
|
||||
<connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory"
|
||||
connectors="in-vm"/>
|
||||
<connection-factory name="RemoteConnectionFactory"
|
||||
entries="java:jboss/exported/jms/RemoteConnectionFactory"
|
||||
connectors="http-connector"/>
|
||||
<pooled-connection-factory name="activemq-ra"
|
||||
entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory"
|
||||
connectors="in-vm" transaction="xa"/>
|
||||
</server>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:metrics:1.0" security-enabled="false" exposed-subsystems="*"
|
||||
prefix="${wildfly.metrics.prefix:wildfly}"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-config-smallrye:2.0"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-jwt-smallrye:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:remoting:6.0">
|
||||
<endpoint worker="default"/>
|
||||
<http-connector name="http-remoting-connector" connector-ref="default"
|
||||
sasl-authentication-factory="application-sasl-authentication"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:resource-adapters:7.1"/>
|
||||
<subsystem xmlns="urn:jboss:domain:sar:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:security-manager:1.0">
|
||||
<deployment-permissions>
|
||||
<maximum-set>
|
||||
<permission class="java.security.AllPermission"/>
|
||||
</maximum-set>
|
||||
</deployment-permissions>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:transactions:6.0">
|
||||
<core-environment node-identifier="${jboss.tx.node.id:1}">
|
||||
<process-id>
|
||||
<uuid/>
|
||||
</process-id>
|
||||
</core-environment>
|
||||
<recovery-environment socket-binding="txn-recovery-environment"
|
||||
status-socket-binding="txn-status-manager"/>
|
||||
<coordinator-environment
|
||||
statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host"
|
||||
default-servlet-container="default" default-server="default-server"
|
||||
statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}"
|
||||
default-security-domain="other">
|
||||
<byte-buffer-pool name="default"/>
|
||||
<buffer-cache name="default"/>
|
||||
<server name="default-server">
|
||||
<http-listener name="default" socket-binding="http" redirect-socket="https"
|
||||
enable-http2="true"/>
|
||||
<https-listener name="https" socket-binding="https" ssl-context="applicationSSC"
|
||||
enable-http2="true"/>
|
||||
<host name="default-host" alias="localhost">
|
||||
<location name="/" handler="welcome-content"/>
|
||||
<http-invoker http-authentication-factory="application-http-authentication"/>
|
||||
</host>
|
||||
</server>
|
||||
<servlet-container name="default">
|
||||
<jsp-config/>
|
||||
<websockets/>
|
||||
</servlet-container>
|
||||
<handlers>
|
||||
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
|
||||
</handlers>
|
||||
<application-security-domains>
|
||||
<application-security-domain name="other" security-domain="ApplicationDomain"/>
|
||||
</application-security-domains>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:webservices:2.0"
|
||||
statistics-enabled="${wildfly.webservices.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
|
||||
<endpoint-config name="Standard-Endpoint-Config"/>
|
||||
<endpoint-config name="Recording-Endpoint-Config">
|
||||
<pre-handler-chain name="recording-handlers"
|
||||
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
|
||||
<handler name="RecordingHandler"
|
||||
class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
|
||||
</pre-handler-chain>
|
||||
</endpoint-config>
|
||||
<client-config name="Standard-Client-Config"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:weld:5.0"/>
|
||||
</profile>
|
||||
<interfaces>
|
||||
<interface name="management">
|
||||
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
|
||||
</interface>
|
||||
<interface name="public">
|
||||
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
|
||||
</interface>
|
||||
<interface name="unsecure">
|
||||
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<socket-binding-group name="standard-sockets" default-interface="public"
|
||||
port-offset="${jboss.socket.binding.port-offset:0}">
|
||||
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
|
||||
<socket-binding name="http" port="${jboss.http.port:8080}"/>
|
||||
<socket-binding name="https" port="${jboss.https.port:8443}"/>
|
||||
<socket-binding name="iiop" interface="unsecure" port="3528"/>
|
||||
<socket-binding name="iiop-ssl" interface="unsecure" port="3529"/>
|
||||
<socket-binding name="management-http" interface="management"
|
||||
port="${jboss.management.http.port:9990}"/>
|
||||
<socket-binding name="management-https" interface="management"
|
||||
port="${jboss.management.https.port:9993}"/>
|
||||
<socket-binding name="txn-recovery-environment" port="4712"/>
|
||||
<socket-binding name="txn-status-manager" port="4713"/>
|
||||
<outbound-socket-binding name="mail-smtp">
|
||||
<remote-destination host="${jboss.mail.server.host:localhost}"
|
||||
port="${jboss.mail.server.port:25}"/>
|
||||
</outbound-socket-binding>
|
||||
</socket-binding-group>
|
||||
</server>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<module name="com.h2database.h2" xmlns="urn:jboss:module:1.9">
|
||||
|
||||
<resources>
|
||||
<resource-root path="h2-2.2.224.jar"/>
|
||||
</resources>
|
||||
<dependencies>
|
||||
<module name="java.compiler"/>
|
||||
<module name="java.desktop"/>
|
||||
<module name="java.instrument"/>
|
||||
<module name="java.logging"/>
|
||||
<module name="java.management"/>
|
||||
<module name="java.naming"/>
|
||||
<module name="java.scripting"/>
|
||||
<module name="java.sql"/>
|
||||
<module name="java.transaction.xa"/>
|
||||
<!-- H2 uses Jakarta Servlet to allow apps (in our case deployments) to expose its console as a servlet.
|
||||
WildFly isn't concerning itself with allowing this H2 feature to continue to work in both a
|
||||
javax.* EE namespace and jakarta.* EE namespace environment, so this no longer works out of the box.
|
||||
But, we add an optional dep on a non-existent module as a hook to allow users to get it to work.
|
||||
Users who want this to work can provide a module with the name:slot javax.servlet.api:h2. That module could
|
||||
be a simple alias to the jakarta.servlet.api module the server provides, if that works with this module's
|
||||
H2 artifact. Or the user could provide a non-alias module that packages and exposes the servlet resources H2 needs. -->
|
||||
<module name="javax.servlet.api:h2" optional="true"/>
|
||||
<module name="org.slf4j"/>
|
||||
</dependencies>
|
||||
</module>
|
|
@ -10,7 +10,7 @@
|
|||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-lib-parent</artifactId>
|
||||
<version>8.2.1-SNAPSHOT</version>
|
||||
<version>7.2.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.bom</groupId>
|
||||
<artifactId>wildfly-ee</artifactId>
|
||||
<artifactId>wildfly-jakartaee8</artifactId>
|
||||
<version>${version.wildfly}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
|
@ -35,14 +35,18 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-core</artifactId>
|
||||
<artifactId>taskana-common-logging</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.platform</groupId>
|
||||
<artifactId>jakarta.jakartaee-api</artifactId>
|
||||
<version>${version.jakartaee-api}</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>javax</groupId>
|
||||
<artifactId>javaee-api</artifactId>
|
||||
<version>${version.javaee-api}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TEST dependencies -->
|
||||
|
@ -73,8 +77,8 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -100,7 +104,7 @@
|
|||
<dependency>
|
||||
<groupId>org.wildfly.arquillian</groupId>
|
||||
<artifactId>wildfly-arquillian-container-managed</artifactId>
|
||||
<version>${version.arquillian.managed.wildfly}</version>
|
||||
<version>3.0.1.Final</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -176,26 +180,6 @@
|
|||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-wildfly-config-xml</id>
|
||||
<phase>process-test-classes</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>
|
||||
${project.build.directory}/wildfly-${version.wildfly}/standalone/configuration
|
||||
</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/test/resources</directory>
|
||||
<includes>
|
||||
<include>int-test-standalone.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -204,7 +188,7 @@
|
|||
<repositories>
|
||||
<repository>
|
||||
<id>jboss</id>
|
||||
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
|
||||
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package pro.taskana.common.internal;
|
||||
|
||||
public class TaskanaCdiStartupException extends RuntimeException {
|
||||
|
||||
public TaskanaCdiStartupException(Throwable cause) {
|
||||
super("Can't init TaskanaProducers", cause);
|
||||
}
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
package pro.taskana.common.internal;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.enterprise.event.Observes;
|
||||
import jakarta.enterprise.event.Startup;
|
||||
import jakarta.enterprise.inject.Produces;
|
||||
import jakarta.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Properties;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.enterprise.inject.Produces;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.naming.NamingException;
|
||||
|
@ -32,31 +30,10 @@ public class TaskanaProducers {
|
|||
|
||||
private static final String TASKANA_PROPERTIES = "taskana.properties";
|
||||
|
||||
// initalized during post construct
|
||||
@Inject private TaskanaEngine taskanaEngine;
|
||||
|
||||
private TaskanaConfiguration taskanaConfiguration;
|
||||
|
||||
private final TaskanaEngine taskanaEngine;
|
||||
|
||||
public TaskanaProducers() {
|
||||
this.taskanaEngine = null;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public TaskanaProducers(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngine = taskanaEngine;
|
||||
}
|
||||
|
||||
/**
|
||||
* The parameter `@Observes Startup` makes sure that the dependency injection framework calls this
|
||||
* method on system startup. And to do that, it needs to call `@PostConstruct start()` first.
|
||||
*
|
||||
* @param startup just the startup event
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private void forceEagerInitialization(@Observes Startup startup) {
|
||||
LOGGER.info("startup={}", startup);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// Load Properties and get Datasource via Context
|
||||
|
@ -80,7 +57,7 @@ public class TaskanaProducers {
|
|||
.initTaskanaProperties()
|
||||
.build();
|
||||
} catch (NamingException | SQLException | IOException e) {
|
||||
throw new TaskanaCdiStartupException(e);
|
||||
LOGGER.error("Could not start Taskana: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xsi:schemaLocation="
|
||||
http://java.sun.com/xml/ns/javaee
|
||||
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"
|
||||
version="1.2" bean-discovery-mode="all">
|
||||
</beans>
|
|
@ -1,7 +1,7 @@
|
|||
package pro.taskana;
|
||||
|
||||
import jakarta.ws.rs.ApplicationPath;
|
||||
import jakarta.ws.rs.core.Application;
|
||||
import javax.ws.rs.ApplicationPath;
|
||||
import javax.ws.rs.core.Application;
|
||||
|
||||
@ApplicationPath("/rest")
|
||||
public class RestApplication extends Application {}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package pro.taskana;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.DELETE;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import javax.ejb.EJB;
|
||||
import javax.inject.Inject;
|
||||
import javax.ws.rs.DELETE;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import pro.taskana.classification.api.ClassificationService;
|
||||
|
@ -23,21 +24,9 @@ public class TaskanaCdiTestRestController {
|
|||
private static final String CDIDOMAIN = "CDIDOMAIN";
|
||||
private static final String CLASSIFICATION_TYPE = "T1";
|
||||
|
||||
private final TaskanaEjb taskanaEjb;
|
||||
@EJB private TaskanaEjb taskanaEjb;
|
||||
|
||||
private final ClassificationService classificationService;
|
||||
|
||||
public TaskanaCdiTestRestController() {
|
||||
this.taskanaEjb = null;
|
||||
this.classificationService = null;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public TaskanaCdiTestRestController(
|
||||
TaskanaEjb taskanaEjb, ClassificationService classificationService) {
|
||||
this.taskanaEjb = taskanaEjb;
|
||||
this.classificationService = classificationService;
|
||||
}
|
||||
@Inject private ClassificationService classificationService;
|
||||
|
||||
@GET
|
||||
public Response startTask() throws Exception {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package pro.taskana;
|
||||
|
||||
import jakarta.ejb.Stateless;
|
||||
import jakarta.inject.Inject;
|
||||
import javax.ejb.Stateless;
|
||||
import javax.inject.Inject;
|
||||
import pro.taskana.classification.api.ClassificationService;
|
||||
import pro.taskana.task.api.TaskService;
|
||||
import pro.taskana.task.api.models.Task;
|
||||
|
@ -11,27 +11,11 @@ import pro.taskana.workbasket.api.WorkbasketService;
|
|||
@Stateless
|
||||
public class TaskanaEjb {
|
||||
|
||||
private final TaskService taskService;
|
||||
@Inject private TaskService taskService;
|
||||
|
||||
private final ClassificationService classificationService;
|
||||
@Inject private ClassificationService classificationService;
|
||||
|
||||
private final WorkbasketService workbasketService;
|
||||
|
||||
public TaskanaEjb() {
|
||||
this.taskService = null;
|
||||
this.classificationService = null;
|
||||
this.workbasketService = null;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public TaskanaEjb(
|
||||
TaskService taskService,
|
||||
ClassificationService classificationService,
|
||||
WorkbasketService workbasketService) {
|
||||
this.taskService = taskService;
|
||||
this.classificationService = classificationService;
|
||||
this.workbasketService = workbasketService;
|
||||
}
|
||||
@Inject private WorkbasketService workbasketService;
|
||||
|
||||
public TaskService getTaskService() {
|
||||
return taskService;
|
||||
|
|
|
@ -49,15 +49,14 @@ public class TaskanaProducersTest {
|
|||
File[] libs =
|
||||
Maven.resolver()
|
||||
.loadPomFromFile("pom.xml")
|
||||
.importCompileAndRuntimeDependencies()
|
||||
.importRuntimeAndTestDependencies()
|
||||
.resolve()
|
||||
.withTransitivity()
|
||||
.asFile();
|
||||
deployment.addAsLibraries(libs);
|
||||
|
||||
JavaArchive ejbModule = ShrinkWrap.create(JavaArchive.class, "taskana.jar");
|
||||
ejbModule.addClasses(
|
||||
TaskanaProducers.class, TaskanaEjb.class, TaskanaCdiStartupException.class);
|
||||
ejbModule.addClasses(TaskanaProducers.class, TaskanaEjb.class);
|
||||
ejbModule.addAsResource("taskana.properties");
|
||||
deployment.addAsModule(ejbModule);
|
||||
|
||||
|
@ -77,7 +76,7 @@ public class TaskanaProducersTest {
|
|||
// Delete Taskana folder if exists
|
||||
Path taskanaH2Data = Path.of(System.getProperty("user.home"), "taskana-h2-data");
|
||||
if (Files.exists(taskanaH2Data)) {
|
||||
FileUtils.forceDelete(taskanaH2Data.toFile());
|
||||
FileUtils.deleteDirectory(taskanaH2Data.toFile());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +110,7 @@ public class TaskanaProducersTest {
|
|||
"jdbc:h2:~/taskana-h2-data/testdb;NON_KEYWORDS=KEY,VALUE;AUTO_SERVER=TRUE;"
|
||||
+ "IGNORECASE=TRUE;LOCK_MODE=0",
|
||||
"sa",
|
||||
"sa");
|
||||
"");
|
||||
}
|
||||
|
||||
private int countTasksByName(String taskName) throws Exception {
|
||||
|
|
|
@ -2,16 +2,22 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://jboss.org/schema/arquillian
|
||||
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
|
||||
<defaultProtocol type="Servlet 6.0"/>
|
||||
<defaultProtocol type="Servlet 3.0"/>
|
||||
<container qualifier="wildfly" default="true">
|
||||
<configuration>
|
||||
<property name="jbossHome">target/wildfly-31.0.1.Final</property>
|
||||
<property name="serverConfig">int-test-standalone.xml</property>
|
||||
<property name="jbossHome">target/wildfly-25.0.1.Final</property>
|
||||
<property
|
||||
name="serverConfig">../../../../src/test/resources/int-test-standalone.xml
|
||||
</property>
|
||||
<!-- <property name="javaVmArguments">-->
|
||||
<!-- - -add-opens java.base/java.util=ALL-UNNAMED-->
|
||||
<!-- -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y-->
|
||||
<!-- -Dh2.bindAddress=127.0.0.1-->
|
||||
<!-- -Djava.util.logging.manager=org.jboss.logmanager.LogManager-->
|
||||
<!-- </property>-->
|
||||
<property name="javaVmArguments">
|
||||
--add-opens java.base/java.util=ALL-UNNAMED
|
||||
-Dh2.bindAddress=127.0.0.1
|
||||
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
|
||||
</property>
|
||||
</configuration>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<server xmlns="urn:jboss:domain:20.0">
|
||||
<server xmlns="urn:jboss:domain:18.0">
|
||||
<extensions>
|
||||
<extension module="org.jboss.as.clustering.infinispan"/>
|
||||
<extension module="org.jboss.as.connector"/>
|
||||
|
@ -12,6 +12,7 @@
|
|||
<extension module="org.jboss.as.jmx"/>
|
||||
<extension module="org.jboss.as.jpa"/>
|
||||
<extension module="org.jboss.as.jsf"/>
|
||||
<extension module="org.jboss.as.jsr77"/>
|
||||
<extension module="org.jboss.as.logging"/>
|
||||
<extension module="org.jboss.as.mail"/>
|
||||
<extension module="org.jboss.as.naming"/>
|
||||
|
@ -23,7 +24,6 @@
|
|||
<extension module="org.jboss.as.weld"/>
|
||||
<extension module="org.wildfly.extension.batch.jberet"/>
|
||||
<extension module="org.wildfly.extension.bean-validation"/>
|
||||
<extension module="org.wildfly.extension.clustering.ejb"/>
|
||||
<extension module="org.wildfly.extension.clustering.web"/>
|
||||
<extension module="org.wildfly.extension.core-management"/>
|
||||
<extension module="org.wildfly.extension.discovery"/>
|
||||
|
@ -36,6 +36,7 @@
|
|||
<extension module="org.wildfly.extension.metrics"/>
|
||||
<extension module="org.wildfly.extension.microprofile.config-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.jwt-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.opentracing-smallrye"/>
|
||||
<extension module="org.wildfly.extension.request-controller"/>
|
||||
<extension module="org.wildfly.extension.security.manager"/>
|
||||
<extension module="org.wildfly.extension.undertow"/>
|
||||
|
@ -91,62 +92,15 @@
|
|||
<logger category="com.arjuna">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="com.networknt.schema">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="io.jaegertracing.Configuration">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="pro.taskana">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.config">
|
||||
<level name="DEBUG"/>
|
||||
</logger>
|
||||
<logger category="sun.rmi">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.slf4j"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.springframework.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.picketbox"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger
|
||||
category="org.jboss.as.domain.management.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.wildfly.security"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.wildfly.elytron"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.apache.catalina"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<logger category="org.wildfly.extension.undertow"
|
||||
use-parent-handlers="true">
|
||||
<level name="INFO"/>
|
||||
</logger>
|
||||
<root-logger>
|
||||
<level name="INFO"/>
|
||||
<handlers>
|
||||
|
@ -161,10 +115,9 @@
|
|||
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:batch-jberet:3.0">
|
||||
<subsystem xmlns="urn:jboss:domain:batch-jberet:2.0">
|
||||
<default-job-repository name="in-memory"/>
|
||||
<default-thread-pool name="batch"/>
|
||||
<security-domain name="ApplicationDomain"/>
|
||||
<job-repository name="in-memory">
|
||||
<in-memory/>
|
||||
</job-repository>
|
||||
|
@ -175,14 +128,17 @@
|
|||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:datasources:7.1">
|
||||
<subsystem xmlns="urn:jboss:domain:datasources:6.0">
|
||||
<datasources>
|
||||
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS"
|
||||
enabled="true" use-java-context="true"
|
||||
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security user-name="sa" password="sa"/>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password></password>
|
||||
</security>
|
||||
</datasource>
|
||||
<datasource jndi-name="java:jboss/datasources/TestDS"
|
||||
pool-name="TASKANA H2 Datasource"
|
||||
|
@ -193,7 +149,10 @@
|
|||
jdbc:h2:~/taskana-h2-data/testdb;NON_KEYWORDS=KEY,VALUE;AUTO_SERVER=TRUE;IGNORECASE=TRUE;LOCK_MODE=0
|
||||
</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security user-name="sa" password="sa"/>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password></password>
|
||||
</security>
|
||||
</datasource>
|
||||
<drivers>
|
||||
<driver name="h2" module="com.h2database.h2">
|
||||
|
@ -208,16 +167,7 @@
|
|||
runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:discovery:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:distributable-ejb:1.0" default-bean-management="default">
|
||||
<infinispan-bean-management name="default" cache-container="ejb" cache="passivation"
|
||||
max-active-beans="10000"/>
|
||||
<local-client-mappings-registry/>
|
||||
<infinispan-timer-management name="persistent" cache-container="ejb" cache="persistent"
|
||||
max-active-timers="10000"/>
|
||||
<infinispan-timer-management name="transient" cache-container="ejb" cache="transient"
|
||||
max-active-timers="10000"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:distributable-web:4.0" default-session-management="default"
|
||||
<subsystem xmlns="urn:jboss:domain:distributable-web:2.0" default-session-management="default"
|
||||
default-single-sign-on-management="default">
|
||||
<infinispan-session-management name="default" cache-container="web" granularity="SESSION">
|
||||
<local-affinity/>
|
||||
|
@ -229,7 +179,8 @@
|
|||
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
|
||||
<concurrent>
|
||||
<context-services>
|
||||
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" />
|
||||
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default"
|
||||
use-transaction-setup-provider="true"/>
|
||||
</context-services>
|
||||
<managed-thread-factories>
|
||||
<managed-thread-factory name="default"
|
||||
|
@ -258,7 +209,7 @@
|
|||
managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ee-security:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:ejb3:10.0">
|
||||
<subsystem xmlns="urn:jboss:domain:ejb3:9.0">
|
||||
<session-bean>
|
||||
<stateless>
|
||||
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
|
||||
|
@ -282,9 +233,13 @@
|
|||
</bean-instance-pools>
|
||||
</pools>
|
||||
<caches>
|
||||
<simple-cache name="simple"/>
|
||||
<distributable-cache name="distributable"/>
|
||||
<cache name="simple"/>
|
||||
<cache name="distributable" passivation-store-ref="infinispan"
|
||||
aliases="passivating clustered"/>
|
||||
</caches>
|
||||
<passivation-stores>
|
||||
<passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
|
||||
</passivation-stores>
|
||||
<async thread-pool-name="default"/>
|
||||
<timer-service thread-pool-name="default" default-data-store="default-file-store">
|
||||
<data-stores>
|
||||
|
@ -312,7 +267,7 @@
|
|||
<statistics enabled="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<log-system-exceptions value="true"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron:18.0" final-providers="combined-providers"
|
||||
<subsystem xmlns="urn:wildfly:elytron:14.0" final-providers="combined-providers"
|
||||
disallowed-providers="OracleUcrypto">
|
||||
<providers>
|
||||
<aggregate-providers name="combined-providers">
|
||||
|
@ -327,16 +282,16 @@
|
|||
format="JSON"/>
|
||||
</audit-logging>
|
||||
<security-domains>
|
||||
<security-domain name="ApplicationDomain" default-realm="ApplicationRealm"
|
||||
permission-mapper="default-permission-mapper">
|
||||
<realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local"/>
|
||||
</security-domain>
|
||||
<security-domain name="ManagementDomain" default-realm="ManagementRealm"
|
||||
permission-mapper="default-permission-mapper">
|
||||
<realm name="ManagementRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local" role-mapper="super-user-mapper"/>
|
||||
</security-domain>
|
||||
<security-domain name="ApplicationDomain" default-realm="ApplicationRealm"
|
||||
permission-mapper="default-permission-mapper">
|
||||
<realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local"/>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
<security-realms>
|
||||
<identity-realm name="local" identity="$local"/>
|
||||
|
@ -375,24 +330,15 @@
|
|||
<permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
|
||||
</permission-set>
|
||||
<permission-set name="default-permissions">
|
||||
<permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission"
|
||||
module="org.wildfly.extension.batch.jberet" target-name="*"/>
|
||||
<permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission"
|
||||
module="org.wildfly.transaction.client"/>
|
||||
<permission class-name="org.jboss.ejb.client.RemoteEJBPermission"
|
||||
module="org.jboss.ejb-client"/>
|
||||
<permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission"
|
||||
module="org.wildfly.extension.batch.jberet" target-name="*"/>
|
||||
</permission-set>
|
||||
</permission-sets>
|
||||
<http>
|
||||
<http-authentication-factory name="application-http-authentication"
|
||||
security-domain="ApplicationDomain"
|
||||
http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="BASIC">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<http-authentication-factory name="management-http-authentication"
|
||||
security-domain="ManagementDomain"
|
||||
http-server-mechanism-factory="global">
|
||||
|
@ -402,19 +348,18 @@
|
|||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<provider-http-server-mechanism-factory name="global"/>
|
||||
</http>
|
||||
<sasl>
|
||||
<sasl-authentication-factory name="application-sasl-authentication"
|
||||
sasl-server-factory="configured"
|
||||
security-domain="ApplicationDomain">
|
||||
<http-authentication-factory name="application-http-authentication"
|
||||
security-domain="ApplicationDomain"
|
||||
http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism mechanism-name="BASIC">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
</http-authentication-factory>
|
||||
<provider-http-server-mechanism-factory name="global"/>
|
||||
</http>
|
||||
<sasl>
|
||||
<sasl-authentication-factory name="management-sasl-authentication"
|
||||
sasl-server-factory="configured"
|
||||
security-domain="ManagementDomain">
|
||||
|
@ -425,6 +370,16 @@
|
|||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<sasl-authentication-factory name="application-sasl-authentication"
|
||||
sasl-server-factory="configured"
|
||||
security-domain="ApplicationDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
|
||||
<properties>
|
||||
<property name="wildfly.sasl.local-user.default-user" value="$local"/>
|
||||
|
@ -458,18 +413,38 @@
|
|||
<server-ssl-context name="applicationSSC" key-manager="applicationKM"/>
|
||||
</server-ssl-contexts>
|
||||
</tls>
|
||||
<policy name="jacc">
|
||||
<jacc-policy/>
|
||||
</policy>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron-oidc-client:2.0"/>
|
||||
<subsystem xmlns="urn:wildfly:elytron-oidc-client:1.0"/>
|
||||
<subsystem xmlns="urn:wildfly:health:1.0" security-enabled="false"/>
|
||||
<subsystem xmlns="urn:jboss:domain:iiop-openjdk:3.0">
|
||||
<subsystem xmlns="urn:jboss:domain:iiop-openjdk:2.1">
|
||||
<orb socket-binding="iiop"/>
|
||||
<initializers security="elytron" transactions="spec"/>
|
||||
<security server-requires-ssl="false" client-requires-ssl="false"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:infinispan:14.0">
|
||||
<subsystem xmlns="urn:jboss:domain:infinispan:13.0">
|
||||
<cache-container name="ejb" default-cache="passivation" marshaller="PROTOSTREAM"
|
||||
aliases="sfsb" modules="org.wildfly.clustering.ejb.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true" purge="false"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="web" default-cache="passivation" marshaller="PROTOSTREAM"
|
||||
modules="org.wildfly.clustering.web.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true" purge="false"/>
|
||||
</local-cache>
|
||||
<local-cache name="sso">
|
||||
<expiration interval="0"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="server" default-cache="default" marshaller="PROTOSTREAM"
|
||||
modules="org.wildfly.clustering.server">
|
||||
<local-cache name="default">
|
||||
<expiration interval="0"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="hibernate" marshaller="JBOSS" modules="org.infinispan.hibernate-cache">
|
||||
<local-cache name="entity">
|
||||
<heap-memory size="10000"/>
|
||||
|
@ -486,41 +461,13 @@
|
|||
<expiration max-idle="60000"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="ejb" default-cache="passivation" marshaller="PROTOSTREAM"
|
||||
aliases="sfsb" modules="org.wildfly.clustering.ejb.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true"/>
|
||||
</local-cache>
|
||||
<local-cache name="persistent">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<expiration interval="0"/>
|
||||
<file-store preload="true"/>
|
||||
</local-cache>
|
||||
<local-cache name="transient">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true" purge="true"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="web" default-cache="passivation" marshaller="PROTOSTREAM"
|
||||
modules="org.wildfly.clustering.web.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<expiration interval="0"/>
|
||||
<file-store passivation="true"/>
|
||||
</local-cache>
|
||||
<local-cache name="sso">
|
||||
<expiration interval="0"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:io:3.0">
|
||||
<worker name="default"/>
|
||||
<buffer-pool name="default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jaxrs:3.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jca:6.0">
|
||||
<subsystem xmlns="urn:jboss:domain:jaxrs:2.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jca:5.0">
|
||||
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
|
||||
<bean-validation enabled="true"/>
|
||||
<default-workmanager>
|
||||
|
@ -549,12 +496,13 @@
|
|||
<jpa default-extended-persistence-inheritance="DEEP"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jsf:1.1"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jsr77:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:mail:4.0">
|
||||
<mail-session name="default" jndi-name="java:jboss/mail/Default">
|
||||
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:messaging-activemq:16.0">
|
||||
<subsystem xmlns="urn:jboss:domain:messaging-activemq:13.0">
|
||||
<server name="default">
|
||||
<security elytron-domain="ApplicationDomain"/>
|
||||
<statistics
|
||||
|
@ -596,19 +544,23 @@
|
|||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:metrics:1.0" security-enabled="false" exposed-subsystems="*"
|
||||
prefix="${wildfly.metrics.prefix:wildfly}"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-config-smallrye:2.0"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-config-smallrye:1.0"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-jwt-smallrye:1.0"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-opentracing-smallrye:3.0" default-tracer="jaeger">
|
||||
<jaeger-tracer name="jaeger">
|
||||
<sampler-configuration sampler-type="const" sampler-param="1.0"/>
|
||||
</jaeger-tracer>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:remoting:6.0">
|
||||
<endpoint worker="default"/>
|
||||
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
|
||||
<http-connector name="http-remoting-connector" connector-ref="default"
|
||||
sasl-authentication-factory="application-sasl-authentication"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:resource-adapters:7.1"/>
|
||||
<subsystem xmlns="urn:jboss:domain:resource-adapters:6.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:sar:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:security-manager:1.0">
|
||||
<deployment-permissions>
|
||||
|
@ -629,11 +581,10 @@
|
|||
statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host"
|
||||
default-servlet-container="default" default-server="default-server"
|
||||
statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}"
|
||||
default-security-domain="other">
|
||||
<byte-buffer-pool name="default"/>
|
||||
<subsystem xmlns="urn:jboss:domain:undertow:12.0" default-server="default-server"
|
||||
default-virtual-host="default-host" default-servlet-container="default"
|
||||
default-security-domain="other"
|
||||
statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<buffer-cache name="default"/>
|
||||
<server name="default-server">
|
||||
<http-listener name="default" socket-binding="http" redirect-socket="https"
|
||||
|
@ -669,7 +620,7 @@
|
|||
</endpoint-config>
|
||||
<client-config name="Standard-Client-Config"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:weld:5.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:weld:4.0"/>
|
||||
</profile>
|
||||
<interfaces>
|
||||
<interface name="management">
|
||||
|
|