Merge branch 'master' into ci/docker-dependency-updates

This commit is contained in:
Nico Kempe 2023-11-18 13:49:58 +01:00 committed by GitHub
commit 3f043d2a2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
333 changed files with 13164 additions and 1948 deletions

View File

@ -16,7 +16,7 @@ Release Notes:
- [ ] 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.
- [ ] Commit message format → (Closes) #&lt;Issue Number&gt;: 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

View File

@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true
env:
JAVA_VERSION: 11
JAVA_VERSION: 17
NODE_VERSION: 16.14.2
ARTIFACTS_CYPRESS_TESTS_NAME: cypress-tests
@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
@ -67,7 +67,7 @@ jobs:
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
if-no-files-found: error
- name: Remove taskana artifacts from cache
run: rm -rf ~/.m2/repository/pro/taskana
run: rm -rf ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
- name: Cancel workflow
if: failure()
uses: andymckay/cancel-action@0.3
@ -77,14 +77,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: ${{ env.JAVA_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache web dependencies
@ -132,9 +132,9 @@ jobs:
needs: [ compile_frontend ]
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache web dependencies
@ -174,14 +174,14 @@ jobs:
needs: [ compile_frontend, compile_backend ]
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: ${{ env.JAVA_VERSION }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache web dependencies
@ -298,7 +298,7 @@ jobs:
database: POSTGRES
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
@ -348,7 +348,7 @@ jobs:
GPG_TTY: $(tty)
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # necessary for push back
# NOTE @v2 uses the token as an auth http header. Set it to
@ -418,7 +418,7 @@ jobs:
needs: [ test_frontend, test_e2e, test_backend ]
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
@ -455,10 +455,14 @@ jobs:
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@v2
uses: Azure/webapps-deploy@v3
with:
app-name: taskana
package: rest/taskana-rest-spring-example-boot/target/taskana-rest-spring-example-boot.jar
- name: Wait for Azure for 60 seconds
uses: jakejarvis/wait-action@master
with:
time: '60s'
- name: Smoke test documentation
run: ci/verify_docs_alive.sh
- name: Cancel workflow
@ -473,7 +477,7 @@ jobs:
needs: [ test_frontend, test_e2e, test_backend ]
steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK ${{ env.JAVA_VERSION }}

View File

@ -5,14 +5,14 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# 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.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

View File

@ -11,7 +11,7 @@ TASKANA - The open source task management library
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.mybluemix.net/taskana
* Demo Environment: https://taskana.azurewebsites.net/taskana
* Getting Started: https://taskana.atlassian.net/wiki/spaces/TAS/pages/228655109/Getting+started
* Issue Tracker: https://taskana.atlassian.net
* Contribution Guildelines: https://taskana.atlassian.net/wiki/spaces/TAS/pages/274202625/Contribution+Guide

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -e # fail fast
set -x
BASE_URL=https://taskana.mybluemix.net/taskana
BASE_URL=https://taskana.azurewebsites.net/taskana
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")"

View File

@ -12,7 +12,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-common-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -44,6 +44,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -14,5 +14,6 @@ DELETE FROM OBJECT_REFERENCE;
DELETE FROM SCHEDULED_JOB;
DELETE FROM USER_INFO;
DELETE FROM GROUP_INFO;
DELETE FROM PERMISSION_INFO;
INSERT INTO CONFIGURATION (NAME) VALUES ('MASTER');
COMMIT;

View File

@ -14,6 +14,7 @@ DROP TABLE OBJECT_REFERENCE;
DROP TABLE SCHEDULED_JOB;
DROP TABLE USER_INFO;
DROP TABLE GROUP_INFO;
DROP TABLE PERMISSION_INFO;
DROP SEQUENCE SCHEDULED_JOB_SEQ;
DROP SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ;
COMMIT;

View File

@ -1,10 +1,10 @@
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2 , ORG_LEVEL_3 , ORG_LEVEL_4 , MARKED_FOR_DELETION );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000001', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 1', 'John' , '' , '' , '' , '' , 'org1' , '' , '' , '' , FALSE );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000002', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 2', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000003', 'USER-1-3' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 3', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 3', 'John' , '' , '' , '' , '' , 'org1' , '' , '' , '' , FALSE );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000004', 'USER-1-4' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 4', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 4', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000005', 'GPK-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'GPK GruppenPk 1' , 'MONITOR_TEST_DOMAIN', 'GROUP' , 'Monitor Test Postkorb 5', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000006', 'TPK-VIP-1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'TPK VIP 1' , 'MONITOR_TEST_DOMAIN', 'TOPIC' , 'Monitor Test Postkorb 6', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2 , ORG_LEVEL_3 , ORG_LEVEL_4 , MARKED_FOR_DELETION , CUSTOM_5 , CUSTOM_6 , CUSTOM_7 , CUSTOM_8 );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000001', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 1', 'John' , '' , '' , '' , '' , 'org1' , '' , '' , '' , FALSE , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000002', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 2', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000003', 'USER-1-3' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 3', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 3', 'John' , '' , '' , '' , '' , 'org1' , '' , '' , '' , FALSE , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000004', 'USER-1-4' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 4', 'MONITOR_TEST_DOMAIN', 'PERSONAL', 'Monitor Test Postkorb 4', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000005', 'GPK-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'GPK GruppenPk 1' , 'MONITOR_TEST_DOMAIN', 'GROUP' , 'Monitor Test Postkorb 5', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000006', 'TPK-VIP-1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'TPK VIP 1' , 'MONITOR_TEST_DOMAIN', 'TOPIC' , 'Monitor Test Postkorb 6', 'John' , '' , '' , '' , '' , '' , '' , '' , '' , FALSE , '' , '' , '' , '' );
-- CLASSIFICATION TABLE (ID , KEY , PARENT_ID , PARENT_KEY, CATEGORY , TYPE , DOMAIN , VALID_IN_DOMAIN, CREATED , MODIFIED ,NAME , DESCRIPTION , PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1 , CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 );
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '' , '' , 'EXTERN' , 'TASK' , 'DOMAIN_A' , TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'OLD-Leistungsfall' , 'OLD-Leistungsfall' , 3 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' );

View File

@ -1,66 +1,66 @@
-- sample-data is used for rest tests and for the example application
--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 )
--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 );
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 );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000006', 'user-1-1' , 'Max Mustermann' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000004', 'WBI:100000000000000000000000000000000007', 'user-1-2' , 'Elena Eifrig' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000005', 'WBI:100000000000000000000000000000000008', 'user-2-1' , 'Simone Müller' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000006', 'WBI:100000000000000000000000000000000009', 'user-2-2' , 'Tim Schläfrig' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016201', 'WBI:100000000000000000000000000000000016', 'user-2-1' , 'Simone Müller' , true , true , true , true , true , true , false , false , false , false , false , false , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016202', 'WBI:100000000000000000000000000000000016', 'user-2-2' , 'Tim Schläfrig' , true , true , true , true , true , false , true , false , false , false , false , false , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016203', 'WBI:100000000000000000000000000000000016', 'user-2-3' , 'Thomas Bach' , true , true , true , true , true , false , false , true , false , false , false , false , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016204', 'WBI:100000000000000000000000000000000016', 'user-2-4' , 'Rolf Wieland' , true , true , true , true , true , false , false , false , true , false , false , false , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016205', 'WBI:100000000000000000000000000000000016', 'user-2-5' , 'Heike Schmidt' , true , true , true , true , true , false , false , false , false , true , false , false , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016206', 'WBI:100000000000000000000000000000000016', 'user-2-6' , 'Kurt Maier' , true , true , true , true , true , false , false , false , false , false , true , false , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016207', 'WBI:100000000000000000000000000000000016', 'user-2-7' , 'Wiebke Meyer' , true , true , true , true , true , false , false , false , false , false , false , true , false , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016208', 'WBI:100000000000000000000000000000000016', 'user-2-8' , 'Jana Heeg' , true , true , true , true , true , false , false , false , false , false , false , false , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016209', 'WBI:100000000000000000000000000000000016', 'user-2-9' , 'Nathalie Fuchs' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016210', 'WBI:100000000000000000000000000000000016', 'user-2-10' , 'Johannes Renz' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:B00000000000000000000000000000000014', 'WBI:100000000000000000000000000000000014', 'user-b-1' , 'Bernd Bern' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:B00000000000000000000000000000000015', 'WBI:100000000000000000000000000000000015', 'user-b-2' , 'Brundhilde Bio' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
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);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000006', 'user-1-1' , 'Max Mustermann' , 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:100000000000000000000000000000000004', 'WBI:100000000000000000000000000000000007', 'user-1-2' , 'Elena Eifrig' , 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:100000000000000000000000000000000005', 'WBI:100000000000000000000000000000000008', 'user-2-1' , 'Simone Müller' , 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:100000000000000000000000000000000006', 'WBI:100000000000000000000000000000000009', 'user-2-2' , 'Tim Schläfrig' , 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:100000000000000000000000000000016201', 'WBI:100000000000000000000000000000000016', 'user-2-1' , 'Simone Müller' , true , true , true , true , true , true , false , false , false , false , false , false , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016202', 'WBI:100000000000000000000000000000000016', 'user-2-2' , 'Tim Schläfrig' , true , true , true , true , true , false , true , false , false , false , false , false , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016203', 'WBI:100000000000000000000000000000000016', 'user-2-3' , 'Thomas Bach' , true , true , true , true , true , false , false , true , false , false , false , false , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016204', 'WBI:100000000000000000000000000000000016', 'user-2-4' , 'Rolf Wieland' , true , true , true , true , true , false , false , false , true , false , false , false , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016205', 'WBI:100000000000000000000000000000000016', 'user-2-5' , 'Heike Schmidt' , true , true , true , true , true , false , false , false , false , true , false , false , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016206', 'WBI:100000000000000000000000000000000016', 'user-2-6' , 'Kurt Maier' , true , true , true , true , true , false , false , false , false , false , true , false , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016207', 'WBI:100000000000000000000000000000000016', 'user-2-7' , 'Wiebke Meyer' , true , true , true , true , true , false , false , false , false , false , false , true , false , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016208', 'WBI:100000000000000000000000000000000016', 'user-2-8' , 'Jana Heeg' , true , true , true , true , true , false , false , false , false , false , false , false , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000016209', 'WBI:100000000000000000000000000000000016', 'user-2-9' , 'Nathalie Fuchs' , 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:100000000000000000000000000000016210', 'WBI:100000000000000000000000000000000016', 'user-2-10' , 'Johannes Renz' , 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:B00000000000000000000000000000000014', 'WBI:100000000000000000000000000000000014', 'user-b-1' , 'Bernd Bern' , 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:B00000000000000000000000000000000015', 'WBI:100000000000000000000000000000000015', 'user-b-2' , 'Brundhilde Bio' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
-- group internal access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'WBI:100000000000000000000000000000000004', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'WBI:100000000000000000000000000000000005', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'WBI:100000000000000000000000000000000009', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'WBI:100000000000000000000000000000000004', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'WBI:100000000000000000000000000000000005', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'WBI:100000000000000000000000000000000009', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
-- teamlead substitution
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'WBI:100000000000000000000000000000000004', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'WBI:100000000000000000000000000000000005', 'teamlead-1' , 'Titus Toll' , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'WBI:100000000000000000000000000000000004', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'WBI:100000000000000000000000000000000005', 'teamlead-1' , 'Titus Toll' , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
-- cross team tranfers
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , false, true , false , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , false, true , false , false , false , false , false , false , false , false , false , false , false , false , false , false );
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 );
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 );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , false, true , false , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , false, true , false , false , false , false , false , false , false , false , false , false , false , false , false , false ,true , true);
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 )
--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 );
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 );
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);
-- Cross team GPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'WBI:100000000000000000000000000000000001', 'teamlead-1' , 'Titus Toll' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000022', 'WBI:100000000000000000000000000000000001', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'WBI:100000000000000000000000000000000001', '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:100000000000000000000000000000000022', 'WBI:100000000000000000000000000000000001', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
-- TPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000123', 'WBI:100000000000000000000000000000000010', 'teamlead-1' , 'Titus Toll' , true , false, false , false , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000123', 'WBI:100000000000000000000000000000000010', 'teamlead-1' , 'Titus Toll' , true , false, false , false , false , false , false , false , false , false , false , false , false , false , false , false , false, true , true);
-- Access to other domains
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'WBI:100000000000000000000000000000000012', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 1', true , false, true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000024', 'WBI:100000000000000000000000000000000013', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , false, true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000025', 'WBI:100000000000000000000000000000000014', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000026', 'WBI:100000000000000000000000000000000015', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'WBI:100000000000000000000000000000000012', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 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:100000000000000000000000000000000024', 'WBI:100000000000000000000000000000000013', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', 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:100000000000000000000000000000000025', 'WBI:100000000000000000000000000000000014', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false, true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000026', 'WBI:100000000000000000000000000000000015', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'Organisationseinheit KSC 2', true , true , true , true , false , false , false , false , false , false , false , false , false , false , false , false , false, true , true );
-- Access to workbaskets for sorting test
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000900', 'WBI:000000000000000000000000000000000900', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000901', 'WBI:000000000000000000000000000000000901', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000902', 'WBI:000000000000000000000000000000000902', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000903', 'WBI:000000000000000000000000000000000903', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000904', 'WBI:000000000000000000000000000000000904', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000905', 'WBI:000000000000000000000000000000000905', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000906', 'WBI:000000000000000000000000000000000906', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true );
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 );
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 );
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 );
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000900', 'WBI:000000000000000000000000000000000900', '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:000000000000000000000000000000000901', 'WBI:000000000000000000000000000000000901', '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:000000000000000000000000000000000902', 'WBI:000000000000000000000000000000000902', '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:000000000000000000000000000000000903', 'WBI:000000000000000000000000000000000903', '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:000000000000000000000000000000000904', 'WBI:000000000000000000000000000000000904', '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:000000000000000000000000000000000905', 'WBI:000000000000000000000000000000000905', '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:000000000000000000000000000000000906', 'WBI:000000000000000000000000000000000906', '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: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);

View File

@ -1,55 +1,55 @@
-- sample-data is used for rest tests and for the example application
-- KSC workbaskets
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000000', 'ADMIN' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Postkorb Admin' , 'DOMAIN_A' , 'PERSONAL', 'Postkorb Admin' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A' , 'GROUP' , 'Gruppenpostkorb KSC' , 'teamlead-1' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A' , 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A' , 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A' , 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A' , 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 2 KSC 1' , 'user-1-2' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung', 'projekt' , 'team' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A' , 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000016', 'TPK_VIP_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP 2' , 'DOMAIN_A' , 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION , CUSTOM_5 , CUSTOM_6 , CUSTOM_7 , CUSTOM_8 );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000000', 'ADMIN' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Postkorb Admin' , 'DOMAIN_A' , 'PERSONAL', 'Postkorb Admin' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A' , 'GROUP' , 'Gruppenpostkorb KSC' , 'teamlead-1' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A' , 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A' , 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A' , 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A' , 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 2 KSC 1' , 'user-1-2' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung', 'projekt' , 'team' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A' , 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A' , 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000016', 'TPK_VIP_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP 2' , 'DOMAIN_A' , 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000017', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Testpostkorb' , 'DOMAIN_TEST', 'TOPIC' , null , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000017', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Testpostkorb' , 'DOMAIN_TEST', 'TOPIC' , null , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION , CUSTOM_5 , CUSTOM_6 , CUSTOM_7 , CUSTOM_8 );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000018', 'das_ist_eine_lange_description_und_ein_langer_owner' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Testpostkorb' , 'DOMAIN_TEST', 'TOPIC' , CONCAT('Lorem ipsum dolor sit amet, consetetur sadipscing',
CONCAT('sed diam nonumy eirmod tempor invidunt ut labore ',
CONCAT('sed diam nonumy eirmod tempor invidunt ut labore ',
CONCAT('ore magna aliquyam erat, sed diam voluptua. At ve',
's et accusam et justo duo dolores abcdfiskdk ekeke')))), 'das_ist_eine_sehr_sehr_sehr_sehr_sehr_lange_user_id', '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000019', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_Testpostkorbname_ohne_Leerzeichen' , 'DOMAIN_TEST', 'TOPIC' , 'langer Key und langer Name ohne Leerzeichen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000020', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_3', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 1' , 'DOMAIN_TEST', 'TOPIC' , 'langer Key und langer Name mit Leerzeichen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000021', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_4', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 2' , 'DOMAIN_TEST', 'TOPIC' , 'langer Key, langer Name mit Leerzeichen und lange UserId', 'das_ist_eine_sehr_sehr_sehr_sehr_sehr_lange_user_id', '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000022', 'kurzer_key' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 3' , 'DOMAIN_TEST', 'TOPIC' , 'kurzer Key und langer Name mit Leerzeichen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
's et accusam et justo duo dolores abcdfiskdk ekeke')))), 'das_ist_eine_sehr_sehr_sehr_sehr_sehr_lange_user_id', '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000019', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_Testpostkorbname_ohne_Leerzeichen' , 'DOMAIN_TEST', 'TOPIC' , 'langer Key und langer Name ohne Leerzeichen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000020', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_3', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 1' , 'DOMAIN_TEST', 'TOPIC' , 'langer Key und langer Name mit Leerzeichen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000021', 'das_ist_ein_sehr_sehr_sehr_sehr_sehr_sehr_sehr_sehr_langer_key_4', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 2' , 'DOMAIN_TEST', 'TOPIC' , 'langer Key, langer Name mit Leerzeichen und lange UserId', 'das_ist_eine_sehr_sehr_sehr_sehr_sehr_lange_user_id', '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000022', 'kurzer_key' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 3' , 'DOMAIN_TEST', 'TOPIC' , 'kurzer Key und langer Name mit Leerzeichen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000023', 'langer key, langer name, eine lange description, langer owner' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'das ist ein sehr sehr sehr sehr sehr sehr sehr sehr sehr sehr langer Testpostkorbname mit Leerzeichen 4' , 'DOMAIN_TEST', 'TOPIC' , CONCAT('Lorem ipsum dolor sit amet, consetetur sadipscing',
CONCAT('sed diam nonumy eirmod tempor invidunt ut labore ',
CONCAT('sed diam nonumy eirmod tempor invidunt ut labore ',
CONCAT('ore magna aliquyam erat, sed diam voluptua. At ve',
's et accusam et justo duo dolores abcdfiskdk ekeke')))), 'das_ist_eine_sehr_sehr_sehr_sehr_sehr_lange_user_id', '' , '' , '' , '' , '' , '' , '' , '' , false );
's et accusam et justo duo dolores abcdfiskdk ekeke')))), 'das_ist_eine_sehr_sehr_sehr_sehr_sehr_lange_user_id', '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION , CUSTOM_5 , CUSTOM_6 , CUSTOM_7 , CUSTOM_8 );
-- KSC workbaskets Domain_B
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_B_KSC' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B' , 'DOMAIN_B' , 'GROUP' , 'Gruppenpostkorb KSC' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B' , 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B' , 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B' , 'DOMAIN_B' , 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B' , 'DOMAIN_B' , 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'user-1-2' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_B_KSC' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B' , 'DOMAIN_B' , 'GROUP' , 'Gruppenpostkorb KSC' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B' , 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B' , 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B' , 'DOMAIN_B' , 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B' , 'DOMAIN_B' , 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'user-1-2' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false , '' , '' , '' , '' );
-- Workbaskets for sorting test
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.' , 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );

View File

@ -29,6 +29,7 @@ INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000021', 'ETI:0000000
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000022', 'ETI:000000000000000000000000000000000022', '2018-01-29 15:55:22', null , null , '2018-01-29 15:55:22', null , '2018-01-29 15:55:00', '2018-01-30 15:55:00', 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000022' , 'DOC_0000000000000000022' , null , '00' , 'PASystem' , '00' , 'SDNR' , '11223344' , false , false , null , 'NONE' , null , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , 'abc' , '' , '' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000023', 'ETI:000000000000000000000000000000000023', '2018-01-29 15:55:23', null , null , '2018-01-29 15:55:23', null , '2018-01-29 15:55:00', '2018-01-30 15:55:00', 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000023' , 'DOC_0000000000000000023' , null , '00' , 'PASystem' , '00' , 'SDNR' , '11223344' , false , false , null , 'NONE' , null , '' , '' , '' , '' , '' , '' , '' , 'lnp' , '' , '' , '' , '' , '' , 'abc' , '' , '' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000024', 'ETI:000000000000000000000000000000000024', '2018-01-29 15:55:24', null , null , '2018-01-29 15:55:24', null , '2018-01-29 15:55:00', '2018-01-30 15:55:00', 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000024' , 'DOC_0000000000000000024' , null , '00' , 'PASystem' , '00' , 'SDNR' , '11223344' , false , false , null , 'NONE' , null , '' , '' , '' , '' , '' , '' , '' , '' , null , '' , '' , '' , '' , 'abc' , '' , '' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 );
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000201', 'ETI:000000000000000000000000000000000201', '2023-07-31 15:55:01', '2023-07-31 15:55:00', null , '2023-07-31 15:55:01', null , '2023-07-31 15:55:00', '2023-08-02 15:55:00', 'Task201' , 'creator_user_id' , 'Lorem ipsum was n Quatsch dolor sit amet.', 'Some custom Note' , 2 , -1 , 'READY' , 'EXTERN' , 'L110102' , 'CLI:100000000000000000000000000000000002', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , 'pqr' , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , '' , 'abc' , '' , '' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 );
-- TASK TABLE (ID , EXTERNAL_ID , CREATED , CLAIMED , COMPLETED , modified , received , planned , due , name , creator , description , note , priority, manual_priority, state , classification_category , classification_key, classification_id , workbasket_id , workbasket_key, domain , business_process_id, parent_business_process_id, owner , por_company , por_system , por_system_instance, por_type , por_value , is_read, is_transferred,callback_info , callback_state , custom_attributes ,custom1 ,custom2, ,custom3, ,custom4 ,custom5 ,custom6 ,custom7 ,custom8 ,custom9 ,custom10 ,custom11, ,custom12 ,custom13 ,custom14 ,custom15 ,custom16 , custom-int-1, custom-int-2, custom-int-3, custom-int-4, custom-int-5, custom-int-6, custom-int-7, custom-int-8
-- Tasks for WorkOnTaskAccTest
INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000025', 'ETI:000000000000000000000000000000000025', '2018-01-29 15:55:24', null , null , '2018-01-29 15:55:24', '2018-01-29 15:55:24', '2018-01-29 15:55:00', '2018-01-30 15:55:00', 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000007' , 'USER-1-2' , 'DOMAIN_A', 'PI_0000000000025' , 'DOC_0000000000000000025' , null , 'abcd00' , 'PASystem' , '00' , 'SDNR' , '98765432' , false , false , null , 'NONE' , null , '' , '' , '' , '' , '' , '' , '' , '' , '' , 'ert' , 'ert' , 'ert' , 'ert' , 'abc' , 'ert' , 'ert' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 );

View File

@ -1,53 +1,53 @@
-- test-data is used for all tests except for the rest tests
-- KSC authorizations (ID , WB_ID , ACCESS_ID , ACCESS_NAME , READ , OPEN , APPEND, TRANSFER, DISTRIBUTE, C1 , C2 , C3 , C4 , C5 , C6 , C7 , C8 , C9 , C10 , C11 , C12)
-- KSC authorizations (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)
-- 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);
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);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000006', 'user-1-1' , 'Max Mustermann' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000004', 'WBI:100000000000000000000000000000000007', 'user-1-2' , 'Elena Eifrig' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000005', 'WBI:100000000000000000000000000000000008', 'user-2-1' , 'Simone Müller' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000006', 'WBI:100000000000000000000000000000000009', 'user-2-2' , 'Tim Schläfrig' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:B00000000000000000000000000000000014', 'WBI:100000000000000000000000000000000014', 'user-b-1' , 'Bernd Bern' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:B00000000000000000000000000000000015', 'WBI:100000000000000000000000000000000015', 'user-b-2' , 'Brundhilde Bio' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
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);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000006', 'user-1-1' , 'Max Mustermann' , 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:100000000000000000000000000000000004', 'WBI:100000000000000000000000000000000007', 'user-1-2' , 'Elena Eifrig' , 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:100000000000000000000000000000000005', 'WBI:100000000000000000000000000000000008', 'user-2-1' , 'Simone Müller' , 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:100000000000000000000000000000000006', 'WBI:100000000000000000000000000000000009', 'user-2-2' , 'Tim Schläfrig' , 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:B00000000000000000000000000000000014', 'WBI:100000000000000000000000000000000014', 'user-b-1' , 'Bernd Bern' , 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:B00000000000000000000000000000000015', 'WBI:100000000000000000000000000000000015', 'user-b-2' , 'Brundhilde Bio' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
-- group internal access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'WBI:100000000000000000000000000000000004', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'WBI:100000000000000000000000000000000005', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'WBI:100000000000000000000000000000000009', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'WBI:100000000000000000000000000000000004', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'WBI:100000000000000000000000000000000005', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'WBI:100000000000000000000000000000000009', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
-- teamlead substitution
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'WBI:100000000000000000000000000000000004', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'WBI:100000000000000000000000000000000005', 'teamlead-1' , 'Titus Toll' , true , true , true , false , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'WBI:100000000000000000000000000000000004', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'WBI:100000000000000000000000000000000005', 'teamlead-1' , 'Titus Toll' , true , true , true , false , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
-- cross team tranfers
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , false, false , false , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000018', 'WBI:100000000000000000000000000000000009', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'WBI:100000000000000000000000000000000006', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000007', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'WBI:100000000000000000000000000000000008', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', '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', 'KSC 1' , true , false, true , false , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
-- 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', 'KSC 1' , 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', 'KSC 2' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000019', 'WBI:100000000000000000000000000000000002', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', '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', 'KSC 2' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
-- Cross team GPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'WBI:100000000000000000000000000000000001', 'teamlead-1' , 'Titus Toll' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000022', 'WBI:100000000000000000000000000000000001', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'WBI:100000000000000000000000000000000001', '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:100000000000000000000000000000000022', 'WBI:100000000000000000000000000000000001', 'teamlead-2' , 'Frauke Faul' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
-- TPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000123', 'WBI:100000000000000000000000000000000010', 'teamlead-1' , 'Titus Toll' , true , false, false , false , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000123', 'WBI:100000000000000000000000000000000010', 'teamlead-1' , 'Titus Toll' , true , false, false , false , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
-- Access to other domains
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'WBI:100000000000000000000000000000000012', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 1' , true , false, true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000024', 'WBI:100000000000000000000000000000000013', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , false, true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000025', 'WBI:100000000000000000000000000000000014', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000026', 'WBI:100000000000000000000000000000000015', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'WBI:100000000000000000000000000000000012', 'cn=organisationseinheit ksc 1,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 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:100000000000000000000000000000000024', 'WBI:100000000000000000000000000000000013', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , 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:100000000000000000000000000000000025', 'WBI:100000000000000000000000000000000014', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000026', 'WBI:100000000000000000000000000000000015', 'cn=organisationseinheit ksc 2,cn=organisationseinheit ksc,cn=organisation,ou=test,o=taskana', 'KSC 2' , true , true , true , true , false , false, false, false, false, false, false, false, false, false, false, false, false, true , true);
-- Access to workbaskets for sorting test
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000900', 'WBI:000000000000000000000000000000000900', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000901', 'WBI:000000000000000000000000000000000901', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000902', 'WBI:000000000000000000000000000000000902', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000903', 'WBI:000000000000000000000000000000000903', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000904', 'WBI:000000000000000000000000000000000904', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000905', 'WBI:000000000000000000000000000000000905', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000906', 'WBI:000000000000000000000000000000000906', 'user-b-1' , 'Bern, Bernd' , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true , true);
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);
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);
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);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WBI:000000000000000000000000000000000900', 'WBI:000000000000000000000000000000000900', '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:000000000000000000000000000000000901', 'WBI:000000000000000000000000000000000901', '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:000000000000000000000000000000000902', 'WBI:000000000000000000000000000000000902', '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:000000000000000000000000000000000903', 'WBI:000000000000000000000000000000000903', '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:000000000000000000000000000000000904', 'WBI:000000000000000000000000000000000904', '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:000000000000000000000000000000000905', 'WBI:000000000000000000000000000000000905', '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:000000000000000000000000000000000906', 'WBI:000000000000000000000000000000000906', '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: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);

View File

@ -1,34 +1,34 @@
-- test-data is used for all tests except for the rest tests
-- KSC workbaskets
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2 , ORG_LEVEL_3 , ORG_LEVEL_4, MARKED_FOR_DELETION );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC' , 'teamlead-1' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 1' , 'user-1-2' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung' , 'projekt' , 'team' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A', 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2 , ORG_LEVEL_3 , ORG_LEVEL_4, MARKED_FOR_DELETION , CUSTOM_5 , CUSTOM_6 , CUSTOM_7 , CUSTOM_8 );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC' , 'teamlead-1' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false , 'XYZ123' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , 'ABCABC' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false , '' , '' , '' , 'cust8z' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 1' , 'user-1-2' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung' , 'projekt' , 'team' , false , 'custom5', 'custom6', 'custom7', 'custom8' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A', 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
-- KSC workbaskets Domain_B
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_B_KSC' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'user-1-2' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000016', 'MASSNAHMEN' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'TPK Maßnahmen' , 'DOMAIN_B', 'TOPIC' , 'TPK Maßnahmen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_B_KSC' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false , 'abc123' , '' , 'TSK123' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'user-1-2' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false , '' , 'cust6' , 'cust7' , 'cust8' );
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000016', 'MASSNAHMEN' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'TPK Maßnahmen' , 'DOMAIN_B', 'TOPIC' , 'TPK Maßnahmen' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
-- Workbaskets for sorting test
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false , '' , '' , '' , '' );

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-common-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
</parent>
<dependencies>
@ -32,7 +32,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.org.lidalia</groupId>
<groupId>com.github.valfirst</groupId>
<artifactId>slf4j-test</artifactId>
<version>${version.slf4j-test}</version>
<scope>test</scope>
@ -40,11 +40,12 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -2,6 +2,9 @@ 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;
@ -9,12 +12,9 @@ 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 {

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-common-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
</parent>
<properties>

View File

@ -49,7 +49,9 @@ public class CurrentUserContextImpl implements CurrentUserContext {
}
@Override
@SuppressWarnings("removal")
public List<String> getGroupIds() {
// TODO replace with Subject.current() when migrating to newer Version than 17
Subject subject = Subject.getSubject(AccessController.getContext());
LOGGER.trace("Subject of caller: {}", subject);
if (subject != null) {
@ -125,7 +127,9 @@ public class CurrentUserContextImpl implements CurrentUserContext {
return null;
}
@SuppressWarnings("removal")
private String getUserIdFromJaasSubject() {
// TODO replace with Subject.current() when migrating to newer Version than 17
Subject subject = Subject.getSubject(AccessController.getContext());
LOGGER.trace("Subject of caller: {}", subject);
if (subject != null) {

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-common-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -52,9 +52,9 @@
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${version.javax.servlet}</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${version.jakarta.servlet}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@ -150,6 +150,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-common-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
</parent>
<dependencies>
@ -54,6 +54,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -36,7 +36,7 @@ public interface PropertyParser<T> {
new SimpleParser<>(String.class, Function.identity()),
new SimpleParser<>(ZoneId.class, ZoneId::of))
.collect(
Collectors.toUnmodifiableMap(PropertyParser::getTargetClass, Function.identity()));
Collectors.toUnmodifiableMap(PropertyParser::getTargetClass, t -> t));
static PropertyParser<?> getPropertyParser(Class<?> forClass) {
forClass = ReflectionUtil.wrap(forClass);

View File

@ -40,7 +40,8 @@ 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())) {
if (!oldObject.getClass().equals(newObject.getClass())
&& !oldObject.getClass().isAssignableFrom(newObject.getClass())) {
throw new SystemException(
String.format(
"The classes differ between the oldObject(%s) and newObject(%s). "

View File

@ -24,7 +24,7 @@ public class SqlProviderUtil {
.append("</when>")
.append("<otherwise>0=1</otherwise>")
.append("</choose>");
if (column.matches("t.CUSTOM_\\d+")) {
if (column.matches("t.CUSTOM_\\d+") || column.matches("t.OWNER")) {
sb.append("<if test='" + collection + "ContainsNull'> OR " + column + " IS NULL </if>");
}
return sb.append(")</if> ");

View File

@ -0,0 +1,118 @@
package pro.taskana.common.internal.workingtime;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.stream.LongStream;
import pro.taskana.common.api.WorkingTimeCalculator;
import pro.taskana.common.api.exceptions.InvalidArgumentException;
import pro.taskana.common.api.exceptions.SystemException;
public class WorkingDayCalculatorImpl implements WorkingTimeCalculator {
private final ZoneId zoneId;
private final HolidaySchedule holidaySchedule;
public WorkingDayCalculatorImpl(HolidaySchedule holidaySchedule, ZoneId zoneId) {
this.holidaySchedule = holidaySchedule;
this.zoneId = zoneId;
}
@Override
public Instant subtractWorkingTime(Instant workStart, Duration workingTime)
throws InvalidArgumentException {
long days = convertWorkingDaysToDays(workStart, -workingTime.toDays(), ZeroDirection.SUB_DAYS);
return workStart.plus(Duration.ofDays(days));
}
@Override
public Instant addWorkingTime(Instant workStart, Duration workingTime)
throws InvalidArgumentException {
long days = convertWorkingDaysToDays(workStart, workingTime.toDays(), ZeroDirection.ADD_DAYS);
return workStart.plus(Duration.ofDays(days));
}
@Override
public Duration workingTimeBetween(Instant first, Instant second)
throws InvalidArgumentException {
long days = Duration.between(first, second).abs().toDays();
Instant firstInstant = first.isBefore(second) ? first : second;
long workingDaysBetween =
LongStream.range(1, days)
.mapToObj(day -> isWorkingDay(firstInstant.plus(day, ChronoUnit.DAYS)))
.filter(t -> t)
.count();
return Duration.ofDays(workingDaysBetween);
}
@Override
public boolean isWorkingDay(Instant instant) {
return !isWeekend(instant) && !isHoliday(instant);
}
@Override
public boolean isWeekend(Instant instant) {
DayOfWeek dayOfWeek = toDayOfWeek(instant);
return dayOfWeek == DayOfWeek.SATURDAY || dayOfWeek == DayOfWeek.SUNDAY;
}
@Override
public boolean isHoliday(Instant instant) {
return holidaySchedule.isHoliday(toLocalDate(instant));
}
@Override
public boolean isGermanHoliday(Instant instant) {
return holidaySchedule.isGermanHoliday(toLocalDate(instant));
}
private long convertWorkingDaysToDays(
final Instant startTime, long numberOfDays, ZeroDirection zeroDirection) {
if (startTime == null) {
throw new SystemException(
"Internal Error: convertWorkingDaysToDays was called with a null startTime");
}
int direction = calculateDirection(numberOfDays, zeroDirection);
long limit = Math.abs(numberOfDays);
return LongStream.iterate(0, i -> i + direction)
.filter(day -> isWorkingDay(startTime.plus(day, ChronoUnit.DAYS)))
.skip(limit)
.findFirst()
.orElse(0);
}
private int calculateDirection(long numberOfDays, ZeroDirection zeroDirection) {
if (numberOfDays == 0) {
return zeroDirection.getDirection();
} else {
return numberOfDays >= 0 ? 1 : -1;
}
}
private LocalDate toLocalDate(Instant instant) {
return LocalDate.ofInstant(instant, zoneId);
}
private DayOfWeek toDayOfWeek(Instant instant) {
return toLocalDate(instant).getDayOfWeek();
}
private enum ZeroDirection {
SUB_DAYS(-1),
ADD_DAYS(1);
private final int direction;
ZeroDirection(int direction) {
this.direction = direction;
}
public int getDirection() {
return direction;
}
}
}

View File

@ -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, '5.10.0', CURRENT_TIMESTAMP);
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE CLASSIFICATION
(
@ -66,6 +66,10 @@ CREATE TABLE WORKBASKET
ORG_LEVEL_3 VARCHAR(255) NULL,
ORG_LEVEL_4 VARCHAR(255) NULL,
MARKED_FOR_DELETION SMALLINT NOT NULL,
CUSTOM_5 VARCHAR(255) NULL,
CUSTOM_6 VARCHAR(255) NULL,
CUSTOM_7 VARCHAR(255) NULL,
CUSTOM_8 VARCHAR(255) NULL,
PRIMARY KEY (ID),
CONSTRAINT WB_KEY_DOMAIN UNIQUE (KEY, DOMAIN)
);
@ -167,6 +171,8 @@ CREATE TABLE WORKBASKET_ACCESS_LIST
PERM_CUSTOM_10 SMALLINT NOT NULL,
PERM_CUSTOM_11 SMALLINT NOT NULL,
PERM_CUSTOM_12 SMALLINT NOT NULL,
PERM_READTASKS SMALLINT NOT NULL,
PERM_EDITTASKS SMALLINT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT UC_ACCESSID_WBID UNIQUE (ACCESS_ID, WORKBASKET_ID),
CONSTRAINT ACCESS_LIST_WB FOREIGN KEY (WORKBASKET_ID) REFERENCES WORKBASKET ON DELETE CASCADE
@ -355,6 +361,13 @@ CREATE TABLE GROUP_INFO
PRIMARY KEY (USER_ID, GROUP_ID)
);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NUll,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
CREATE SEQUENCE SCHEDULED_JOB_SEQ
MINVALUE 1
START WITH 1
@ -446,4 +459,8 @@ COMMIT WORK ;
CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE
(VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC)
ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS;
COMMIT WORK ;
CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT
(TASK_ID ASC)
ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS;
COMMIT WORK ;

View File

@ -0,0 +1,19 @@
-- this script updates the TASKANA database schema from version 5.10.0 to version 6.2.0.
SET SCHEMA %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP);
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_READTASKS SMALLINT NOT NULL DEFAULT 0;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER COLUMN PERM_READTASKS DROP DEFAULT;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL DEFAULT 0;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER COLUMN PERM_EDITTASKS DROP DEFAULT;

View File

@ -0,0 +1,23 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 7.0.0.
SET SCHEMA %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
ALTER TABLE WORKBASKET
ADD COLUMN CUSTOM_5 VARCHAR(255) NULL
ADD COLUMN CUSTOM_6 VARCHAR(255) NULL
ADD COLUMN CUSTOM_7 VARCHAR(255) NULL
ADD COLUMN CUSTOM_8 VARCHAR(255) NULL;
CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT
(TASK_ID ASC)
ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS;
COMMIT WORK ;

View File

@ -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'), '5.10.0', CURRENT_TIMESTAMP);
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE CLASSIFICATION
(
@ -73,6 +73,10 @@ CREATE TABLE WORKBASKET
ORG_LEVEL_3 VARCHAR(255) NULL,
ORG_LEVEL_4 VARCHAR(255) NULL,
MARKED_FOR_DELETION SMALLINT NOT NULL,
CUSTOM_5 VARCHAR(255) NULL,
CUSTOM_6 VARCHAR(255) NULL,
CUSTOM_7 VARCHAR(255) NULL,
CUSTOM_8 VARCHAR(255) NULL,
PRIMARY KEY (ID),
CONSTRAINT WB_KEY_DOMAIN UNIQUE (KEY, DOMAIN)
);
@ -174,6 +178,8 @@ CREATE TABLE WORKBASKET_ACCESS_LIST
PERM_CUSTOM_10 SMALLINT NOT NULL,
PERM_CUSTOM_11 SMALLINT NOT NULL,
PERM_CUSTOM_12 SMALLINT NOT NULL,
PERM_READTASKS SMALLINT NOT NULL,
PERM_EDITTASKS SMALLINT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT UC_ACCESSID_WBID UNIQUE (ACCESS_ID, WORKBASKET_ID),
CONSTRAINT ACCESS_LIST_WB FOREIGN KEY (WORKBASKET_ID) REFERENCES WORKBASKET ON DELETE CASCADE
@ -361,6 +367,13 @@ CREATE TABLE GROUP_INFO
PRIMARY KEY (USER_ID, GROUP_ID)
);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
CREATE SEQUENCE SCHEDULED_JOB_SEQ
MINVALUE 1
START WITH 1
@ -445,4 +458,4 @@ CREATE INDEX IDX_OBJECT_REFERE_FK_TASK_ID ON OBJECT_REFERENCE
COMMIT WORK ;
CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE
(VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC);
COMMIT WORK ;
COMMIT WORK ;

View File

@ -0,0 +1,19 @@
-- this script updates the TASKANA database schema from version 5.10.0 to version 6.2.0.
SET SCHEMA %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.2.0', CURRENT_TIMESTAMP);
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_READTASKS SMALLINT NOT NULL DEFAULT 0;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER COLUMN PERM_READTASKS DROP DEFAULT;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_EDITTASKS SMALLINT NOT NULL DEFAULT 0;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER COLUMN PERM_EDITTASKS DROP DEFAULT;

View File

@ -0,0 +1,19 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 7.0.0.
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
ALTER TABLE WORKBASKET
ADD (
`CUSTOM_5` VARCHAR(255) NULL,
`CUSTOM_6` VARCHAR(255) NULL,
`CUSTOM_7` VARCHAR(255) NULL,
`CUSTOM_8` VARCHAR(255) NULL
) AFTER `MARKED_FOR_DELETION`;

View File

@ -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, '5.10.0', CURRENT_TIMESTAMP);
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE CLASSIFICATION
(
@ -65,6 +65,10 @@ CREATE TABLE WORKBASKET
ORG_LEVEL_3 VARCHAR2(255) NULL,
ORG_LEVEL_4 VARCHAR2(255) NULL,
MARKED_FOR_DELETION NUMBER(1) NOT NULL CHECK (MARKED_FOR_DELETION IN (0,1)),
CUSTOM_5 VARCHAR2(255) NULL,
CUSTOM_6 VARCHAR2(255) NULL,
CUSTOM_7 VARCHAR2(255) NULL,
CUSTOM_8 VARCHAR2(255) NULL,
CONSTRAINT WORKBASKET_PKEY PRIMARY KEY (ID),
CONSTRAINT WB_KEY_DOMAIN UNIQUE (KEY, DOMAIN)
);
@ -166,6 +170,8 @@ CREATE TABLE WORKBASKET_ACCESS_LIST
PERM_CUSTOM_10 NUMBER(1) NOT NULL CHECK (PERM_CUSTOM_10 IN (0,1)),
PERM_CUSTOM_11 NUMBER(1) NOT NULL CHECK (PERM_CUSTOM_11 IN (0,1)),
PERM_CUSTOM_12 NUMBER(1) NOT NULL CHECK (PERM_CUSTOM_12 IN (0,1)),
PERM_READTASKS NUMBER(1) NOT NULL CHECK (PERM_READTASKS IN (0,1)),
PERM_EDITTASKS NUMBER(1) NOT NULL CHECK (PERM_EDITTASKS IN (0,1)),
CONSTRAINT WORKBASKET_ACCESS_LIST_PKEY PRIMARY KEY (ID),
CONSTRAINT UC_ACCESSID_WBID UNIQUE (ACCESS_ID, WORKBASKET_ID),
CONSTRAINT ACCESS_LIST_WB FOREIGN KEY (WORKBASKET_ID) REFERENCES WORKBASKET(ID) ON DELETE CASCADE
@ -354,6 +360,13 @@ CREATE TABLE GROUP_INFO
CONSTRAINT GROUP_INFO_PKEY PRIMARY KEY (USER_ID, GROUP_ID)
);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR2(32) NOT NULL,
PERMISSION_ID VARCHAR2(256) NOT NULL,
CONSTRAINT PERMISSION_INFO_PKEY PRIMARY KEY (USER_ID, PERMISSION_ID)
);
CREATE SEQUENCE SCHEDULED_JOB_SEQ
START WITH 1
INCREMENT BY 1
@ -444,4 +457,7 @@ CREATE INDEX IDX_OBJECT_REFERE_FK_TASK_ID ON OBJECT_REFERENCE
COMMIT WORK ;
CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE
(VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC);
COMMIT WORK ;
CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT
(TASK_ID ASC);
COMMIT WORK ;

View File

@ -0,0 +1,20 @@
-- this script updates the TASKANA database schema from version 5.10.0 to version 6.2.0.
ALTER
SESSION SET CURRENT_SCHEMA = %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (TASKANA_SCHEMA_VERSION_ID_SEQ.NEXTVAL, '6.2.0', CURRENT_TIMESTAMP);
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD PERM_READTASKS NUMBER(1) DEFAULT 0 NOT NULL CHECK (PERM_READTASKS IN (0,1));
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER PERM_READTASKS DROP DEFAULT;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD PERM_EDITTASKS NUMBER(1) DEFAULT 0 NOT NULL CHECK (PERM_EDITTASKS IN (0,1));
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER PERM_EDITTASKS DROP DEFAULT

View File

@ -0,0 +1,24 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 7.0.0.
ALTER SESSION SET CURRENT_SCHEMA = %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR2(32) NOT NULL,
PERMISSION_ID VARCHAR2(256) NOT NULL,
CONSTRAINT PERMISSION_INFO_PKEY PRIMARY KEY (USER_ID, PERMISSION_ID)
);
ALTER TABLE WORKBASKET
ADD (
CUSTOM_5 VARCHAR(255) NULL,
CUSTOM_6 VARCHAR(255) NULL,
CUSTOM_7 VARCHAR(255) NULL,
CUSTOM_8 VARCHAR(255) NULL
);
CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT
(TASK_ID ASC);
COMMIT WORK ;

View File

@ -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'), '5.10.0', CURRENT_TIMESTAMP);
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE CLASSIFICATION
(
@ -69,6 +69,10 @@ CREATE TABLE WORKBASKET
ORG_LEVEL_3 VARCHAR(255) NULL,
ORG_LEVEL_4 VARCHAR(255) NULL,
MARKED_FOR_DELETION BOOLEAN NOT NULL,
CUSTOM_5 VARCHAR(255) NULL,
CUSTOM_6 VARCHAR(255) NULL,
CUSTOM_7 VARCHAR(255) NULL,
CUSTOM_8 VARCHAR(255) NULL,
PRIMARY KEY (ID),
CONSTRAINT WB_KEY_DOMAIN UNIQUE (KEY, DOMAIN)
);
@ -170,6 +174,8 @@ CREATE TABLE WORKBASKET_ACCESS_LIST
PERM_CUSTOM_10 BOOLEAN NOT NULL,
PERM_CUSTOM_11 BOOLEAN NOT NULL,
PERM_CUSTOM_12 BOOLEAN NOT NULL,
PERM_READTASKS BOOLEAN NOT NULL,
PERM_EDITTASKS BOOLEAN NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT UC_ACCESSID_WBID UNIQUE (ACCESS_ID, WORKBASKET_ID),
CONSTRAINT ACCESS_LIST_WB FOREIGN KEY (WORKBASKET_ID) REFERENCES WORKBASKET ON DELETE CASCADE
@ -358,6 +364,13 @@ CREATE TABLE GROUP_INFO
PRIMARY KEY (USER_ID, GROUP_ID)
);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
CREATE SEQUENCE SCHEDULED_JOB_SEQ
MINVALUE 1
START WITH 1
@ -441,4 +454,7 @@ CREATE INDEX IDX_OBJECT_REFERE_FK_TASK_ID ON OBJECT_REFERENCE
COMMIT WORK ;
CREATE INDEX IDX_OBJECT_REFERE_ACCESS_LIST ON OBJECT_REFERENCE
(VALUE ASC, TYPE ASC, SYSTEM_INSTANCE ASC, SYSTEM ASC, COMPANY ASC, ID ASC);
COMMIT WORK ;
COMMIT WORK ;
CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT
(TASK_ID ASC);
COMMIT WORK ;

View File

@ -0,0 +1,20 @@
-- this script updates the TASKANA database schema from version 5.10.0 to version 6.2.0.
SET
search_path = %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.2.0', CURRENT_TIMESTAMP);
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_READTASKS BOOLEAN NOT NULL DEFAULT FALSE;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_READTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER COLUMN PERM_READTASKS DROP DEFAULT;
ALTER TABLE WORKBASKET_ACCESS_LIST
ADD COLUMN PERM_EDITTASKS BOOLEAN NOT NULL DEFAULT FALSE;
UPDATE WORKBASKET_ACCESS_LIST
SET PERM_EDITTASKS=PERM_READ;
ALTER TABLE WORKBASKET_ACCESS_LIST
ALTER COLUMN PERM_EDITTASKS DROP DEFAULT;

View File

@ -0,0 +1,23 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 7.0.0.
SET search_path = %schemaName%;
INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '7.0.0', CURRENT_TIMESTAMP);
CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
ALTER TABLE WORKBASKET
ADD COLUMN CUSTOM_5 VARCHAR(255) NULL,
ADD COLUMN CUSTOM_6 VARCHAR(255) NULL,
ADD COLUMN CUSTOM_7 VARCHAR(255) NULL,
ADD COLUMN CUSTOM_8 VARCHAR(255) NULL;
CREATE INDEX IDX_TASK_ID_HISTORY_EVENT ON TASK_HISTORY_EVENT
(TASK_ID ASC);
COMMIT WORK ;

View File

@ -12,7 +12,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana.history</groupId>
<artifactId>taskana-history-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -41,7 +41,7 @@
<!-- test dependencies -->
<dependency>
<groupId>uk.org.lidalia</groupId>
<groupId>com.github.valfirst</groupId>
<artifactId>slf4j-test</artifactId>
<version>${version.slf4j-test}</version>
<scope>test</scope>
@ -49,6 +49,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -58,7 +59,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -4,6 +4,8 @@ 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;
@ -17,8 +19,6 @@ 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 {

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana.history</groupId>
<artifactId>taskana-history-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -66,7 +66,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@ -91,7 +91,12 @@
<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>

View File

@ -14,6 +14,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.TaskanaConfiguration;
import pro.taskana.common.api.ScheduledJob;
import pro.taskana.common.api.TaskanaEngine;
import pro.taskana.common.api.TimeInterval;
@ -52,6 +53,10 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
super(taskanaEngine, txProvider, scheduledJob, true);
}
public static Duration getLockExpirationPeriod(TaskanaConfiguration taskanaConfiguration) {
return taskanaConfiguration.getSimpleHistoryCleanupJobLockExpirationPeriod();
}
@Override
public void execute() {
Instant createdBefore = Instant.now().minus(minimumAge);

View File

@ -0,0 +1,121 @@
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;
@WithServiceProvider(
serviceProviderInterface = TaskanaHistory.class,
serviceProviders = SimpleHistoryServiceImpl.class)
@TaskanaIntegrationTest
@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 {
historyService = new SimpleHistoryServiceImpl();
historyService.initialize(taskanaEngine);
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);
}
@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());
}
}

View File

@ -15,6 +15,7 @@ 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)
@ -47,7 +48,8 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
listEvents =
taskHistoryQueryMapper.queryHistoryEvents(
(TaskHistoryQueryImpl) historyService.createTaskHistoryQuery().taskIdIn(taskid));
assertThat(listEvents).isEmpty();
assertThat(listEvents).hasSize(1);
assertThat(listEvents.get(0).getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
}
@Test
@ -87,7 +89,9 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
taskHistoryQueryMapper.queryHistoryEvents(
(TaskHistoryQueryImpl)
historyService.createTaskHistoryQuery().taskIdIn(taskId_1, taskId_2));
assertThat(listEvents).isEmpty();
assertThat(listEvents).hasSize(2);
assertThat(listEvents.get(0).getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
assertThat(listEvents.get(1).getEventType()).isEqualTo(TaskHistoryEventType.DELETED.getName());
}
@Test
@ -119,7 +123,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
listEvents =
taskHistoryQueryMapper.queryHistoryEvents(
(TaskHistoryQueryImpl) historyService.createTaskHistoryQuery().taskIdIn(taskId));
assertThat(listEvents).hasSize(2);
assertThat(listEvents).hasSize(3);
}
@Test
@ -152,7 +156,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
taskHistoryQueryMapper.queryHistoryEvents(
(TaskHistoryQueryImpl)
historyService.createTaskHistoryQuery().taskIdIn(taskId_1, taskId_2));
assertThat(listEvents).hasSize(2);
assertThat(listEvents).hasSize(4);
}
private void createTaskanaEngineWithNewConfig(boolean deleteHistoryOnTaskDeletionEnabled)

View File

@ -29,11 +29,11 @@ taskana.workingTime.timezone=UTC
# enable or disable the jobscheduler at all
# set it to false and no jobs are running
taskana.jobs.scheduler.enabled=false
# wait time before the first job run in millis
# wait time before the first job run
taskana.jobs.scheduler.initialStartDelay=100
# sleeping time befor the next job runs
taskana.jobs.scheduler.period=12
# timeunit for the sleeping period
# 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

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana.history</groupId>
<artifactId>taskana-history-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -44,13 +44,13 @@
<artifactId>spring-hateoas</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@ -78,6 +78,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -103,7 +104,7 @@
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>${version.spring.core}</version>
<version>${version.spring.plugin.core}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -192,11 +193,7 @@
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
<docletArtifact>
<groupId>capital.scalable</groupId>
<!--
currently the jdk9+ version of this doclet has a very bad bug.
see: https://github.com/ScaCap/spring-auto-restdocs/issues/412
-->
<artifactId>spring-auto-restdocs-json-doclet</artifactId>
<artifactId>spring-auto-restdocs-json-doclet-jdk9</artifactId>
<version>${version.auto-restdocs}</version>
</docletArtifact>
<destDir>generated-javadoc-json</destDir>

View File

@ -1,10 +1,10 @@
package pro.taskana.simplehistory.rest;
import jakarta.servlet.http.HttpServletRequest;
import java.beans.ConstructorProperties;
import java.sql.SQLException;
import java.util.List;
import java.util.function.BiConsumer;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.MediaTypes;
import org.springframework.hateoas.config.EnableHypermediaSupport;

View File

@ -26,6 +26,7 @@ taskana.ldap.userOrglevel3Attribute=someDepartement
taskana.ldap.userOrglevel4Attribute=orgLevel4
taskana.ldap.userIdAttribute=uid
taskana.ldap.userMemberOfGroupAttribute=memberOf
taskana.ldap.userPermissionsAttribute=permission
taskana.ldap.groupSearchBase=cn=groups
taskana.ldap.groupSearchFilterName=objectclass
taskana.ldap.groupSearchFilterValue=groupOfUniqueNames

View File

@ -12,7 +12,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -11,7 +11,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -19,16 +19,29 @@
<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>
</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>pro.taskana</groupId>
<artifactId>taskana-common-logging</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${version.javaee-api}</version>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${version.jakartaee-api}</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -36,5 +49,171 @@
<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>

View File

@ -1,57 +1,77 @@
package pro.taskana.example;
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 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 pro.taskana.task.api.models.Task;
import pro.taskana.task.internal.models.ObjectReferenceImpl;
import pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException;
import pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException;
import pro.taskana.workbasket.api.WorkbasketType;
import pro.taskana.workbasket.api.models.Workbasket;
/** Example Bootstrap Application. */
@ApplicationScoped
public class ExampleBootstrap {
@EJB private TaskanaEjb taskanaEjb;
private static final Logger LOGGER = LoggerFactory.getLogger(ExampleBootstrap.class);
@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(null);
task.setPrimaryObjRef(objRef);
task = taskanaEjb.getTaskService().createTask(task);
System.out.println("---------------------------> Task started: " + task.getId());
taskanaEjb.getTaskService().claim(task.getId());
System.out.println(
"---------------------------> Task claimed: "
+ taskanaEjb.getTaskService().getTask(task.getId()).getOwner());
taskanaEjb.getTaskService().completeTask(task.getId());
System.out.println("---------------------------> Task completed");
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);
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.setPrimaryObjRef(objRef);
task = taskanaEjb.getTaskService().createTask(task);
LOGGER.info("---------------------------> Task started: {}", task.getId());
taskanaEjb.getTaskService().claim(task.getId());
LOGGER.info(
"---------------------------> Task claimed: {}",
taskanaEjb.getTaskService().getTask(task.getId()).getOwner());
taskanaEjb.getTaskService().completeTask(task.getId());
LOGGER.info("---------------------------> Task completed");
} catch (TaskanaException e) {
throw new ExampleStartupException(e);
}
}
}

View File

@ -0,0 +1,8 @@
package pro.taskana.example;
public class ExampleStartupException extends RuntimeException {
public ExampleStartupException(Throwable cause) {
super("Can't bootstrap CDI example application", cause);
}
}

View File

@ -1,16 +1,46 @@
package pro.taskana.example;
import javax.ejb.Stateless;
import javax.inject.Inject;
import jakarta.ejb.Stateless;
import jakarta.inject.Inject;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.task.api.TaskService;
import pro.taskana.workbasket.api.WorkbasketService;
/** example Taskana EJB. */
@Stateless
public class TaskanaEjb {
@Inject private TaskService taskService;
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;
}
public TaskService getTaskService() {
return taskService;
}
public ClassificationService getClassificationService() {
return classificationService;
}
public WorkbasketService getWorkbasketService() {
return workbasketService;
}
}

View File

@ -0,0 +1,3 @@
<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>

View File

@ -1 +1,19 @@
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

View File

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Class-Path:

View File

@ -1,6 +0,0 @@
<?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>

View File

@ -1,4 +0,0 @@
<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>

View File

@ -0,0 +1,111 @@
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.deleteDirectory(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",
"");
}
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;
}
}

View File

@ -0,0 +1,19 @@
<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-27.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>

View File

@ -0,0 +1,673 @@
<?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.microprofile.opentracing-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="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>
<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"/>
<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.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</user-name>
<password></password>
</security>
</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</user-name>
<password></password>
</security>
</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:3.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"
use-transaction-setup-provider="true"/>
</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:16.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="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"/>
<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.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-set>
</permission-sets>
<http>
<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>
<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>
<provider-http-server-mechanism-factory name="global"/>
</http>
<sasl>
<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>
<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"/>
<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>
</subsystem>
<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">
<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="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>
<cache-container name="server" default-cache="default" marshaller="PROTOSTREAM"
modules="org.wildfly.clustering.singleton.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"/>
<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>
</subsystem>
<subsystem xmlns="urn:jboss:domain:io:3.0">
<worker name="default"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:2.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:14.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: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:5.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:6.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:13.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}}">
<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>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<module name="com.h2database.h2" xmlns="urn:jboss:module:1.9">
<resources>
<resource-root path="h2-2.1.214.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>

168
lib/taskana-cdi/README.md Normal file
View File

@ -0,0 +1,168 @@
# taskana-cdi
this module is for EJB deployments.
## Testing procedure
1. deploy wildfly server locally
2. replace h2 with latest version
3. start wildfly
4. deploy ear
5. test application
### deploy wildfly server locally
we extract the wildfly server into the target directory via maven configuration
```xml
<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>
.
.
.
</executions>
</plugin>
```
### 2. replace h2 with latest version
for our tests we need the latest h2 version, so we need to replace the h2 jar in wildfly.
this happens in 2 steps.
first extract the dependency into the correct directory
```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${version.maven.dependency}</version>
<executions>
.
.
.
<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>
```
second step is to copy the `src/test/resources/module.xml` to required directory
```xml
<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>
</executions>
</plugin>
```
### 3. start wildfly
starting and stopping wildfly happens with [arquillian](https://arquillian.org/)
```java
@RunWith(Arquillian.class)
public class TaskanaProducersTest {}
```
the file `src/test/resources/arquillian.xml` contains additional server start settings. change vm settings here for remote debugging.
the file `src/test/resources/int-test-standalone.xml` conatins the wildfly server config. Here are the datasources configured, for example.
### 4. deploy ear
create the ear deployment happens inside the testcase
```java
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
EnterpriseArchive deployment = ShrinkWrap.create(EnterpriseArchive.class, "taskana.ear");
File[] libs =
Maven.resolver()
.loadPomFromFile("pom.xml")
.importRuntimeAndTestDependencies()
.resolve()
.withTransitivity()
.asFile();
deployment.addAsLibraries(libs);
JavaArchive ejbModule = ShrinkWrap.create(JavaArchive.class, "taskana.jar");
ejbModule.addClasses(TaskanaProducers.class, TaskanaEjb.class);
ejbModule.addAsResource("taskana.properties");
deployment.addAsModule(ejbModule);
WebArchive webArchive =
ShrinkWrap.create(WebArchive.class, "taskana.war")
.addClasses(TaskanaCdiTestRestController.class, RestApplication.class)
.addAsWebInfResource("beans.xml")
.addAsWebInfResource("int-test-jboss-web.xml", "jboss-web.xml");
deployment.addAsModule(webArchive);
deployment.addAsManifestResource("beans.xml");
return deployment;
}
```

View File

@ -10,26 +10,40 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-ee</artifactId>
<version>${version.wildfly}</version>
<scope>import</scope>
<type>pom</type>
</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>pro.taskana</groupId>
<artifactId>taskana-common-logging</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<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>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${version.jakartaee-api}</version>
<scope>provided</scope>
</dependency>
<!-- TEST dependencies -->
<dependency>
@ -45,6 +59,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -58,15 +73,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>jaxrs</artifactId>
<version>${version.thorntail}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>cdi</artifactId>
<version>${version.thorntail}</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@ -75,15 +83,24 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>arquillian</artifactId>
<version>${version.thorntail}</version>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>${version.arquillian}</version>
<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>
@ -91,14 +108,93 @@
<build>
<plugins>
<plugin>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.thorntail}</version>
<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>package</goal>
<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>
@ -108,7 +204,7 @@
<repositories>
<repository>
<id>jboss</id>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
</repositories>
</project>

View File

@ -0,0 +1,8 @@
package pro.taskana.common.internal;
public class TaskanaCdiStartupException extends RuntimeException {
public TaskanaCdiStartupException(Throwable cause) {
super("Can't init TaskanaProducers", cause);
}
}

View File

@ -1,15 +1,17 @@
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;
@ -30,10 +32,31 @@ public class TaskanaProducers {
private static final String TASKANA_PROPERTIES = "taskana.properties";
@Inject private TaskanaEngine taskanaEngine;
// initalized during post construct
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
@ -57,7 +80,7 @@ public class TaskanaProducers {
.initTaskanaProperties()
.build();
} catch (NamingException | SQLException | IOException e) {
LOGGER.error("Could not start Taskana: ", e);
throw new TaskanaCdiStartupException(e);
}
}

View File

@ -1,7 +1,3 @@
<?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">
</beans>
<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>

View File

@ -1,7 +1,7 @@
package pro.taskana;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
@ApplicationPath("/rest")
public class RestApplication extends Application {}

View File

@ -1,13 +1,12 @@
package pro.taskana;
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 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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.classification.api.ClassificationService;
@ -24,9 +23,21 @@ public class TaskanaCdiTestRestController {
private static final String CDIDOMAIN = "CDIDOMAIN";
private static final String CLASSIFICATION_TYPE = "T1";
@EJB private TaskanaEjb taskanaEjb;
private final TaskanaEjb taskanaEjb;
@Inject private ClassificationService classificationService;
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;
}
@GET
public Response startTask() throws Exception {

View File

@ -1,7 +1,7 @@
package pro.taskana;
import javax.ejb.Stateless;
import javax.inject.Inject;
import jakarta.ejb.Stateless;
import jakarta.inject.Inject;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.models.Task;
@ -11,11 +11,27 @@ import pro.taskana.workbasket.api.WorkbasketService;
@Stateless
public class TaskanaEjb {
@Inject private TaskService taskService;
private final TaskService taskService;
@Inject private ClassificationService classificationService;
private final ClassificationService classificationService;
@Inject private WorkbasketService workbasketService;
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;
}
public TaskService getTaskService() {
return taskService;

View File

@ -2,6 +2,7 @@ package pro.taskana.common.internal;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
@ -19,15 +20,21 @@ 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.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.swarm.undertow.WARArchive;
import pro.taskana.RestApplication;
import pro.taskana.TaskanaCdiTestRestController;
import pro.taskana.TaskanaEjb;
@RunWith(Arquillian.class)
public class TaskanaProducersTest {
private static final String REST_TEST_URL = "http://127.0.0.1:8090/rest/test";
private static final String REST_TEST_URL = "http://127.0.0.1:8080/taskana/rest/test";
private static final HttpClient HTTP_CLIENT =
HttpClient.newBuilder()
@ -37,13 +44,31 @@ public class TaskanaProducersTest {
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
WARArchive deployment = ShrinkWrap.create(WARArchive.class);
deployment.addPackage("pro.taskana");
deployment.addClass(TaskanaProducers.class);
deployment.addAllDependencies();
deployment.addAsResource("META-INF/beans.xml");
deployment.addAsResource("taskana.properties");
deployment.addAsResource("project-defaults.yml");
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(
TaskanaProducers.class, TaskanaEjb.class, TaskanaCdiStartupException.class);
ejbModule.addAsResource("taskana.properties");
deployment.addAsModule(ejbModule);
WebArchive webArchive =
ShrinkWrap.create(WebArchive.class, "taskana.war")
.addClasses(TaskanaCdiTestRestController.class, RestApplication.class)
.addAsWebInfResource("META-INF/beans.xml", "beans.xml")
.addAsWebInfResource("int-test-jboss-web.xml", "jboss-web.xml");
deployment.addAsModule(webArchive);
deployment.addAsManifestResource("META-INF/beans.xml", "beans.xml");
return deployment;
}
@ -85,8 +110,8 @@ public class TaskanaProducersTest {
return DriverManager.getConnection(
"jdbc:h2:~/taskana-h2-data/testdb;NON_KEYWORDS=KEY,VALUE;AUTO_SERVER=TRUE;"
+ "IGNORECASE=TRUE;LOCK_MODE=0",
"SA",
"SA");
"sa",
"");
}
private int countTasksByName(String taskName) throws Exception {

View File

@ -0,0 +1,19 @@
<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-27.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>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web version="7.2"
xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_7_2.xsd">
<context-root>/taskana</context-root>
</jboss-web>

View File

@ -0,0 +1,673 @@
<?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.microprofile.opentracing-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="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>
<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"/>
<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.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</user-name>
<password></password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/TestDS"
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</user-name>
<password></password>
</security>
</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:3.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"
use-transaction-setup-provider="true"/>
</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:16.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="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"/>
<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.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-set>
</permission-sets>
<http>
<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>
<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>
<provider-http-server-mechanism-factory name="global"/>
</http>
<sasl>
<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>
<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"/>
<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>
</subsystem>
<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">
<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="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>
<cache-container name="server" default-cache="default" marshaller="PROTOSTREAM"
modules="org.wildfly.clustering.singleton.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"/>
<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>
</subsystem>
<subsystem xmlns="urn:jboss:domain:io:3.0">
<worker name="default"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:2.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:14.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: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:5.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:6.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:13.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}}">
<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>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<module name="com.h2database.h2" xmlns="urn:jboss:module:1.9">
<resources>
<resource-root path="h2-2.1.214.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>

View File

@ -1,16 +0,0 @@
swarm:
port:
offset: 10
datasources:
data-sources:
TestDS:
driver-name: myh2
connection-url: jdbc:h2:~/taskana-h2-data/testdb;NON_KEYWORDS=KEY,VALUE;AUTO_SERVER=TRUE;IGNORECASE=TRUE;LOCK_MODE=0
user-name: SA
password: SA
jdbc-drivers:
myh2:
driver-class-name: org.h2.Driver
xa-datasource-name: org.h2.jdbcx.JdbcDataSource
driver-module-name: com.h2database.h2

View File

@ -5,11 +5,11 @@ 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 in millis
# 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 sleeping period
# 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

View File

@ -10,7 +10,7 @@
<parent>
<groupId>pro.taskana</groupId>
<artifactId>taskana-lib-parent</artifactId>
<version>6.1.1-SNAPSHOT</version>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -45,6 +45,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${version.assertj}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -62,6 +62,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.platform.commons.support.AnnotationSupport;
import pro.taskana.TaskanaConfiguration;
import pro.taskana.common.api.TaskanaEngine;
import pro.taskana.common.api.WorkingTimeCalculator;
import pro.taskana.common.api.exceptions.ErrorCode;
import pro.taskana.common.api.exceptions.TaskanaException;
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
@ -71,7 +72,6 @@ import pro.taskana.common.internal.TaskanaEngineImpl;
import pro.taskana.common.internal.jobs.JobScheduler;
import pro.taskana.common.internal.logging.LoggingAspect;
import pro.taskana.common.internal.workingtime.HolidaySchedule;
import pro.taskana.common.internal.workingtime.WorkingTimeCalculatorImpl;
import pro.taskana.testapi.TaskanaIntegrationTest;
/**
@ -437,7 +437,7 @@ class ArchitectureTest {
.that()
.areNotAssignableFrom(ArchitectureTest.class)
.and()
.areNotAssignableTo(WorkingTimeCalculatorImpl.class)
.areNotAssignableTo(WorkingTimeCalculator.class)
.and()
.areNotAssignableTo(TaskanaEngineImpl.class)
.and()

View File

@ -115,7 +115,7 @@ class TaskanaConfigurationTest {
assertThat(configuration.getLogHistoryLoggerName()).isNull();
// job configuration
assertThat(configuration.isJobSchedulerEnabled()).isTrue();
assertThat(configuration.getJobSchedulerInitialStartDelay()).isEqualTo(100);
assertThat(configuration.getJobSchedulerInitialStartDelay()).isEqualTo(0);
assertThat(configuration.getJobSchedulerPeriod()).isEqualTo(5);
assertThat(configuration.getJobSchedulerPeriodTimeUnit()).isEqualTo(TimeUnit.MINUTES);
assertThat(configuration.getMaxNumberOfJobRetries()).isEqualTo(3);
@ -251,6 +251,7 @@ class TaskanaConfigurationTest {
Map<String, List<String>> expectedClassificationCategories =
Map.of("TYPE_A", List.of("CATEGORY_A"), "TYPE_B", List.of("CATEGORY_B"));
// working time configuration
boolean expectedUseDetailedWorkingTimeCalculation = false;
Map<DayOfWeek, Set<LocalTimeInterval>> expectedWorkingTimeSchedule =
Map.of(DayOfWeek.MONDAY, Set.of(new LocalTimeInterval(LocalTime.MIN, LocalTime.NOON)));
ZoneId expectedWorkingTimeScheduleTimeZone = ZoneId.ofOffset("UTC", ZoneOffset.ofHours(4));
@ -269,21 +270,27 @@ class TaskanaConfigurationTest {
int expectedJobBatchSize = 50;
Instant expectedJobFirstJun = Instant.MIN;
Duration expectedJobRunEvery = Duration.ofDays(2);
Duration expectedJobLockExpirationPeriod = Duration.ofDays(2);
boolean expectedTaskCleanupJobEnabled = false;
Duration expectedTaskCleanupJobMinimumAge = Duration.ofDays(1);
boolean expectedTaskCleanupJobAllCompletedSameParentBusiness = false;
Duration expectedTaskCleanupJobLockExpirationPeriod = Duration.ofDays(2);
boolean expectedWorkbasketCleanupJobEnabled = false;
Duration expectedWorkbasketCleanupJobLockExpirationPeriod = Duration.ofDays(2);
boolean expectedSimpleHistoryCleanupJobEnabled = true;
int expectedSimpleHistoryCleanupJobBatchSize = 16;
Duration expectedSimpleHistoryCleanupJobMinimumAge = Duration.ofHours(3);
boolean expectedSimpleHistoryCleanupJobAllCompletedSameParentBusiness = false;
Duration expectedSimpleHistoryCleanupJobLockExpirationPeriod = Duration.ofDays(2);
boolean expectedTaskUpdatePriorityJobEnabled = true;
int expectedPriorityJobBatchSize = 49;
Instant expectedPriorityJobFirstRun = Instant.MIN.plus(1, ChronoUnit.DAYS);
Duration expectedTaskUpdatePriorityJobRunEvery = Duration.ofMinutes(17);
Duration expectedTaskUpdatePriorityJobLockExpirationPeriod = Duration.ofDays(2);
boolean expectedUserInfoRefreshJobEnabled = true;
Instant expectedUserRefreshJobFirstRun = Instant.MIN.plus(2, ChronoUnit.DAYS);
Duration expectedUserRefreshJobRunEvery = Duration.ofDays(5);
Duration expectedUserRefreshJobLockExpirationPeriod = Duration.ofDays(2);
Set<String> expectedJobSchedulerCustomJobs = Set.of("Job_A", "Job_B");
// user configuration
boolean expectedAddAdditionalUserInfo = true;
@ -308,6 +315,7 @@ class TaskanaConfigurationTest {
.classificationTypes(expectedClassificationTypes)
.classificationCategoriesByType(expectedClassificationCategories)
// working time configuration
.useWorkingTimeCalculation(expectedUseDetailedWorkingTimeCalculation)
.workingTimeSchedule(expectedWorkingTimeSchedule)
.workingTimeScheduleTimeZone(expectedWorkingTimeScheduleTimeZone)
.customHolidays(expectedCustomHolidays)
@ -327,23 +335,32 @@ class TaskanaConfigurationTest {
.jobBatchSize(expectedJobBatchSize)
.jobFirstRun(expectedJobFirstJun)
.jobRunEvery(expectedJobRunEvery)
.jobLockExpirationPeriod(expectedJobLockExpirationPeriod)
.taskCleanupJobEnabled(expectedTaskCleanupJobEnabled)
.taskCleanupJobMinimumAge(expectedTaskCleanupJobMinimumAge)
.taskCleanupJobAllCompletedSameParentBusiness(
expectedTaskCleanupJobAllCompletedSameParentBusiness)
.taskCleanupJobLockExpirationPeriod(expectedTaskCleanupJobLockExpirationPeriod)
.workbasketCleanupJobEnabled(expectedWorkbasketCleanupJobEnabled)
.workbasketCleanupJobLockExpirationPeriod(
expectedWorkbasketCleanupJobLockExpirationPeriod)
.simpleHistoryCleanupJobEnabled(expectedSimpleHistoryCleanupJobEnabled)
.simpleHistoryCleanupJobBatchSize(expectedSimpleHistoryCleanupJobBatchSize)
.simpleHistoryCleanupJobMinimumAge(expectedSimpleHistoryCleanupJobMinimumAge)
.simpleHistoryCleanupJobAllCompletedSameParentBusiness(
expectedSimpleHistoryCleanupJobAllCompletedSameParentBusiness)
.simpleHistoryCleanupJobLockExpirationPeriod(
expectedSimpleHistoryCleanupJobLockExpirationPeriod)
.taskUpdatePriorityJobEnabled(expectedTaskUpdatePriorityJobEnabled)
.taskUpdatePriorityJobBatchSize(expectedPriorityJobBatchSize)
.taskUpdatePriorityJobFirstRun(expectedPriorityJobFirstRun)
.taskUpdatePriorityJobRunEvery(expectedTaskUpdatePriorityJobRunEvery)
.taskUpdatePriorityJobLockExpirationPeriod(
expectedTaskUpdatePriorityJobLockExpirationPeriod)
.userInfoRefreshJobEnabled(expectedUserInfoRefreshJobEnabled)
.userRefreshJobFirstRun(expectedUserRefreshJobFirstRun)
.userRefreshJobRunEvery(expectedUserRefreshJobRunEvery)
.userRefreshJobLockExpirationPeriod(expectedUserRefreshJobLockExpirationPeriod)
.customJobs(expectedJobSchedulerCustomJobs)
// user configuration
.addAdditionalUserInfo(expectedAddAdditionalUserInfo)
@ -368,6 +385,8 @@ class TaskanaConfigurationTest {
assertThat(configuration.getClassificationCategoriesByType())
.isEqualTo(expectedClassificationCategories);
// working time configuration
assertThat(configuration.isUseWorkingTimeCalculation())
.isEqualTo(expectedUseDetailedWorkingTimeCalculation);
assertThat(configuration.getWorkingTimeSchedule()).isEqualTo(expectedWorkingTimeSchedule);
assertThat(configuration.getWorkingTimeScheduleTimeZone())
.isEqualTo(expectedWorkingTimeScheduleTimeZone);
@ -442,6 +461,7 @@ class TaskanaConfigurationTest {
.classificationCategoriesByType(
Map.of("typeA", List.of("categoryA"), "typeB", List.of("categoryB")))
// working time configuration
.useWorkingTimeCalculation(false)
.workingTimeSchedule(
Map.of(
DayOfWeek.MONDAY,
@ -462,21 +482,27 @@ class TaskanaConfigurationTest {
.jobBatchSize(50)
.jobFirstRun(Instant.MIN)
.jobRunEvery(Duration.ofDays(2))
.jobLockExpirationPeriod(Duration.ofDays(2))
.taskCleanupJobEnabled(false)
.taskCleanupJobMinimumAge(Duration.ofDays(1))
.taskCleanupJobAllCompletedSameParentBusiness(false)
.taskCleanupJobLockExpirationPeriod(Duration.ofDays(6))
.workbasketCleanupJobEnabled(false)
.workbasketCleanupJobLockExpirationPeriod(Duration.ofDays(7))
.simpleHistoryCleanupJobEnabled(true)
.simpleHistoryCleanupJobBatchSize(16)
.simpleHistoryCleanupJobMinimumAge(Duration.ofHours(3))
.simpleHistoryCleanupJobAllCompletedSameParentBusiness(false)
.simpleHistoryCleanupJobLockExpirationPeriod(Duration.ofDays(9))
.taskUpdatePriorityJobEnabled(true)
.taskUpdatePriorityJobBatchSize(49)
.taskUpdatePriorityJobFirstRun(Instant.MIN.plus(1, ChronoUnit.DAYS))
.taskUpdatePriorityJobRunEvery(Duration.ofMinutes(17))
.taskUpdatePriorityJobLockExpirationPeriod(Duration.ofDays(10))
.userInfoRefreshJobEnabled(true)
.userRefreshJobFirstRun(Instant.MIN.plus(2, ChronoUnit.DAYS))
.userRefreshJobRunEvery(Duration.ofDays(5))
.userRefreshJobLockExpirationPeriod(Duration.ofDays(8))
.customJobs(Set.of("Job_A", "Job_B"))
// user configuration
.addAdditionalUserInfo(true)

View File

@ -45,6 +45,7 @@ class DeleteClassificationAccTest {
.accessId("businessadmin")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "admin");
}

View File

@ -46,6 +46,7 @@ import pro.taskana.task.api.models.Task;
import pro.taskana.task.internal.models.TaskImpl;
import pro.taskana.testapi.TaskanaInject;
import pro.taskana.testapi.TaskanaIntegrationTest;
import pro.taskana.testapi.builder.TaskBuilder;
import pro.taskana.testapi.builder.WorkbasketAccessItemBuilder;
import pro.taskana.testapi.security.WithAccessId;
import pro.taskana.workbasket.api.WorkbasketPermission;
@ -134,6 +135,7 @@ class UpdateClassificationAccTest {
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
@ -156,6 +158,7 @@ class UpdateClassificationAccTest {
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
ClassificationSummary classificationSummaryWithSpecifiedServiceLevel =
@ -183,6 +186,50 @@ class UpdateClassificationAccTest {
@Nested
class UpdatePriorityAndServiceLevelTest {
@WithAccessId(user = "businessadmin")
@Test
void should_ChangeDueDate_When_ServiceLevelOfClassificationHasChanged() throws Exception {
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P1D")
.buildAndStore(classificationService);
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
Task task = new TaskBuilder()
.classificationSummary(classification.asSummary())
.workbasketSummary(workbasketSummary)
.primaryObjRef(defaultTestObjectReference().build())
.planned(Instant.parse("2021-04-27T15:34:00.000Z"))
.due(null)
.buildAndStore(taskService);
classificationService.updateClassification(classification);
runAssociatedJobs();
// read again the task from DB
task = taskService.getTask(task.getId());
assertThat(task.getClassificationSummary().getServiceLevel()).isEqualTo("P1D");
assertThat(task.getDue()).isAfterOrEqualTo("2021-04-28T15:33:59.999Z");
classification.setServiceLevel("P3D");
classificationService.updateClassification(classification);
runAssociatedJobs();
// read again the task from DB
task = taskService.getTask(task.getId());
assertThat(task.getClassificationSummary().getServiceLevel()).isEqualTo("P3D");
assertThat(task.getDue()).isEqualTo("2021-04-30T15:33:59.999Z");
}
@WithAccessId(user = "businessadmin")
@Test
void should_NotThrowException_When_UpdatingClassificationWithEmptyServiceLevel()

View File

@ -0,0 +1,933 @@
package acceptance.classification.update;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestClassification;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestObjectReference;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestWorkbasket;
import static pro.taskana.testapi.builder.TaskBuilder.newTask;
import java.time.Duration;
import java.time.Instant;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.function.ThrowingConsumer;
import pro.taskana.TaskanaConfiguration.Builder;
import pro.taskana.classification.api.ClassificationCustomField;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.classification.api.exceptions.ClassificationNotFoundException;
import pro.taskana.classification.api.models.Classification;
import pro.taskana.classification.api.models.ClassificationSummary;
import pro.taskana.classification.internal.models.ClassificationImpl;
import pro.taskana.common.api.TaskanaEngine;
import pro.taskana.common.api.TaskanaRole;
import pro.taskana.common.api.WorkingTimeCalculator;
import pro.taskana.common.api.exceptions.ConcurrencyException;
import pro.taskana.common.api.exceptions.InvalidArgumentException;
import pro.taskana.common.api.exceptions.NotAuthorizedException;
import pro.taskana.common.api.security.CurrentUserContext;
import pro.taskana.common.internal.jobs.JobRunner;
import pro.taskana.common.internal.util.Pair;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.models.Attachment;
import pro.taskana.task.api.models.Task;
import pro.taskana.task.internal.models.TaskImpl;
import pro.taskana.testapi.TaskanaConfigurationModifier;
import pro.taskana.testapi.TaskanaInject;
import pro.taskana.testapi.TaskanaIntegrationTest;
import pro.taskana.testapi.builder.TaskBuilder;
import pro.taskana.testapi.builder.WorkbasketAccessItemBuilder;
import pro.taskana.testapi.security.WithAccessId;
import pro.taskana.workbasket.api.WorkbasketPermission;
import pro.taskana.workbasket.api.WorkbasketService;
import pro.taskana.workbasket.api.models.WorkbasketSummary;
@TaskanaIntegrationTest
public class UpdateClassificationWithWorkingDayCalculatorAccTest
implements TaskanaConfigurationModifier {
@TaskanaInject ClassificationService classificationService;
@TaskanaInject TaskanaEngine taskanaEngine;
@TaskanaInject TaskService taskService;
@TaskanaInject WorkbasketService workbasketService;
@TaskanaInject WorkingTimeCalculator workingTimeCalculator;
@TaskanaInject CurrentUserContext currentUserContext;
@Override
public Builder modify(Builder builder) {
return builder
.workingTimeScheduleTimeZone(ZoneId.of("UTC"))
.useWorkingTimeCalculation(false); // switch to WorkingDayCalculatorImpl
}
@WithAccessId(user = "businessadmin")
@Test
void should_SetFieldsCorrectly_When_TryingToUpdateClassification() throws Exception {
Classification parentClassification =
defaultTestClassification().buildAndStore(classificationService);
Classification classification =
defaultTestClassification().type("TASK").buildAndStore(classificationService);
final Instant createdBefore = classification.getCreated();
final Instant modifiedBefore = classification.getModified();
classification.setApplicationEntryPoint("newEntrypoint");
classification.setCategory("PROCESS");
classification.setCustomField(ClassificationCustomField.CUSTOM_1, "newCustom1");
classification.setCustomField(ClassificationCustomField.CUSTOM_2, "newCustom2");
classification.setCustomField(ClassificationCustomField.CUSTOM_3, "newCustom3");
classification.setCustomField(ClassificationCustomField.CUSTOM_4, "newCustom4");
classification.setCustomField(ClassificationCustomField.CUSTOM_5, "newCustom5");
classification.setCustomField(ClassificationCustomField.CUSTOM_6, "newCustom6");
classification.setCustomField(ClassificationCustomField.CUSTOM_7, "newCustom7");
classification.setCustomField(ClassificationCustomField.CUSTOM_8, "newCustom8");
classification.setDescription("newDescription");
classification.setIsValidInDomain(false);
classification.setName("newName");
classification.setParentId(parentClassification.getId());
classification.setParentKey(parentClassification.getKey());
classification.setPriority(1000);
classification.setServiceLevel("P3D");
classificationService.updateClassification(classification);
Classification updatedClassification =
classificationService.getClassification(classification.getKey(), "DOMAIN_A");
ClassificationImpl expectedClassification =
(ClassificationImpl)
defaultTestClassification()
.type("TASK")
.applicationEntryPoint("newEntrypoint")
.category("PROCESS")
.customAttribute(ClassificationCustomField.CUSTOM_1, "newCustom1")
.customAttribute(ClassificationCustomField.CUSTOM_2, "newCustom2")
.customAttribute(ClassificationCustomField.CUSTOM_3, "newCustom3")
.customAttribute(ClassificationCustomField.CUSTOM_4, "newCustom4")
.customAttribute(ClassificationCustomField.CUSTOM_5, "newCustom5")
.customAttribute(ClassificationCustomField.CUSTOM_6, "newCustom6")
.customAttribute(ClassificationCustomField.CUSTOM_7, "newCustom7")
.customAttribute(ClassificationCustomField.CUSTOM_8, "newCustom8")
.description("newDescription")
.isValidInDomain(false)
.name("newName")
.parentId(parentClassification.getId())
.parentKey(parentClassification.getKey())
.priority(1000)
.serviceLevel("P3D")
.created(createdBefore)
.modified(updatedClassification.getModified())
.buildAndStore(classificationService);
expectedClassification.setKey(updatedClassification.getKey());
expectedClassification.setId(updatedClassification.getId());
assertThat(expectedClassification).hasNoNullFieldsOrProperties();
assertThat(modifiedBefore).isBefore(classification.getModified());
assertThat(updatedClassification).isEqualTo(expectedClassification);
}
private String createTaskWithExistingClassification(ClassificationSummary classificationSummary)
throws Exception {
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
return newTask()
.classificationSummary(classificationSummary)
.workbasketSummary(workbasketSummary)
.primaryObjRef(defaultTestObjectReference().build())
.buildAndStore(taskService)
.getId();
}
private List<String> createTasksWithExistingClassificationInAttachment(
ClassificationSummary classificationSummary, String serviceLevel, int priority, int amount)
throws Exception {
List<String> taskList = new ArrayList<>();
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
ClassificationSummary classificationSummaryWithSpecifiedServiceLevel =
defaultTestClassification()
.serviceLevel(serviceLevel)
.priority(priority)
.buildAndStoreAsSummary(classificationService);
for (int i = 0; i < amount; i++) {
Attachment attachment = taskService.newAttachment();
attachment.setClassificationSummary(classificationSummary);
attachment.setObjectReference(defaultTestObjectReference().build());
taskList.add(
newTask()
.classificationSummary(classificationSummaryWithSpecifiedServiceLevel)
.workbasketSummary(workbasketSummary)
.primaryObjRef(defaultTestObjectReference().build())
.attachments(attachment)
.buildAndStore(taskService)
.getId());
}
return taskList;
}
@TestInstance(Lifecycle.PER_CLASS)
@Nested
class UpdatePriorityAndServiceLevelTest {
@WithAccessId(user = "businessadmin")
@Test
void should_ChangeDueDate_When_ClassificationOfTaskHasChanged() throws Exception {
final Instant plannedDate = Instant.parse("2021-04-27T15:34:00.000Z");
final String expectedDue1 = plannedDate.plus(1, ChronoUnit.DAYS).toString();
final String expectedDue3 = plannedDate.plus(3, ChronoUnit.DAYS).toString();
final Classification classificationWithSL1 =
defaultTestClassification()
.priority(1)
.serviceLevel("P1D")
.buildAndStore(classificationService);
final Classification classificationWithSL3 =
defaultTestClassification()
.priority(1)
.serviceLevel("P3D")
.buildAndStore(classificationService);
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
Task task =
new TaskBuilder()
.classificationSummary(classificationWithSL1.asSummary())
.workbasketSummary(workbasketSummary)
.primaryObjRef(defaultTestObjectReference().build())
.planned(plannedDate)
.due(null)
.buildAndStore(taskService);
classificationService.updateClassification(classificationWithSL1);
runAssociatedJobs();
// read again the task from DB
task = taskService.getTask(task.getId());
assertThat(task.getClassificationSummary().getServiceLevel()).isEqualTo("P1D");
assertThat(task.getDue()).isAfterOrEqualTo(expectedDue1);
task.setClassificationKey(classificationWithSL3.getKey());
taskService.updateTask(task);
// read again the task from DB
task = taskService.getTask(task.getId());
assertThat(task.getClassificationSummary().getServiceLevel()).isEqualTo("P3D");
assertThat(task.getDue()).isEqualTo(expectedDue3);
}
@WithAccessId(user = "businessadmin")
@Test
void should_ChangeDueDate_When_ServiceLevelOfClassificationHasChanged() throws Exception {
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P1D")
.buildAndStore(classificationService);
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
Task task =
new TaskBuilder()
.classificationSummary(classification.asSummary())
.workbasketSummary(workbasketSummary)
.primaryObjRef(defaultTestObjectReference().build())
.planned(Instant.parse("2021-04-27T15:34:00.000Z"))
.due(null)
.buildAndStore(taskService);
classificationService.updateClassification(classification);
runAssociatedJobs();
// read again the task from DB
task = taskService.getTask(task.getId());
assertThat(task.getClassificationSummary().getServiceLevel()).isEqualTo("P1D");
assertThat(task.getDue()).isAfterOrEqualTo("2021-04-28T15:34:00.000Z");
classification.setServiceLevel("P3D");
classificationService.updateClassification(classification);
runAssociatedJobs();
// read again the task from DB
task = taskService.getTask(task.getId());
assertThat(task.getClassificationSummary().getServiceLevel()).isEqualTo("P3D");
assertThat(task.getDue()).isEqualTo("2021-04-30T15:34:00.000Z");
}
@WithAccessId(user = "businessadmin")
@Test
void should_NotThrowException_When_UpdatingClassificationWithEmptyServiceLevel()
throws Exception {
Classification classification =
defaultTestClassification().serviceLevel("P1D").buildAndStore(classificationService);
classification.setServiceLevel("");
assertThatCode(() -> classificationService.updateClassification(classification))
.doesNotThrowAnyException();
assertThat(classificationService.getClassification(classification.getId()).getServiceLevel())
.isEqualTo("P0D");
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest>
should_SetDefaultServiceLevel_When_TryingToUpdateClassificationWithMissingServiceLevel()
throws Exception {
Classification classification =
defaultTestClassification().serviceLevel("P1D").buildAndStore(classificationService);
List<Pair<Classification, String>> inputList =
List.of(Pair.of(classification, null), Pair.of(classification, ""));
ThrowingConsumer<Pair<Classification, String>> test =
input -> {
input.getLeft().setServiceLevel(input.getRight());
classificationService.updateClassification(input.getLeft());
assertThat(
classificationService
.getClassification(input.getLeft().getId())
.getServiceLevel())
.isEqualTo("P0D");
};
return DynamicTest.stream(
inputList.iterator(), i -> String.format("for %s", i.getRight()), test);
}
@WithAccessId(user = "businessadmin")
@Test
void should_UpdateTaskServiceLevel_When_UpdateClassificationInTask() throws Exception {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P13D")
.buildAndStore(classificationService);
final List<String> directLinkedTask =
List.of(createTaskWithExistingClassification(classification.asSummary()));
classification.setServiceLevel("P15D");
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(before, directLinkedTask, taskService, workingTimeCalculator, 15, 1);
}
@WithAccessId(user = "businessadmin")
@Test
void should_UpdateTaskPriority_When_UpdateClassificationInTask() throws Exception {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P13D")
.buildAndStore(classificationService);
final List<String> directLinkedTask =
List.of(createTaskWithExistingClassification(classification.asSummary()));
classification.setPriority(1000);
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before, directLinkedTask, taskService, workingTimeCalculator, 13, 1000);
}
@WithAccessId(user = "businessadmin")
@Test
void should_UpdateTaskPriorityAndServiceLevel_When_UpdateClassificationInTask()
throws Exception {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P13D")
.buildAndStore(classificationService);
final List<String> directLinkedTask =
List.of(createTaskWithExistingClassification(classification.asSummary()));
classification.setServiceLevel("P15D");
classification.setPriority(1000);
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before, directLinkedTask, taskService, workingTimeCalculator, 15, 1000);
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest> should_UpdateTaskServiceLevel_When_UpdateClassificationInAttachment() {
List<Pair<String, Integer>> inputs =
List.of(Pair.of("P5D", 2), Pair.of("P8D", 3), Pair.of("P16D", 4));
List<Pair<Integer, Integer>> outputs = List.of(Pair.of(1, 2), Pair.of(1, 3), Pair.of(1, 4));
List<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> zippedTestInputList =
IntStream.range(0, inputs.size())
.mapToObj(i -> Pair.of(inputs.get(i), outputs.get(i)))
.collect(Collectors.toList());
ThrowingConsumer<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> test =
input -> {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P15D")
.buildAndStore(classificationService);
ClassificationSummary classificationSummary = classification.asSummary();
final List<String> indirectLinkedTasks =
createTasksWithExistingClassificationInAttachment(
classificationSummary,
input.getLeft().getLeft(),
input.getLeft().getRight(),
5);
classification.setServiceLevel("P1D");
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before,
indirectLinkedTasks,
taskService,
workingTimeCalculator,
input.getRight().getLeft(),
input.getRight().getRight());
};
return DynamicTest.stream(
zippedTestInputList.iterator(),
i ->
String.format(
"for Task with ServiceLevel %s and Priority %s",
i.getLeft().getLeft(), i.getLeft().getRight()),
test);
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest> should_NotUpdateTaskServiceLevel_When_UpdateClassificationInAttachment() {
List<Pair<String, Integer>> inputs =
List.of(Pair.of("P5D", 2), Pair.of("P8D", 3), Pair.of("P14D", 4));
List<Pair<Integer, Integer>> outputs = List.of(Pair.of(5, 2), Pair.of(8, 3), Pair.of(14, 4));
List<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> zippedTestInputList =
IntStream.range(0, inputs.size())
.mapToObj(i -> Pair.of(inputs.get(i), outputs.get(i)))
.collect(Collectors.toList());
ThrowingConsumer<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> test =
input -> {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P1D")
.buildAndStore(classificationService);
ClassificationSummary classificationSummary = classification.asSummary();
final List<String> indirectLinkedTasks =
createTasksWithExistingClassificationInAttachment(
classificationSummary,
input.getLeft().getLeft(),
input.getLeft().getRight(),
5);
classification.setServiceLevel("P15D");
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before,
indirectLinkedTasks,
taskService,
workingTimeCalculator,
input.getRight().getLeft(),
input.getRight().getRight());
};
return DynamicTest.stream(
zippedTestInputList.iterator(),
i ->
String.format(
"for Task with ServiceLevel %s and Priority %s",
i.getLeft().getLeft(), i.getLeft().getRight()),
test);
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest> should_UpdateTaskPriority_When_UpdateClassificationInAttachment() {
List<Pair<String, Integer>> inputs =
List.of(Pair.of("P1D", 1), Pair.of("P8D", 2), Pair.of("P14D", 999));
List<Pair<Integer, Integer>> outputs =
List.of(Pair.of(1, 1000), Pair.of(8, 1000), Pair.of(14, 1000));
List<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> zippedTestInputList =
IntStream.range(0, inputs.size())
.mapToObj(i -> Pair.of(inputs.get(i), outputs.get(i)))
.collect(Collectors.toList());
ThrowingConsumer<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> test =
input -> {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P13D")
.buildAndStore(classificationService);
ClassificationSummary classificationSummary = classification.asSummary();
final List<String> indirectLinkedTasks =
createTasksWithExistingClassificationInAttachment(
classificationSummary,
input.getLeft().getLeft(),
input.getLeft().getRight(),
5);
classification.setServiceLevel("P15D");
classification.setPriority(1000);
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before,
indirectLinkedTasks,
taskService,
workingTimeCalculator,
input.getRight().getLeft(),
input.getRight().getRight());
};
return DynamicTest.stream(
zippedTestInputList.iterator(),
i ->
String.format(
"for Task with ServiceLevel %s and Priority %s",
i.getLeft().getLeft(), i.getLeft().getRight()),
test);
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest> should_NotUpdateTaskPriority_When_UpdateClassificationInAttachment() {
List<Pair<String, Integer>> inputs =
List.of(Pair.of("P1D", 2), Pair.of("P8D", 3), Pair.of("P14D", 999));
List<Pair<Integer, Integer>> outputs =
List.of(Pair.of(1, 2), Pair.of(8, 3), Pair.of(14, 999));
List<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> zippedTestInputList =
IntStream.range(0, inputs.size())
.mapToObj(i -> Pair.of(inputs.get(i), outputs.get(i)))
.collect(Collectors.toList());
ThrowingConsumer<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> test =
input -> {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1000)
.serviceLevel("P13D")
.buildAndStore(classificationService);
ClassificationSummary classificationSummary = classification.asSummary();
final List<String> indirectLinkedTasks =
createTasksWithExistingClassificationInAttachment(
classificationSummary,
input.getLeft().getLeft(),
input.getLeft().getRight(),
5);
classification.setServiceLevel("P15D");
classification.setPriority(1);
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before,
indirectLinkedTasks,
taskService,
workingTimeCalculator,
input.getRight().getLeft(),
input.getRight().getRight());
};
return DynamicTest.stream(
zippedTestInputList.iterator(),
i ->
String.format(
"for Task with ServiceLevel %s and Priority %s",
i.getLeft().getLeft(), i.getLeft().getRight()),
test);
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest>
should_UpdateTaskPriorityAndServiceLevel_When_UpdateClassificationInAttachment() {
List<Pair<String, Integer>> inputs = List.of(Pair.of("P1D", 5), Pair.of("P14D", 98));
List<Pair<Integer, Integer>> outputs = List.of(Pair.of(1, 99), Pair.of(1, 99));
List<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> zippedTestInputList =
IntStream.range(0, inputs.size())
.mapToObj(i -> Pair.of(inputs.get(i), outputs.get(i)))
.collect(Collectors.toList());
ThrowingConsumer<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> test =
input -> {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1)
.serviceLevel("P13D")
.buildAndStore(classificationService);
ClassificationSummary classificationSummary = classification.asSummary();
final List<String> indirectLinkedTasks =
createTasksWithExistingClassificationInAttachment(
classificationSummary,
input.getLeft().getLeft(),
input.getLeft().getRight(),
3);
classification.setServiceLevel("P1D");
classification.setPriority(99);
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before,
indirectLinkedTasks,
taskService,
workingTimeCalculator,
input.getRight().getLeft(),
input.getRight().getRight());
};
return DynamicTest.stream(
zippedTestInputList.iterator(),
i ->
String.format(
"for Task with ServiceLevel %s and Priority %s",
i.getLeft().getLeft(), i.getLeft().getRight()),
test);
}
@WithAccessId(user = "businessadmin")
@TestFactory
Stream<DynamicTest>
should_NotUpdateTaskPriorityAndServiceLevel_When_UpdateClassificationInAttachment() {
List<Pair<String, Integer>> inputs = List.of(Pair.of("P1D", 5), Pair.of("P14D", 98));
List<Pair<Integer, Integer>> outputs = List.of(Pair.of(1, 5), Pair.of(14, 98));
List<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> zippedTestInputList =
IntStream.range(0, inputs.size())
.mapToObj(i -> Pair.of(inputs.get(i), outputs.get(i)))
.collect(Collectors.toList());
ThrowingConsumer<Pair<Pair<String, Integer>, Pair<Integer, Integer>>> test =
input -> {
final Instant before = Instant.now();
Classification classification =
defaultTestClassification()
.priority(1000)
.serviceLevel("P1D")
.buildAndStore(classificationService);
ClassificationSummary classificationSummary = classification.asSummary();
final List<String> indirectLinkedTasks =
createTasksWithExistingClassificationInAttachment(
classificationSummary,
input.getLeft().getLeft(),
input.getLeft().getRight(),
3);
classification.setServiceLevel("P15D");
classification.setPriority(1);
classificationService.updateClassification(classification);
runAssociatedJobs();
validateTaskProperties(
before,
indirectLinkedTasks,
taskService,
workingTimeCalculator,
input.getRight().getLeft(),
input.getRight().getRight());
};
return DynamicTest.stream(
zippedTestInputList.iterator(),
i ->
String.format(
"for Task with ServiceLevel %s and Priority %s",
i.getLeft().getLeft(), i.getLeft().getRight()),
test);
}
private void runAssociatedJobs() throws Exception {
Thread.sleep(10);
// run the ClassificationChangedJob
JobRunner runner = new JobRunner(taskanaEngine);
// run the TaskRefreshJob that was scheduled by the ClassificationChangedJob.
runner.runJobs();
Thread.sleep(
10); // otherwise the next runJobs call intermittently doesn't find the Job created
// by the previous step (it searches with DueDate < CurrentTime)
runner.runJobs();
}
private void validateTaskProperties(
Instant before,
List<String> tasksUpdated,
TaskService taskService,
WorkingTimeCalculator workingTimeCalculator,
int serviceLevel,
int priority)
throws Exception {
for (String taskId : tasksUpdated) {
Task task = taskService.getTask(taskId);
Instant expDue =
workingTimeCalculator.addWorkingTime(task.getPlanned(), Duration.ofDays(serviceLevel));
assertThat(task.getModified())
.describedAs("Task " + task.getId() + " has not been refreshed.")
.isAfter(before);
assertThat(task.getDue()).isEqualTo(expDue);
assertThat(task.getPriority()).isEqualTo(priority);
}
}
}
@TestInstance(Lifecycle.PER_CLASS)
@Nested
class UpdateClassificationExceptionTest {
/**
* This BeforeAll method is needed for this {@linkplain
* #should_ThrowException_When_UserIsNotAuthorized test} and {@linkplain
* #should_ThrowException_When_UserRoleIsNotAdminOrBusinessAdmin test} since it can't create an
* own classification.
*
* @throws Exception for errors in the building or reading process of entities.
*/
@WithAccessId(user = "businessadmin")
@BeforeAll
void createClassifications() throws Exception {
defaultTestClassification()
.key("BeforeAllClassification")
.buildAndStore(classificationService);
}
@Test
void should_ThrowException_When_UserIsNotAuthorized() throws Exception {
Classification classification =
classificationService.getClassification("BeforeAllClassification", "DOMAIN_A");
classification.setCustomField(ClassificationCustomField.CUSTOM_1, "newCustom1");
NotAuthorizedException expectedException =
new NotAuthorizedException(
currentUserContext.getUserid(), TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
assertThatThrownBy(() -> classificationService.updateClassification(classification))
.usingRecursiveComparison()
.isEqualTo(expectedException);
}
@WithAccessId(user = "taskadmin")
@WithAccessId(user = "user-1-1")
@TestTemplate
void should_ThrowException_When_UserRoleIsNotAdminOrBusinessAdmin() throws Exception {
Classification classification =
classificationService.getClassification("BeforeAllClassification", "DOMAIN_A");
classification.setApplicationEntryPoint("updated EntryPoint");
classification.setName("updated Name");
NotAuthorizedException expectedException =
new NotAuthorizedException(
currentUserContext.getUserid(), TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
assertThatThrownBy(() -> classificationService.updateClassification(classification))
.usingRecursiveComparison()
.isEqualTo(expectedException);
}
@WithAccessId(user = "businessadmin")
@Test
void should_ThrowException_When_UpdatingClassificationConcurrently() throws Exception {
Classification classification =
defaultTestClassification().buildAndStore(classificationService);
final Classification classificationSecondUpdate =
classificationService.getClassification(
classification.getKey(), classification.getDomain());
classification.setApplicationEntryPoint("Application Entry Point");
classification.setDescription("Description");
classification.setName("Name");
Thread.sleep(20); // to avoid identity of modified timestamps between classification and base
classificationService.updateClassification(classification);
classificationSecondUpdate.setName("Name again");
classificationSecondUpdate.setDescription("Description again");
ConcurrencyException expectedException =
new ConcurrencyException(classificationSecondUpdate.getId());
assertThatThrownBy(
() -> classificationService.updateClassification(classificationSecondUpdate))
.usingRecursiveComparison()
.isEqualTo(expectedException);
}
@WithAccessId(user = "businessadmin")
@Test
void should_ThrowException_When_TryingToUpdateClassificationWithInvalidParentId()
throws Exception {
Classification classification =
defaultTestClassification().buildAndStore(classificationService);
classification.setParentId("NON EXISTING ID");
ClassificationNotFoundException expectedException =
new ClassificationNotFoundException("NON EXISTING ID");
assertThatThrownBy(() -> classificationService.updateClassification(classification))
.usingRecursiveComparison()
.isEqualTo(expectedException);
}
@WithAccessId(user = "businessadmin")
@Test
void should_ThrowException_When_TryingToUpdateClassificationWithInvalidParentKey()
throws Exception {
Classification classification =
defaultTestClassification().buildAndStore(classificationService);
classification.setParentKey("NON EXISTING KEY");
ClassificationNotFoundException expectedException =
new ClassificationNotFoundException("NON EXISTING KEY", "DOMAIN_A");
assertThatThrownBy(() -> classificationService.updateClassification(classification))
.usingRecursiveComparison()
.isEqualTo(expectedException);
}
@WithAccessId(user = "businessadmin")
@Test
void should_ThrowException_When_TryingToUpdateClassificationWithOwnKeyAsParentKey()
throws Exception {
Classification classification =
defaultTestClassification().buildAndStore(classificationService);
classification.setParentKey(classification.getKey());
InvalidArgumentException expectedException =
new InvalidArgumentException(
String.format(
"The Classification '%s' has the same key and parent key",
classification.getName()));
assertThatThrownBy(() -> classificationService.updateClassification(classification))
.usingRecursiveComparison()
.isEqualTo(expectedException);
}
}
@TestInstance(Lifecycle.PER_CLASS)
@Nested
class UpdateClassificationCategoryTest {
Classification classification;
Task task;
Instant createdBefore;
Instant modifiedBefore;
@WithAccessId(user = "businessadmin")
@BeforeEach
void createClassificationAndTask() throws Exception {
classification =
defaultTestClassification()
.category("MANUAL")
.type("TASK")
.buildAndStore(classificationService);
createdBefore = classification.getCreated();
modifiedBefore = classification.getModified();
String taskId = createTaskWithExistingClassification(classification.asSummary());
task = taskService.getTask(taskId);
}
@WithAccessId(user = "businessadmin")
@Test
void should_UpdateTask_When_UpdatingClassificationCategory() throws Exception {
classification.setCategory("PROCESS");
classificationService.updateClassification(classification);
final Task updatedTask = taskService.getTask(task.getId());
TaskImpl expectedUpdatedTask = (TaskImpl) task.copy();
expectedUpdatedTask.setId(task.getId());
expectedUpdatedTask.setClassificationCategory("PROCESS");
expectedUpdatedTask.setClassificationSummary(
classificationService.getClassification(classification.getId()).asSummary());
expectedUpdatedTask.setExternalId(task.getExternalId());
assertThat(expectedUpdatedTask)
.usingRecursiveComparison()
.ignoringFields("modified")
.isEqualTo(updatedTask);
assertThat(expectedUpdatedTask.getModified()).isAfterOrEqualTo(modifiedBefore);
}
@WithAccessId(user = "businessadmin")
@Test
void should_UpdateClassification_When_UpdatingClassificationCategory() throws Exception {
classification.setCategory("PROCESS");
classificationService.updateClassification(classification);
Classification updatedClassification =
classificationService.getClassification(classification.getId());
assertThat(updatedClassification)
.usingRecursiveComparison()
.ignoringFields("modified")
.isEqualTo(classification);
assertThat(updatedClassification.getModified()).isAfterOrEqualTo(modifiedBefore);
}
}
}

View File

@ -65,6 +65,7 @@ class TaskUpdatePriorityWorkerAccTest {
.workbasketId(workbasketSummary.getId())
.accessId("whatever")
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.buildAndStore(workbasketService);
TaskBuilder taskBuilder =

View File

@ -5,18 +5,26 @@ import static pro.taskana.testapi.DefaultTestEntities.defaultTestClassification;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestObjectReference;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestWorkbasket;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import pro.taskana.TaskanaConfiguration.Builder;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.classification.api.models.ClassificationSummary;
import pro.taskana.common.api.BulkOperationResults;
import pro.taskana.common.api.TaskanaEngine;
import pro.taskana.common.api.WorkingTimeCalculator;
import pro.taskana.common.api.exceptions.TaskanaException;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.models.Attachment;
import pro.taskana.task.api.models.ObjectReference;
import pro.taskana.task.api.models.TaskSummary;
import pro.taskana.testapi.TaskanaConfigurationModifier;
import pro.taskana.testapi.TaskanaInject;
import pro.taskana.testapi.TaskanaIntegrationTest;
import pro.taskana.testapi.builder.TaskAttachmentBuilder;
@ -37,171 +45,364 @@ class ServiceLevelOfAllTasksAccTest {
private static final String SMALL_CLASSIFICATION_SERVICE_LEVEL = "P2D";
private static final String GREAT_CLASSIFICATION_SERVICE_LEVEL = "P7D";
@TaskanaInject TaskService taskService;
@TaskanaInject WorkbasketService workbasketService;
@TaskanaInject ClassificationService classificationService;
@Nested
@TestInstance(Lifecycle.PER_CLASS)
class WithWorkingTimeCalculation {
@TaskanaInject TaskService taskService;
@TaskanaInject WorkbasketService workbasketService;
@TaskanaInject ClassificationService classificationService;
ClassificationSummary classificationSummarySmallServiceLevel;
ClassificationSummary classificationSummaryGreatServiceLevel;
Attachment attachmentSummarySmallServiceLevel;
Attachment attachmentSummaryGreatServiceLevel;
WorkbasketSummary defaultWorkbasketSummary;
ObjectReference defaultObjectReference;
ClassificationSummary classificationSummarySmallServiceLevel;
ClassificationSummary classificationSummaryGreatServiceLevel;
Attachment attachmentSummarySmallServiceLevel;
Attachment attachmentSummaryGreatServiceLevel;
WorkbasketSummary defaultWorkbasketSummary;
ObjectReference defaultObjectReference;
@WithAccessId(user = "businessadmin")
@BeforeAll
void setup() throws Exception {
classificationSummarySmallServiceLevel =
defaultTestClassification()
.serviceLevel(SMALL_CLASSIFICATION_SERVICE_LEVEL)
.buildAndStoreAsSummary(classificationService);
classificationSummaryGreatServiceLevel =
defaultTestClassification()
.serviceLevel(GREAT_CLASSIFICATION_SERVICE_LEVEL)
.buildAndStoreAsSummary(classificationService);
@WithAccessId(user = "businessadmin")
@BeforeAll
void setup() throws Exception {
classificationSummarySmallServiceLevel =
defaultTestClassification()
.serviceLevel(SMALL_CLASSIFICATION_SERVICE_LEVEL)
.buildAndStoreAsSummary(classificationService);
classificationSummaryGreatServiceLevel =
defaultTestClassification()
.serviceLevel(GREAT_CLASSIFICATION_SERVICE_LEVEL)
.buildAndStoreAsSummary(classificationService);
defaultObjectReference = defaultTestObjectReference().build();
defaultObjectReference = defaultTestObjectReference().build();
attachmentSummarySmallServiceLevel =
TaskAttachmentBuilder.newAttachment()
.classificationSummary(classificationSummarySmallServiceLevel)
.objectReference(defaultObjectReference)
.build();
attachmentSummaryGreatServiceLevel =
TaskAttachmentBuilder.newAttachment()
.classificationSummary(classificationSummaryGreatServiceLevel)
.objectReference(defaultObjectReference)
.build();
attachmentSummarySmallServiceLevel =
TaskAttachmentBuilder.newAttachment()
.classificationSummary(classificationSummarySmallServiceLevel)
.objectReference(defaultObjectReference)
.build();
attachmentSummaryGreatServiceLevel =
TaskAttachmentBuilder.newAttachment()
.classificationSummary(classificationSummaryGreatServiceLevel)
.objectReference(defaultObjectReference)
.build();
defaultWorkbasketSummary = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(defaultWorkbasketSummary.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
defaultWorkbasketSummary = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(defaultWorkbasketSummary.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
}
@WithAccessId(user = "user-1-1")
@Test
void should_SetPlannedOnMultipleTasks() throws Exception {
Instant planned = Instant.parse("2020-05-03T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task3 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId(), task3.getId());
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId(), task3.getId()).list();
assertThat(result).extracting(TaskSummary::getPlanned).containsOnly(planned);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndClassificationHasSmallerServiceLevel()
throws Exception {
Instant planned = Instant.parse("2020-05-04T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId());
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId()).list();
Instant expectedDue = Instant.parse("2020-05-06T06:59:59.999Z");
assertThat(result).extracting(TaskSummary::getDue).containsOnly(expectedDue);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndAttachmentHasSmallerOrEqualServiceLevel()
throws Exception {
Instant planned = Instant.parse("2020-05-04T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId());
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId()).list();
Instant expectedDue = Instant.parse("2020-05-06T06:59:59.999Z");
assertThat(result).extracting(TaskSummary::getDue).containsOnly(expectedDue);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndUsingDifferentServiceLevels() throws Exception {
Instant planned = Instant.parse("2020-05-04T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task3 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId(), task3.getId());
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId(), task3.getId()).list();
Instant expectedDueSmallServiceLevel = Instant.parse("2020-05-06T06:59:59.999Z");
Instant expectedDueGreatServiceLevel = Instant.parse("2020-05-13T06:59:59.999Z");
assertThat(result)
.extracting(TaskSummary::getDue)
.containsOnly(expectedDueSmallServiceLevel, expectedDueGreatServiceLevel);
}
private TaskBuilder createDefaultTask() {
return (TaskBuilder.newTask()
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference));
}
}
@WithAccessId(user = "user-1-1")
@Test
void should_SetPlannedOnMultipleTasks() throws Exception {
Instant planned = Instant.parse("2020-05-03T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task3 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId(), task3.getId());
@Nested
@TestInstance(Lifecycle.PER_CLASS)
class WithWorkingDaysCalculation implements TaskanaConfigurationModifier {
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
@TaskanaInject TaskanaEngine taskanaEngine;
@TaskanaInject TaskService taskService;
@TaskanaInject WorkbasketService workbasketService;
@TaskanaInject ClassificationService classificationService;
ClassificationSummary classificationSummarySmallServiceLevel;
ClassificationSummary classificationSummaryGreatServiceLevel;
Attachment attachmentSummarySmallServiceLevel;
Attachment attachmentSummaryGreatServiceLevel;
WorkbasketSummary defaultWorkbasketSummary;
ObjectReference defaultObjectReference;
WorkingTimeCalculator converter;
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId(), task3.getId()).list();
assertThat(result).extracting(TaskSummary::getPlanned).containsOnly(planned);
}
@Override
public Builder modify(Builder builder) {
return builder.useWorkingTimeCalculation(false);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndClassificationHasSmallerServiceLevel()
throws Exception {
Instant planned = Instant.parse("2020-05-04T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId());
@WithAccessId(user = "businessadmin")
@BeforeAll
void setup() throws Exception {
classificationSummarySmallServiceLevel =
defaultTestClassification()
.serviceLevel(SMALL_CLASSIFICATION_SERVICE_LEVEL)
.buildAndStoreAsSummary(classificationService);
classificationSummaryGreatServiceLevel =
defaultTestClassification()
.serviceLevel(GREAT_CLASSIFICATION_SERVICE_LEVEL)
.buildAndStoreAsSummary(classificationService);
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
defaultObjectReference = defaultTestObjectReference().build();
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId()).list();
Instant expectedDue = Instant.parse("2020-05-06T06:59:59.999Z");
assertThat(result).extracting(TaskSummary::getDue).containsOnly(expectedDue);
}
attachmentSummarySmallServiceLevel =
TaskAttachmentBuilder.newAttachment()
.classificationSummary(classificationSummarySmallServiceLevel)
.objectReference(defaultObjectReference)
.build();
attachmentSummaryGreatServiceLevel =
TaskAttachmentBuilder.newAttachment()
.classificationSummary(classificationSummaryGreatServiceLevel)
.objectReference(defaultObjectReference)
.build();
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndAttachmentHasSmallerOrEqualServiceLevel()
throws Exception {
Instant planned = Instant.parse("2020-05-04T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId());
defaultWorkbasketSummary = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(defaultWorkbasketSummary.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
converter = taskanaEngine.getWorkingTimeCalculator();
}
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
@WithAccessId(user = "user-1-1")
@Test
void should_SetPlannedOnMultipleTasks() throws Exception {
Instant planned = Instant.parse("2020-05-03T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task3 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId(), task3.getId());
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId()).list();
Instant expectedDue = Instant.parse("2020-05-06T06:59:59.999Z");
assertThat(result).extracting(TaskSummary::getDue).containsOnly(expectedDue);
}
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndUsingDifferentServiceLevels() throws Exception {
Instant planned = Instant.parse("2020-05-04T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task3 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId(), task3.getId());
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId(), task3.getId()).list();
assertThat(result).extracting(TaskSummary::getPlanned).containsOnly(planned);
}
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndClassificationHasSmallerServiceLevel()
throws Exception {
Instant planned = Instant.parse("2020-05-03T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId());
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId(), task3.getId()).list();
Instant expectedDueSmallServiceLevel = Instant.parse("2020-05-06T06:59:59.999Z");
Instant expectedDueGreatServiceLevel = Instant.parse("2020-05-13T06:59:59.999Z");
assertThat(result)
.extracting(TaskSummary::getDue)
.containsOnly(expectedDueSmallServiceLevel, expectedDueGreatServiceLevel);
}
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
private TaskBuilder createDefaultTask() {
return (TaskBuilder.newTask()
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference));
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId()).list();
assertThat(result)
.extracting(TaskSummary::getDue)
.containsOnly(
converter.addWorkingTime(
planned, Duration.parse(SMALL_CLASSIFICATION_SERVICE_LEVEL)));
}
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndAttachmentHasSmallerOrEqualServiceLevel()
throws Exception {
Instant planned = Instant.parse("2020-05-03T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId());
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId()).list();
assertThat(result)
.extracting(TaskSummary::getDue)
.containsOnly(
converter.addWorkingTime(
planned, Duration.parse(SMALL_CLASSIFICATION_SERVICE_LEVEL)));
}
@WithAccessId(user = "user-1-1")
@Test
void should_ChangeDue_When_SettingPlannedAndUsingDifferentServiceLevels() throws Exception {
Instant planned = Instant.parse("2020-05-03T07:00:00.000Z");
TaskSummary task1 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummarySmallServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task2 =
createDefaultTask()
.classificationSummary(classificationSummarySmallServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
TaskSummary task3 =
createDefaultTask()
.classificationSummary(classificationSummaryGreatServiceLevel)
.attachments(attachmentSummaryGreatServiceLevel.copy())
.buildAndStoreAsSummary(taskService);
List<String> taskIds = List.of(task1.getId(), task2.getId(), task3.getId());
BulkOperationResults<String, TaskanaException> bulkLog =
taskService.setPlannedPropertyOfTasks(planned, taskIds);
assertThat(bulkLog.containsErrors()).isFalse();
List<TaskSummary> result =
taskService.createTaskQuery().idIn(task1.getId(), task2.getId(), task3.getId()).list();
assertThat(result)
.extracting(TaskSummary::getDue)
.containsOnly(
converter.addWorkingTime(planned, Duration.parse(SMALL_CLASSIFICATION_SERVICE_LEVEL)),
converter.addWorkingTime(
planned, Duration.parse(GREAT_CLASSIFICATION_SERVICE_LEVEL)));
}
private TaskBuilder createDefaultTask() {
return (TaskBuilder.newTask()
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference));
}
}
}

View File

@ -8,15 +8,21 @@ import static pro.taskana.testapi.DefaultTestEntities.defaultTestObjectReference
import static pro.taskana.testapi.DefaultTestEntities.defaultTestWorkbasket;
import java.time.Instant;
import java.util.List;
import java.util.stream.Stream;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.function.ThrowingConsumer;
import pro.taskana.TaskanaConfiguration;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.classification.api.models.ClassificationSummary;
import pro.taskana.common.internal.util.Triplet;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.TaskState;
import pro.taskana.task.api.exceptions.InvalidOwnerException;
@ -37,7 +43,7 @@ import pro.taskana.workbasket.api.exceptions.NotAuthorizedOnWorkbasketException;
import pro.taskana.workbasket.api.models.WorkbasketSummary;
@TaskanaIntegrationTest
class ClaimTaskAccTest {
class ClaimTaskAccTest implements TaskanaConfigurationModifier {
@TaskanaInject TaskService taskService;
@TaskanaInject ClassificationService classificationService;
@TaskanaInject WorkbasketService workbasketService;
@ -46,6 +52,14 @@ class ClaimTaskAccTest {
ClassificationSummary defaultClassificationSummary;
WorkbasketSummary defaultWorkbasketSummary;
ObjectReference defaultObjectReference;
WorkbasketSummary wbWithoutEditTasks;
WorkbasketSummary wbWithoutReadTasks;
WorkbasketSummary wbWithoutRead;
@Override
public TaskanaConfiguration.Builder modify(TaskanaConfiguration.Builder builder) {
return builder.addAdditionalUserInfo(true);
}
@WithAccessId(user = "businessadmin")
@BeforeAll
@ -53,12 +67,44 @@ class ClaimTaskAccTest {
defaultClassificationSummary =
defaultTestClassification().buildAndStoreAsSummary(classificationService);
defaultWorkbasketSummary = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutEditTasks = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutReadTasks = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutRead = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(defaultWorkbasketSummary.getId())
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutEditTasks.getId())
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutReadTasks.getId())
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutRead.getId())
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
@ -239,27 +285,49 @@ class ClaimTaskAccTest {
assertThat(claimedTask.getOwner()).isEqualTo("user-1-2");
}
@WithAccessId(user = "user-taskrouter")
@Test
void should_ThrowNotAuthorizedException_When_UserHasNoReadPermissionAndTaskIsReady()
@WithAccessId(user = "user-1-2")
@TestFactory
Stream<DynamicTest> should_ThrowException_When_ForceClaimingTaskWithMissingPermission()
throws Exception {
Task task =
TaskBuilder.newTask()
.state(TaskState.READY)
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference)
.buildAndStore(taskService, "user-1-2");
List<Triplet<String, WorkbasketSummary, WorkbasketPermission>> list =
List.of(
Triplet.of("With Missing Read Permission", wbWithoutRead, WorkbasketPermission.READ),
Triplet.of(
"With Missing ReadTasks Permission",
wbWithoutReadTasks,
WorkbasketPermission.READTASKS),
Triplet.of(
"With Missing EditTasks Permission",
wbWithoutEditTasks,
WorkbasketPermission.EDITTASKS));
ThrowingConsumer<Triplet<String, WorkbasketSummary, WorkbasketPermission>> testClaimTask =
t -> {
String anyUserName = "TestUser28";
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(t.getMiddle())
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.state(TaskState.CLAIMED)
.owner(anyUserName)
.buildAndStore(taskService, "admin");
ThrowingCallable call = () -> taskService.claim(task.getId());
ThrowingCallable call = () -> taskService.forceClaim(task.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
assertThat(e.getCurrentUserId()).isEqualTo("user-taskrouter");
assertThat(e.getWorkbasketId()).isEqualTo(defaultWorkbasketSummary.getId());
assertThat(e.getRequiredPermissions()).containsExactlyInAnyOrder(WorkbasketPermission.READ);
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
;
if (t.getRight() != WorkbasketPermission.EDITTASKS) {
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(
WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
} else {
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.EDITTASKS);
}
assertThat(e.getCurrentUserId()).isEqualTo("user-1-2");
assertThat(e.getWorkbasketId()).isEqualTo(t.getMiddle().getId());
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testClaimTask);
}
@WithAccessId(user = "user-taskrouter")
@ -280,7 +348,8 @@ class ClaimTaskAccTest {
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
assertThat(e.getCurrentUserId()).isEqualTo("user-taskrouter");
assertThat(e.getWorkbasketId()).isEqualTo(defaultWorkbasketSummary.getId());
assertThat(e.getRequiredPermissions()).containsExactlyInAnyOrder(WorkbasketPermission.READ);
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
}
@WithAccessId(user = "user-1-2")
@ -291,6 +360,7 @@ class ClaimTaskAccTest {
.state(TaskState.CLAIMED)
.claimed(Instant.now())
.owner("user-1-2")
.ownerLongName("Long Name")
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference)
@ -303,6 +373,53 @@ class ClaimTaskAccTest {
assertThat(unclaimedTask.getClaimed()).isNull();
assertThat(unclaimedTask.isRead()).isTrue();
assertThat(unclaimedTask.getOwner()).isNull();
assertThat(unclaimedTask.getOwnerLongName()).isNull();
}
@WithAccessId(user = "user-1-2")
@Test
void should_KeepOwnerAndOwnerLongName_When_CancelClaimWithKeepOwner() throws Exception {
Task claimedTask =
TaskBuilder.newTask()
.state(TaskState.CLAIMED)
.claimed(Instant.now())
.owner("user-1-2")
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference)
.buildAndStore(taskService);
Task unclaimedTask = taskService.cancelClaim(claimedTask.getId(), true);
assertThat(unclaimedTask).isNotNull();
assertThat(unclaimedTask.getState()).isEqualTo(TaskState.READY);
assertThat(unclaimedTask.getClaimed()).isNull();
assertThat(unclaimedTask.isRead()).isTrue();
assertThat(unclaimedTask.getOwner()).isEqualTo("user-1-2");
assertThat(unclaimedTask.getOwnerLongName()).isEqualTo("Long name of user-1-2");
}
@WithAccessId(user = "user-1-2")
@Test
void should_KeepOwnerAndOwnerLongName_When_ForceCancelClaimWithKeepOwner() throws Exception {
Task claimedTask =
TaskBuilder.newTask()
.state(TaskState.CLAIMED)
.claimed(Instant.now())
.owner("user-1-2")
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference)
.buildAndStore(taskService);
Task unclaimedTask = taskService.forceCancelClaim(claimedTask.getId(), true);
assertThat(unclaimedTask).isNotNull();
assertThat(unclaimedTask.getState()).isEqualTo(TaskState.READY);
assertThat(unclaimedTask.getClaimed()).isNull();
assertThat(unclaimedTask.isRead()).isTrue();
assertThat(unclaimedTask.getOwner()).isEqualTo("user-1-2");
assertThat(unclaimedTask.getOwnerLongName()).isEqualTo("Long name of user-1-2");
}
@WithAccessId(user = "user-1-2")
@ -367,6 +484,51 @@ class ClaimTaskAccTest {
assertThat(e.getTaskId()).isEqualTo(claimedTask.getId());
}
@WithAccessId(user = "user-1-2")
@TestFactory
Stream<DynamicTest> should_ThrowException_When_CancelClaimingTaskWithMissingPermission()
throws Exception {
List<Triplet<String, WorkbasketSummary, WorkbasketPermission>> list =
List.of(
Triplet.of("With Missing Read Permission", wbWithoutRead, WorkbasketPermission.READ),
Triplet.of(
"With Missing ReadTasks Permission",
wbWithoutReadTasks,
WorkbasketPermission.READTASKS),
Triplet.of(
"With Missing EditTasks Permission",
wbWithoutEditTasks,
WorkbasketPermission.EDITTASKS));
ThrowingConsumer<Triplet<String, WorkbasketSummary, WorkbasketPermission>> testCancelClaimTask =
t -> {
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(t.getMiddle())
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.state(TaskState.CLAIMED)
.owner("user-1-2")
.buildAndStore(taskService, "admin");
task.setNote("Test Note");
ThrowingCallable call = () -> taskService.cancelClaim(task.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
if (t.getRight() != WorkbasketPermission.EDITTASKS) {
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(
WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
} else {
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.EDITTASKS);
}
assertThat(e.getCurrentUserId()).isEqualTo("user-1-2");
assertThat(e.getWorkbasketId()).isEqualTo(t.getMiddle().getId());
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testCancelClaimTask);
}
@WithAccessId(user = "user-1-2")
@Test
void should_ForceCancelClaim_When_TaskClaimedByAnotherUser() throws Exception {
@ -411,6 +573,51 @@ class ClaimTaskAccTest {
assertThat(unclaimedTask.getOwner()).isNull();
}
@WithAccessId(user = "user-1-2")
@TestFactory
Stream<DynamicTest> should_ThrowException_When_ForceCancelClaimingTaskWithMissingPermission()
throws Exception {
List<Triplet<String, WorkbasketSummary, WorkbasketPermission>> list =
List.of(
Triplet.of("With Missing Read Permission", wbWithoutRead, WorkbasketPermission.READ),
Triplet.of(
"With Missing ReadTasks Permission",
wbWithoutReadTasks,
WorkbasketPermission.READTASKS),
Triplet.of(
"With Missing EditTasks Permission",
wbWithoutEditTasks,
WorkbasketPermission.EDITTASKS));
ThrowingConsumer<Triplet<String, WorkbasketSummary, WorkbasketPermission>> testCancelClaimTask =
t -> {
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(t.getMiddle())
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.state(TaskState.CLAIMED)
.owner("user-1-2")
.buildAndStore(taskService, "admin");
task.setNote("Test Note");
ThrowingCallable call = () -> taskService.forceCancelClaim(task.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
if (t.getRight() != WorkbasketPermission.EDITTASKS) {
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(
WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
} else {
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.EDITTASKS);
}
assertThat(e.getCurrentUserId()).isEqualTo("user-1-2");
assertThat(e.getWorkbasketId()).isEqualTo(t.getMiddle().getId());
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testCancelClaimTask);
}
@WithAccessId(user = "user-1-2")
@Test
void should_ClaimTask_When_OwnerOfReadyForReviewTaskIsSet() throws Exception {
@ -449,6 +656,51 @@ class ClaimTaskAccTest {
assertThat(taskClaimed.getOwner()).isEqualTo("user-1-2");
}
@WithAccessId(user = "user-1-2")
@TestFactory
Stream<DynamicTest> should_ThrowException_When_ClaimingTaskWithMissingPermission()
throws Exception {
List<Triplet<String, WorkbasketSummary, WorkbasketPermission>> list =
List.of(
Triplet.of("With Missing Read Permission", wbWithoutRead, WorkbasketPermission.READ),
Triplet.of(
"With Missing ReadTasks Permission",
wbWithoutReadTasks,
WorkbasketPermission.READTASKS),
Triplet.of(
"With Missing EditTasks Permission",
wbWithoutEditTasks,
WorkbasketPermission.EDITTASKS));
ThrowingConsumer<Triplet<String, WorkbasketSummary, WorkbasketPermission>> testClaimTask =
t -> {
String anyUserName = "TestUser28";
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(t.getMiddle())
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.state(TaskState.READY)
.owner(anyUserName)
.buildAndStore(taskService, "admin");
ThrowingCallable call = () -> taskService.claim(task.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
if (t.getRight() != WorkbasketPermission.EDITTASKS) {
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(
WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
} else {
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.EDITTASKS);
}
assertThat(e.getCurrentUserId()).isEqualTo("user-1-2");
assertThat(e.getWorkbasketId()).isEqualTo(t.getMiddle().getId());
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testClaimTask);
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
class WithAdditionalUserInfoEnabled implements TaskanaConfigurationModifier {

View File

@ -56,6 +56,8 @@ class SetOwnerAccTest {
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
@ -117,7 +119,8 @@ class SetOwnerAccTest {
catchThrowableOfType(call2, NotAuthorizedOnWorkbasketException.class);
assertThat(e2.getWorkbasketId()).isEqualTo(defaultWorkbasketSummary.getId());
assertThat(e2.getCurrentUserId()).isEqualTo("user-1-1");
assertThat(e2.getRequiredPermissions()).containsExactly(WorkbasketPermission.READ);
assertThat(e2.getRequiredPermissions())
.containsExactly(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
}
@WithAccessId(user = "user-1-2")

View File

@ -6,18 +6,23 @@ import static pro.taskana.testapi.DefaultTestEntities.defaultTestClassification;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestObjectReference;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestWorkbasket;
import acceptance.task.complete.CompleteTaskWithSpiAccTest.SetCustomAttributeToEndstate;
import java.util.List;
import java.util.stream.Stream;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.function.ThrowingConsumer;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.classification.api.models.ClassificationSummary;
import pro.taskana.common.internal.util.Triplet;
import pro.taskana.spi.task.api.TaskEndstatePreprocessor;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.TaskState;
import pro.taskana.task.api.exceptions.InvalidTaskStateException;
@ -26,6 +31,7 @@ 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.testapi.builder.WorkbasketAccessItemBuilder;
import pro.taskana.testapi.security.WithAccessId;
@ -58,6 +64,7 @@ class CancelTaskAccTest {
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
@ -130,7 +137,8 @@ class CancelTaskAccTest {
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.READ);
assertThat(e.getRequiredPermissions())
.containsExactly(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
assertThat(e.getCurrentUserId()).isEqualTo("user-taskrouter");
assertThat(e.getWorkbasketId()).isEqualTo(defaultWorkbasketSummary.getId());
}
@ -180,4 +188,33 @@ class CancelTaskAccTest {
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testCancelTask);
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
@WithServiceProvider(
serviceProviderInterface = TaskEndstatePreprocessor.class,
serviceProviders = SetCustomAttributeToEndstate.class)
class ServiceProviderSetsCustomAttributeToCancelled {
@TaskanaInject TaskService taskService;
@WithAccessId(user = "user-1-2")
@Test
void should_SetCustomAttribute_When_UserCancelsTask() throws Exception {
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(defaultWorkbasketSummary)
.state(TaskState.CLAIMED)
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.buildAndStore(taskService);
Task processedTask = taskService.cancelTask(task.getId());
assertThat(processedTask.getState()).isEqualTo(TaskState.CANCELLED);
assertThat(processedTask.getCustomAttributeMap())
.containsEntry(
"camunda:attribute1",
"{\"valueInfo\":{\"objectTypeName\":\"java.lang.String\"},"
+ "\"type\":\"String\",\"value\":\"CANCELLED\"}");
}
}
}

View File

@ -11,10 +11,14 @@ import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.function.ThrowingConsumer;
import pro.taskana.TaskanaConfiguration;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.classification.api.models.ClassificationSummary;
@ -24,6 +28,7 @@ import pro.taskana.common.api.exceptions.InvalidArgumentException;
import pro.taskana.common.api.exceptions.TaskanaException;
import pro.taskana.common.api.security.CurrentUserContext;
import pro.taskana.common.internal.util.EnumUtil;
import pro.taskana.common.internal.util.Triplet;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.TaskState;
import pro.taskana.task.api.exceptions.InvalidOwnerException;
@ -58,6 +63,9 @@ class CompleteTaskAccTest implements TaskanaConfigurationModifier {
ClassificationSummary defaultClassificationSummary;
WorkbasketSummary defaultWorkbasketSummary;
ObjectReference defaultObjectReference;
WorkbasketSummary wbWithoutEditTasks;
WorkbasketSummary wbWithoutReadTasks;
WorkbasketSummary wbWithoutRead;
@Override
public TaskanaConfiguration.Builder modify(TaskanaConfiguration.Builder builder) {
@ -71,11 +79,43 @@ class CompleteTaskAccTest implements TaskanaConfigurationModifier {
defaultClassificationSummary =
defaultTestClassification().buildAndStoreAsSummary(classificationService);
defaultWorkbasketSummary = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutEditTasks = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutReadTasks = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutRead = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(defaultWorkbasketSummary.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutEditTasks.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutReadTasks.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutRead.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
@ -192,6 +232,52 @@ class CompleteTaskAccTest implements TaskanaConfigurationModifier {
assertTaskIsComplete(before, completedTask);
}
@WithAccessId(user = "user-1-1")
@TestFactory
Stream<DynamicTest> should_ThrowException_When_ForceCompleteTaskWithMissingPermission()
throws Exception {
List<Triplet<String, WorkbasketSummary, WorkbasketPermission>> list =
List.of(
Triplet.of("With Missing Read Permission", wbWithoutRead, WorkbasketPermission.READ),
Triplet.of(
"With Missing ReadTasks Permission",
wbWithoutReadTasks,
WorkbasketPermission.READTASKS),
Triplet.of(
"With Missing EditTasks Permission",
wbWithoutEditTasks,
WorkbasketPermission.EDITTASKS));
ThrowingConsumer<Triplet<String, WorkbasketSummary, WorkbasketPermission>> testCompleteTask =
t -> {
String anyUserName = "TestUser28";
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(t.getMiddle())
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.state(TaskState.READY_FOR_REVIEW)
.owner(anyUserName)
.buildAndStore(taskService, "admin");
ThrowingCallable call = () -> taskService.forceCompleteTask(task.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
if (t.getRight() != WorkbasketPermission.EDITTASKS) {
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(
WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
} else {
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(WorkbasketPermission.EDITTASKS);
}
assertThat(e.getCurrentUserId()).isEqualTo("user-1-1");
assertThat(e.getWorkbasketId()).isEqualTo(t.getMiddle().getId());
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testCompleteTask);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_CompletingNonExistingTask() {
@ -217,7 +303,8 @@ class CompleteTaskAccTest implements TaskanaConfigurationModifier {
assertThat(e.getCurrentUserId()).isEqualTo(currentUserContext.getUserid());
WorkbasketSummary workbasket = claimedTask.getWorkbasketSummary();
assertThat(e.getWorkbasketId()).isEqualTo(workbasket.getId());
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.READ);
assertThat(e.getRequiredPermissions())
.containsExactly(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
}
@WithAccessId(user = "user-1-1")
@ -686,6 +773,50 @@ class CompleteTaskAccTest implements TaskanaConfigurationModifier {
assertTaskIsComplete(beforeBulkComplete, completedTask2);
}
@WithAccessId(user = "user-1-1")
@TestFactory
Stream<DynamicTest> should_ThrowException_When_CompleteTaskWithMissingPermission()
throws Exception {
List<Triplet<String, WorkbasketSummary, WorkbasketPermission>> list =
List.of(
Triplet.of("With Missing Read Permission", wbWithoutRead, WorkbasketPermission.READ),
Triplet.of(
"With Missing ReadTasks Permission",
wbWithoutReadTasks,
WorkbasketPermission.READTASKS),
Triplet.of(
"With Missing EditTasks Permission",
wbWithoutEditTasks,
WorkbasketPermission.EDITTASKS));
ThrowingConsumer<Triplet<String, WorkbasketSummary, WorkbasketPermission>> testCompleteTask =
t -> {
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(t.getMiddle())
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.state(TaskState.CLAIMED)
.claimed(Instant.now())
.owner("user-1-1")
.buildAndStore(taskService, "admin");
ThrowingCallable call = () -> taskService.completeTask(task.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
if (t.getRight() != WorkbasketPermission.EDITTASKS) {
assertThat(e.getRequiredPermissions())
.containsExactly(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
} else {
assertThat(e.getRequiredPermissions()).containsExactly(WorkbasketPermission.EDITTASKS);
}
assertThat(e.getCurrentUserId()).isEqualTo("user-1-1");
assertThat(e.getWorkbasketId()).isEqualTo(t.getMiddle().getId());
};
return DynamicTest.stream(list.iterator(), Triplet::getLeft, testCompleteTask);
}
private void assertTaskIsComplete(Instant before, Task completedTask) {
assertThat(completedTask).isNotNull();
assertThat(completedTask.getState()).isEqualTo(TaskState.COMPLETED);

View File

@ -10,6 +10,7 @@ import java.util.stream.Stream;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
@ -17,6 +18,7 @@ import org.junit.jupiter.api.function.ThrowingConsumer;
import pro.taskana.classification.api.ClassificationService;
import pro.taskana.classification.api.models.ClassificationSummary;
import pro.taskana.spi.task.api.ReviewRequiredProvider;
import pro.taskana.spi.task.api.TaskEndstatePreprocessor;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.TaskState;
import pro.taskana.task.api.models.ObjectReference;
@ -54,6 +56,8 @@ class CompleteTaskWithSpiAccTest {
.workbasketId(defaultWorkbasketSummary.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.EDITTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
@ -89,6 +93,21 @@ class CompleteTaskWithSpiAccTest {
}
}
static class SetCustomAttributeToEndstate implements TaskEndstatePreprocessor {
@Override
public Task processTaskBeforeEndstate(Task task) {
String endstate = task.getState().toString();
task.getCustomAttributeMap()
.put(
"camunda:attribute1",
"{\"valueInfo\":{\"objectTypeName\":\"java.lang.String\"},"
+ "\"type\":\"String\",\"value\":\""
+ endstate
+ "\"}");
return task;
}
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
@WithServiceProvider(
@ -169,4 +188,27 @@ class CompleteTaskWithSpiAccTest {
tasks.iterator(), t -> "Try to complete " + t.getState().name() + " Task", test);
}
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
@WithServiceProvider(
serviceProviderInterface = TaskEndstatePreprocessor.class,
serviceProviders = SetCustomAttributeToEndstate.class)
class ServiceProviderSetsCustomAttributeToCompleted {
@TaskanaInject TaskService taskService;
@WithAccessId(user = "user-1-1")
@Test
void should_SetCustomAttribute_When_UserCompletesTask() throws Exception {
Task task = createTaskClaimedByUser("user-1-1").buildAndStore(taskService);
Task processedTask = taskService.completeTask(task.getId());
assertThat(processedTask.getState()).isEqualTo(TaskState.COMPLETED);
assertThat(processedTask.getCustomAttributeMap())
.containsEntry(
"camunda:attribute1",
"{\"valueInfo\":{\"objectTypeName\":\"java.lang.String\"},"
+ "\"type\":\"String\",\"value\":\"COMPLETED\"}");
}
}
}

View File

@ -5,12 +5,17 @@ import static org.assertj.core.api.Assertions.catchThrowableOfType;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestClassification;
import static pro.taskana.testapi.DefaultTestEntities.defaultTestWorkbasket;
import acceptance.task.complete.CompleteTaskWithSpiAccTest.SetCustomAttributeToEndstate;
import java.util.List;
import java.util.stream.Stream;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.function.ThrowingConsumer;
import pro.taskana.classification.api.ClassificationService;
@ -19,6 +24,7 @@ import pro.taskana.common.api.TaskanaRole;
import pro.taskana.common.api.exceptions.NotAuthorizedException;
import pro.taskana.common.api.security.CurrentUserContext;
import pro.taskana.common.internal.util.Triplet;
import pro.taskana.spi.task.api.TaskEndstatePreprocessor;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.api.TaskState;
import pro.taskana.task.api.exceptions.InvalidTaskStateException;
@ -26,6 +32,7 @@ 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.testapi.builder.WorkbasketAccessItemBuilder;
import pro.taskana.testapi.security.WithAccessId;
@ -157,4 +164,33 @@ class TerminateTaskAccTest {
return DynamicTest.stream(testValues.iterator(), Triplet::getLeft, test);
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
@WithServiceProvider(
serviceProviderInterface = TaskEndstatePreprocessor.class,
serviceProviders = SetCustomAttributeToEndstate.class)
class ServiceProviderSetsCustomAttributeToTerminated {
@TaskanaInject TaskService taskService;
@WithAccessId(user = "admin")
@Test
void should_SetCustomAttribute_When_UserTerminatesTask() throws Exception {
Task task =
TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.workbasketSummary(defaultWorkbasketSummary)
.state(TaskState.READY)
.primaryObjRef(DefaultTestEntities.defaultTestObjectReference().build())
.buildAndStore(taskService);
Task processedTask = taskService.terminateTask(task.getId());
assertThat(processedTask.getState()).isEqualTo(TaskState.TERMINATED);
assertThat(processedTask.getCustomAttributeMap())
.containsEntry(
"camunda:attribute1",
"{\"valueInfo\":{\"objectTypeName\":\"java.lang.String\"},"
+ "\"type\":\"String\",\"value\":\"TERMINATED\"}");
}
}
}

View File

@ -85,6 +85,7 @@ class CreateTaskAccTest {
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
defaultObjectReference = defaultTestObjectReference().build();
@ -332,12 +333,11 @@ class CreateTaskAccTest {
Instant earlierInstant = Instant.parse("2018-01-12T00:00:00Z");
Instant laterInstant = Instant.parse("2018-01-15T00:00:00Z");
Task task = createDefaultTask();
Attachment attachment =
TaskAttachmentBuilder.newAttachment()
.objectReference(defaultObjectReference)
.classificationSummary(defaultClassificationSummary)
.created(Instant.now())
.modified(Instant.now())
.received(laterInstant)
.channel("E-MAIL")
.build();
@ -345,8 +345,6 @@ class CreateTaskAccTest {
TaskAttachmentBuilder.newAttachment()
.objectReference(defaultObjectReference)
.classificationSummary(defaultClassificationSummary)
.created(Instant.now())
.modified(Instant.now())
.received(earlierInstant)
.channel("E-MAIL")
.build();

View File

@ -56,6 +56,7 @@ class CreateTaskWithSorAccTest {
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
defaultObjectReference = defaultTestObjectReference().build();

View File

@ -64,6 +64,7 @@ class DeleteTaskAccTest {
.accessId("user-1-2")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
task1 =

View File

@ -56,6 +56,7 @@ class DeleteTaskWithSorAccTest {
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
defaultObjectReference = defaultTestObjectReference().build();

View File

@ -52,8 +52,12 @@ class GetTaskAccTest {
ClassificationSummary defaultClassificationSummary;
WorkbasketSummary defaultWorkbasketSummary;
WorkbasketSummary wbWithoutReadTasksPerm;
WorkbasketSummary wbWithoutReadPerm;
ObjectReference defaultObjectReference;
Task task;
Task task2;
Task task3;
Map<String, String> callbackInfo;
@WithAccessId(user = "admin")
@ -62,6 +66,8 @@ class GetTaskAccTest {
defaultClassificationSummary =
defaultTestClassification().buildAndStoreAsSummary(classificationService);
defaultWorkbasketSummary = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutReadTasksPerm = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
wbWithoutReadPerm = defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService);
defaultObjectReference = defaultTestObjectReference().build();
callbackInfo = createSimpleCustomPropertyMap(3);
@ -70,6 +76,21 @@ class GetTaskAccTest {
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutReadTasksPerm.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutReadPerm.getId())
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
@ -123,6 +144,20 @@ class GetTaskAccTest {
.workbasketSummary(defaultWorkbasketSummary)
.primaryObjRef(defaultObjectReference)
.buildAndStore(taskService);
task2 =
TaskBuilder.newTask()
.workbasketSummary(wbWithoutReadTasksPerm)
.classificationSummary(defaultClassificationSummary)
.primaryObjRef(defaultObjectReference)
.buildAndStore(taskService);
task3 =
TaskBuilder.newTask()
.workbasketSummary(wbWithoutReadPerm)
.classificationSummary(defaultClassificationSummary)
.primaryObjRef(defaultObjectReference)
.buildAndStore(taskService);
}
@WithAccessId(user = "user-1-1")
@ -183,6 +218,34 @@ class GetTaskAccTest {
.hasNoNullFieldsOrPropertiesExcept("ownerLongName", "completed", "groupByCount");
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_NoReadTasksPerm() {
ThrowingCallable call = () -> taskService.getTask(task2.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
assertThat(e.getCurrentUserId()).isEqualTo("user-1-1");
assertThat(e.getWorkbasketId()).isEqualTo(wbWithoutReadTasksPerm.getId());
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_UserHasReadTasksButNoReadPerm() {
ThrowingCallable call = () -> taskService.getTask(task3.getId());
NotAuthorizedOnWorkbasketException e =
catchThrowableOfType(call, NotAuthorizedOnWorkbasketException.class);
assertThat(e.getRequiredPermissions())
.containsExactlyInAnyOrder(WorkbasketPermission.READ, WorkbasketPermission.READTASKS);
assertThat(e.getCurrentUserId()).isEqualTo("user-1-1");
assertThat(e.getWorkbasketId()).isEqualTo(wbWithoutReadPerm.getId());
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_RequestedTaskByIdIsNotExisting() {

View File

@ -45,6 +45,7 @@ class GetTaskWithSorAccTest {
.accessId("user-1-1")
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService);
defaultObjectReference = defaultTestObjectReference().build();

View File

@ -47,6 +47,7 @@ import pro.taskana.testapi.builder.WorkbasketAccessItemBuilder;
import pro.taskana.testapi.security.WithAccessId;
import pro.taskana.workbasket.api.WorkbasketPermission;
import pro.taskana.workbasket.api.WorkbasketService;
import pro.taskana.workbasket.api.exceptions.NotAuthorizedToQueryWorkbasketException;
import pro.taskana.workbasket.api.models.WorkbasketSummary;
@TaskanaIntegrationTest
@ -93,6 +94,7 @@ class TaskQueryImplAccTest {
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.APPEND)
.permission(WorkbasketPermission.READTASKS)
.buildAndStore(workbasketService, "businessadmin");
}
@ -102,11 +104,17 @@ class TaskQueryImplAccTest {
WorkbasketSummary wb1;
WorkbasketSummary wb2;
WorkbasketSummary wbWithoutPermissions;
WorkbasketSummary wbWithoutReadTasksPerm;
WorkbasketSummary wbWithoutReadPerm;
WorkbasketSummary wbWithoutOpenPerm;
TaskSummary taskSummary1;
TaskSummary taskSummary2;
TaskSummary taskSummary3;
TaskSummary taskSummary4;
TaskSummary taskSummary5;
TaskSummary taskSummary6;
TaskSummary taskSummary7;
TaskSummary taskSummary8;
@WithAccessId(user = "user-1-1")
@BeforeAll
@ -115,6 +123,34 @@ class TaskQueryImplAccTest {
wb2 = createWorkbasketWithPermission();
wbWithoutPermissions =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService, "businessadmin");
wbWithoutReadTasksPerm =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService, "businessadmin");
wbWithoutReadPerm =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService, "businessadmin");
wbWithoutOpenPerm =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService, "businessadmin");
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutReadTasksPerm.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutReadPerm.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(wbWithoutOpenPerm.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
taskSummary1 = taskInWorkbasket(wb1).buildAndStoreAsSummary(taskService);
taskSummary2 = taskInWorkbasket(wb2).buildAndStoreAsSummary(taskService);
@ -124,6 +160,12 @@ class TaskQueryImplAccTest {
taskInWorkbasket(wbWithoutPermissions).buildAndStoreAsSummary(taskService, "admin");
taskSummary5 =
taskInWorkbasket(wbWithoutPermissions).buildAndStoreAsSummary(taskService, "admin");
taskSummary6 =
taskInWorkbasket(wbWithoutReadTasksPerm).buildAndStoreAsSummary(taskService, "admin");
taskSummary7 =
taskInWorkbasket(wbWithoutReadPerm).buildAndStoreAsSummary(taskService, "admin");
taskSummary8 =
taskInWorkbasket(wbWithoutOpenPerm).buildAndStoreAsSummary(taskService, "admin");
}
@WithAccessId(user = "admin")
@ -167,6 +209,66 @@ class TaskQueryImplAccTest {
.contains(taskSummary1, taskSummary2)
.doesNotContain(taskSummary3, taskSummary4, taskSummary5);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ReturnEmptyList_When_WorkbasketOfTaskHasNoReadTasksPerm() {
List<TaskSummary> list = taskService.createTaskQuery().idIn(taskSummary3.getId()).list();
assertThat(list).isEmpty();
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_QueryByWorkbasketThatHasOpenReadButNoReadTasksPermission() {
ThrowingCallable call =
() -> taskService.createTaskQuery().workbasketIdIn(wbWithoutReadTasksPerm.getId()).list();
assertThatThrownBy(call).isInstanceOf(NotAuthorizedToQueryWorkbasketException.class);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ReturnEmptyList_When_WorkbasketOfTaskHasReadTasksButNoReadPerm() {
List<TaskSummary> list = taskService.createTaskQuery().idIn(taskSummary7.getId()).list();
assertThat(list).isEmpty();
}
@WithAccessId(user = "user-1-1")
@Test
void should_QueryByTaskId_When_WorkbasketHasReadAndReadTasksButNoOpenPerm() {
List<TaskSummary> list = taskService.createTaskQuery().idIn(taskSummary8.getId()).list();
assertThat(list).containsOnly(taskSummary8);
}
@WithAccessId(user = "user-1-1")
@Test
void should_OnlyReturnTaskFromWorkbasketWithoutOpenPerm_When_OthersHasNoReadOrReadTasksPerm() {
List<TaskSummary> list =
taskService
.createTaskQuery()
.idIn(taskSummary6.getId(), taskSummary7.getId(), taskSummary8.getId())
.list();
assertThat(list).containsOnly(taskSummary8);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_QueryByWbIdAndWorkbasketHasReadTasksButNoReadPerm() {
ThrowingCallable call =
() -> taskService.createTaskQuery().workbasketIdIn(wbWithoutReadPerm.getId()).list();
assertThatThrownBy(call).isInstanceOf(NotAuthorizedToQueryWorkbasketException.class);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ThrowException_When_QueryByWbIdAndWorkbasketHasReadAndReadTasksButNoOpenPerm() {
ThrowingCallable call =
() -> taskService.createTaskQuery().workbasketIdIn(wbWithoutOpenPerm.getId()).list();
assertThatThrownBy(call).isInstanceOf(NotAuthorizedToQueryWorkbasketException.class);
}
}
@Nested
@ -697,9 +799,7 @@ class TaskQueryImplAccTest {
taskInWorkbasket(wb)
.completed(Instant.parse("2020-02-01T00:00:00Z"))
.buildAndStoreAsSummary(taskService);
taskInWorkbasket(wb)
.completed(null)
.buildAndStoreAsSummary(taskService);
taskInWorkbasket(wb).completed(null).buildAndStoreAsSummary(taskService);
}
@WithAccessId(user = "user-1-1")
@ -1714,6 +1814,7 @@ class TaskQueryImplAccTest {
TaskSummary taskSummary1;
TaskSummary taskSummary2;
TaskSummary taskSummary3;
TaskSummary taskSummary4;
@WithAccessId(user = "user-1-1")
@BeforeAll
@ -1722,6 +1823,7 @@ class TaskQueryImplAccTest {
taskSummary1 = taskInWorkbasket(wb).owner("user-2-1").buildAndStoreAsSummary(taskService);
taskSummary2 = taskInWorkbasket(wb).owner("user-1-2").buildAndStoreAsSummary(taskService);
taskSummary3 = taskInWorkbasket(wb).owner("user-1-3").buildAndStoreAsSummary(taskService);
taskSummary4 = taskInWorkbasket(wb).owner(null).buildAndStoreAsSummary(taskService);
}
@WithAccessId(user = "user-1-1")
@ -1759,6 +1861,29 @@ class TaskQueryImplAccTest {
assertThat(list).containsExactly(taskSummary1);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ReturnTaskWithOwnerNull_When_QueryingForOwnerIn() {
String[] nullArray = {null};
List<TaskSummary> list =
taskService.createTaskQuery().workbasketIdIn(wb.getId()).ownerIn(nullArray).list();
assertThat(list).containsExactly(taskSummary4);
}
@WithAccessId(user = "user-1-1")
@Test
void should_ReturnTaskWithOwnerNullAndUser11_When_QueryingForOwnerIn() {
List<TaskSummary> list =
taskService
.createTaskQuery()
.workbasketIdIn(wb.getId())
.ownerIn("user-1-2", null)
.list();
assertThat(list).containsExactlyInAnyOrder(taskSummary2, taskSummary4);
}
}
@Nested

View File

@ -125,30 +125,6 @@ class TaskQueryImplGroupByAccTest implements TaskanaConfigurationModifier {
taskInWorkbasket(createWorkbasketWithPermission()).buildAndStore(taskService);
}
private TaskBuilder taskInWorkbasket(WorkbasketSummary wb) {
return TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.primaryObjRef(defaultTestObjectReference().build())
.workbasketSummary(wb);
}
private WorkbasketSummary createWorkbasketWithPermission() throws Exception {
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService, "businessadmin");
persistPermission(workbasketSummary);
return workbasketSummary;
}
private void persistPermission(WorkbasketSummary workbasketSummary) throws Exception {
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
}
@WithAccessId(user = "user-1-1")
@Test
void should_GroupByPor_When_OrderingByName() {
@ -331,4 +307,29 @@ class TaskQueryImplGroupByAccTest implements TaskanaConfigurationModifier {
.count();
assertThat(numberOfTasks).isEqualTo(1);
}
private TaskBuilder taskInWorkbasket(WorkbasketSummary wb) {
return TaskBuilder.newTask()
.classificationSummary(defaultClassificationSummary)
.primaryObjRef(defaultTestObjectReference().build())
.workbasketSummary(wb);
}
private WorkbasketSummary createWorkbasketWithPermission() throws Exception {
WorkbasketSummary workbasketSummary =
defaultTestWorkbasket().buildAndStoreAsSummary(workbasketService, "businessadmin");
persistPermission(workbasketSummary);
return workbasketSummary;
}
private void persistPermission(WorkbasketSummary workbasketSummary) throws Exception {
WorkbasketAccessItemBuilder.newWorkbasketAccessItem()
.workbasketId(workbasketSummary.getId())
.accessId(currentUserContext.getUserid())
.permission(WorkbasketPermission.OPEN)
.permission(WorkbasketPermission.READ)
.permission(WorkbasketPermission.READTASKS)
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
}
}

Some files were not shown because too many files have changed in this diff Show More