├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── ci_build.yml │ ├── wf0_release.yml │ └── wf1_push-vpw-polling-client-chart.yml ├── .gitignore ├── CLA_corporate.md ├── CLA_individual.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── camunda-kafka-model ├── pom.xml └── src │ └── main │ └── java │ └── de │ └── viadee │ └── camunda │ └── kafka │ └── event │ ├── ActivityInstanceEvent.java │ ├── CommentEvent.java │ ├── DeploymentEvent.java │ ├── DetailEvent.java │ ├── HistoryEvent.java │ ├── IdentityLinkEvent.java │ ├── IncidentEvent.java │ ├── ProcessDefinitionEvent.java │ ├── ProcessInstanceEvent.java │ ├── ScopeInstanceEvent.java │ └── VariableUpdateEvent.java ├── camunda-kafka-polling-client ├── README.md ├── Tutorial 3 Archiving of process data in Kafka.md ├── deployment │ └── helm │ │ └── vpw-polling-client-chart │ │ ├── .helmignore │ │ ├── Chart.yaml │ │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── vpw-polling-client-deployment.yaml │ │ ├── vpw-polling-client-environment-configmap.yaml │ │ ├── vpw-polling-client-environment-secret.yaml │ │ ├── vpw-polling-client-hpa.yaml │ │ ├── vpw-polling-client-pvc.yaml │ │ └── vpw-polling-client-serviceaccount.yaml │ │ └── values.yaml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── de │ │ │ └── viadee │ │ │ └── camunda │ │ │ └── kafka │ │ │ └── pollingclient │ │ │ ├── PollingClientApplication.java │ │ │ ├── config │ │ │ ├── CamundaJdbcPollingConfiguration.java │ │ │ ├── CamundaRestPollingConfiguration.java │ │ │ ├── RepositoryDataPollingConfiguration.java │ │ │ ├── RuntimeDataPollingConfiguration.java │ │ │ └── properties │ │ │ │ ├── ApplicationProperties.java │ │ │ │ ├── CamundaJdbcPollingProperties.java │ │ │ │ ├── CamundaRestPollingProperties.java │ │ │ │ └── PollingProperties.java │ │ │ ├── job │ │ │ ├── repository │ │ │ │ ├── RepositoryDataPollingJob.java │ │ │ │ └── RepositoryDataPollingService.java │ │ │ └── runtime │ │ │ │ ├── RuntimeDataPollingJob.java │ │ │ │ └── RuntimeDataPollingService.java │ │ │ └── service │ │ │ ├── event │ │ │ ├── EventService.java │ │ │ └── kafka │ │ │ │ └── KafkaEventServiceImpl.java │ │ │ ├── lastpolled │ │ │ ├── LastPolledService.java │ │ │ ├── PollingTimeslice.java │ │ │ └── filebased │ │ │ │ └── FilebasedLastPolledServiceImpl.java │ │ │ └── polling │ │ │ ├── PollingService.java │ │ │ ├── jdbc │ │ │ └── CamundaJdbcPollingServiceImpl.java │ │ │ └── rest │ │ │ ├── CamundaRestPollingServiceImpl.java │ │ │ └── response │ │ │ ├── GetCommentResponse.java │ │ │ ├── GetDeploymentResponse.java │ │ │ ├── GetHistoricActivityInstanceRespone.java │ │ │ ├── GetHistoricDetailVariableUpdateResponse.java │ │ │ ├── GetHistoricProcessInstanceResponse.java │ │ │ ├── GetHistoricVariableInstancesResponse.java │ │ │ ├── GetIdentityLinkResponse.java │ │ │ ├── GetProcessDefinitionResponse.java │ │ │ └── GetProcessDefinitionXmlResponse.java │ └── resources │ │ ├── application-jdbc.properties │ │ ├── application-rest.properties │ │ └── application.properties │ └── test │ ├── java │ └── de │ │ └── viadee │ │ └── camunda │ │ └── kafka │ │ └── pollingclient │ │ ├── job │ │ ├── repository │ │ │ └── RepositoryDataPollingServiceTest.java │ │ └── runtime │ │ │ └── RuntimeDataPollingServiceTest.java │ │ └── service │ │ └── polling │ │ └── rest │ │ └── CamundaRestPollingServiceImplTest.java │ └── resources │ ├── bpmn │ ├── activityTestProcess.bpmn │ └── simpleProcess.bpmn │ └── logback.xml ├── code-formatter.xml ├── hooks └── pre_build └── pom.xml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Protect .github for workflow hardening: 2 | # Changes to files within the default branch (develop) need pull request approval by one of the given owners. 3 | /.github/ @viadee/admin-team @viadee/bpm-team @viadee/bpmn-ai -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" # See documentation for possible values 4 | directory: "/" # Location of package manifests 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/ci_build.yml: -------------------------------------------------------------------------------- 1 | name: CI_Build 2 | 3 | on: 4 | push: 5 | branches: [ develop, master ] 6 | pull_request: 7 | branches: [ develop, master ] 8 | 9 | jobs: 10 | 11 | build_and_test: 12 | name: Build and test 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v2 18 | 19 | - name: Set up JDK 11 20 | uses: actions/setup-java@v2.1.0 21 | with: 22 | distribution: 'adopt' # See 'Supported distributions' for available options 23 | java-version: '11' 24 | 25 | - name: Cache local Maven repository 26 | uses: actions/cache@v2 27 | with: 28 | path: ~/.m2/repository 29 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 30 | restore-keys: | 31 | ${{ runner.os }}-maven- 32 | 33 | - name: Build and test 34 | # The *test* command executes each default lifecycle phase in order: validate -> compile -> test. 35 | run: mvn --batch-mode clean test 36 | -------------------------------------------------------------------------------- /.github/workflows/wf0_release.yml: -------------------------------------------------------------------------------- 1 | ## 2 | # This workflow builds and tests docker image and pushes it to AWS ECR for camunda-kafka-polling-client. 3 | ## 4 | 5 | name: Build_release_and_push_to_AWS_ECR 6 | 7 | # Triggered by a published release (pre-release). 8 | on: 9 | release: 10 | types: [prereleased, released] 11 | 12 | jobs: 13 | 14 | build_and_push: 15 | name: Build and push to AWS ECR 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | 22 | # BUILD: 23 | - name: Set up Docker Buildx 24 | uses: docker/setup-buildx-action@v1 25 | 26 | - name: Set up JDK 11 27 | uses: actions/setup-java@v2.1.0 28 | with: 29 | distribution: 'adopt' # See 'Supported distributions' for available options 30 | java-version: '11' 31 | 32 | - name: Cache local Maven repository 33 | uses: actions/cache@v2 34 | with: 35 | path: ~/.m2/repository 36 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} 37 | restore-keys: | 38 | ${{ runner.os }}-maven- 39 | 40 | - name: Execute build 41 | # The *install* command executes each default lifecycle phase in order: validate -> compile -> test -> package -> verify, before executing install. 42 | run: mvn clean install 43 | 44 | - name: Login to public ECR 45 | uses: docker/login-action@v1 46 | with: 47 | registry: public.ecr.aws 48 | username: ${{ secrets.AWS_PROD_ECR_VIADEE_ACCESS_KEY_ID }} 49 | password: ${{ secrets.AWS_PROD_ECR_VIADEE_SECRET_ACCESS_KEY }} 50 | env: 51 | AWS_REGION: us-east-1 52 | 53 | # PUSH: 54 | # camunda-kafka-polling-client 55 | - name: Docker meta 56 | id: meta 57 | uses: docker/metadata-action@v3 58 | with: 59 | images: public.ecr.aws/viadee/camunda-kafka-polling-client 60 | tags: | 61 | type=semver,pattern={{version}} 62 | flavor: latest=true 63 | 64 | - name: Build and push Docker image 65 | uses: docker/build-push-action@v2.6.1 66 | with: 67 | context: . 68 | file: ./Dockerfile 69 | platforms: linux/amd64 70 | push: ${{ github.event_name != 'pull_request' }} 71 | tags: ${{ steps.meta.outputs.tags }} 72 | labels: ${{ steps.meta.outputs.labels }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *target* 2 | *.iml 3 | .idea/ 4 | .project 5 | .classpath 6 | .springBeans 7 | .settings/ 8 | camunda-kafka-polling-client/.factorypath 9 | camunda-kafka-model/.factorypath 10 | -------------------------------------------------------------------------------- /CLA_corporate.md: -------------------------------------------------------------------------------- 1 | # camunda-kafka-polling-client Entity Contributor License Agreement 2 | 3 | Thank you for your interest in contributing to sonarIssueScoring ("We" or "Us"). 4 | 5 | This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by email, following the instructions at https://github.com/viadee/camunda-kafka-polling-client/blob/master/CONTRIBUTING.md. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us. 6 | ## 1. Definitions 7 | 8 | "You" means any Legal Entity on behalf of whom a Contribution has been received by Us. "Legal Entity" means an entity which is not a natural person. "Affiliates" means other Legal Entities that control, are controlled by, or under common control with that Legal Entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such Legal Entity, whether by contract or otherwise, (ii) ownership of fifty percent (50%) or more of the outstanding shares or securities which vote to elect the management or other persons who direct such Legal Entity or (iii) beneficial ownership of such entity. 9 | 10 | "Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. If You do not own the Copyright in the entire work of authorship, please follow the instructions in https://github.com/viadee/camunda-kafka-polling-client/blob/master/CONTRIBUTING.md. 11 | 12 | "Copyright" means all rights protecting works of authorship owned or controlled by You or Your Affiliates, including copyright, moral and neighboring rights, as appropriate, for the full term of their existence including any extensions by You. 13 | 14 | "Material" means the work of authorship which is made available by Us to third parties. When this Agreement covers more than one software project, the Material means the work of authorship to which the Contribution was Submitted. After You Submit the Contribution, it may be included in the Material. 15 | 16 | "Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Us for the purpose of discussing and improving the Material, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." 17 | 18 | "Submission Date" means the date on which You Submit a Contribution to Us. 19 | 20 | "Effective Date" means the date You execute this Agreement or the date You first Submit a Contribution to Us, whichever is earlier. 21 | 22 | ## 2. Grant of Rights 23 | 2.1 Copyright License 24 | 25 | (a) You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement. 26 | 27 | (b) To the maximum extent permitted by the relevant law, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable license under the Copyright covering the Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3. 28 | 2.2 Patent License 29 | 30 | For patent claims including, without limitation, method, process, and apparatus claims which You or Your Affiliates own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with the Material (and portions of such combination). This license is granted only to the extent that the exercise of the licensed rights infringes such patent claims; and provided that this license is conditioned upon compliance with Section 2.3. 31 | 2.3 Outbound License 32 | 33 | Based on the grant of rights in Sections 2.1 and 2.2, if We include Your Contribution in a Material, We may license the Contribution under any license, including copyleft, permissive, commercial, or proprietary licenses. As a condition on the exercise of this right, We agree to also license the Contribution under the terms of the license or licenses which We are using for the Material on the Submission Date. 34 | 35 | 2.4 Moral Rights. If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against Us or our successors in interest, or any of our licensees, either direct or indirect. 36 | 37 | 2.5 Our Rights. You acknowledge that We are not obligated to use Your Contribution as part of the Material and may decide to include any Contribution We consider appropriate. 38 | 39 | 2.6 Reservation of Rights. Any rights not expressly licensed under this section are expressly reserved by You. 40 | 41 | ## 3. Agreement 42 | 43 | You confirm that: 44 | 45 | (a) You have the legal authority to enter into this Agreement. 46 | 47 | (b) You or Your Affiliates own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2. 48 | 49 | (c) The grant of rights under Section 2 does not violate any grant of rights which You or Your Affiliates have made to third parties. 50 | 51 | (d) You have followed the instructions in https://github.com/viadee/camunda-kafka-polling-client/blob/master/CONTRIBUTING.md, if You do not own the Copyright in the entire work of authorship Submitted. 52 | 53 | ## 4. Disclaimer 54 | 55 | EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW. 56 | 57 | ## 5. Consequential Damage Waiver 58 | 59 | TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. 60 | ## 6. Miscellaneous 61 | 62 | 6.1 This Agreement will be governed by and construed in accordance with the laws of Germany excluding its conflicts of law provisions. Under certain circumstances, the governing law in this section might be superseded by the United Nations Convention on Contracts for the International Sale of Goods ("UN Convention") and the parties intend to avoid the application of the UN Convention to this Agreement and, thus, exclude the application of the UN Convention in its entirety to this Agreement. 63 | 64 | 6.2 This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings. 65 | 66 | 6.3 If You or We assign the rights or obligations received through this Agreement to a third party, as a condition of the assignment, that third party must agree in writing to abide by all the rights and obligations in the Agreement. 67 | 68 | 6.4 The failure of either party to require performance by the other party of any provision of this Agreement in one situation shall not affect the right of a party to require such performance at any time in the future. A waiver of performance under a provision in one situation shall not be considered a waiver of the performance of the provision in the future or a waiver of the provision in its entirety. 69 | 70 | 6.5 If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law. 71 | 72 | You 73 | ________________________ 74 | Name: __________________ 75 | Title: ___________________ 76 | Address: ________________ 77 | ________________________ 78 | 79 | Us 80 | ________________________ 81 | Name: __________________ 82 | Title: ___________________ 83 | Address: ________________ 84 | ________________________ 85 | 86 | Harmony (HA-CLA-E-ANY) Version 1.0 87 | -------------------------------------------------------------------------------- /CLA_individual.md: -------------------------------------------------------------------------------- 1 | # camunda-kafka-polling-client Individual Contributor License Agreement 2 | 3 | Thank you for your interest in contributing to sonarIssueScoring ("We" or "Us"). 4 | 5 | This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by email, following the instructions at https://github.com/viadee/sonarIssueScoring/blob/master/CONTRIBUTING.md. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us. 6 | ## 1. Definitions 7 | 8 | "You" means the individual who Submits a Contribution to Us. 9 | 10 | "Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. If You do not own the Copyright in the entire work of authorship, please follow the instructions in https://github.com/viadee/sonarIssueScoring/blob/master/CONTRIBUTING.md. 11 | 12 | "Copyright" means all rights protecting works of authorship owned or controlled by You, including copyright, moral and neighboring rights, as appropriate, for the full term of their existence including any extensions by You. 13 | 14 | "Material" means the work of authorship which is made available by Us to third parties. When this Agreement covers more than one software project, the Material means the work of authorship to which the Contribution was Submitted. After You Submit the Contribution, it may be included in the Material. 15 | 16 | "Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Us for the purpose of discussing and improving the Material, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." 17 | 18 | "Submission Date" means the date on which You Submit a Contribution to Us. 19 | 20 | "Effective Date" means the date You execute this Agreement or the date You first Submit a Contribution to Us, whichever is earlier. 21 | 22 | ## 2. Grant of Rights 23 | 2.1 Copyright License 24 | 25 | (a) You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement. 26 | 27 | (b) To the maximum extent permitted by the relevant law, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable license under the Copyright covering the Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3. 28 | 2.2 Patent License 29 | 30 | For patent claims including, without limitation, method, process, and apparatus claims which You own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with the Material (and portions of such combination). This license is granted only to the extent that the exercise of the licensed rights infringes such patent claims; and provided that this license is conditioned upon compliance with Section 2.3. 31 | 2.3 Outbound License 32 | 33 | Based on the grant of rights in Sections 2.1 and 2.2, if We include Your Contribution in a Material, We may license the Contribution under any license, including copyleft, permissive, commercial, or proprietary licenses. As a condition on the exercise of this right, We agree to also license the Contribution under the terms of the license or licenses which We are using for the Material on the Submission Date. 34 | 35 | 2.4 Moral Rights. If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against Us or our successors in interest, or any of our licensees, either direct or indirect. 36 | 37 | 2.5 Our Rights. You acknowledge that We are not obligated to use Your Contribution as part of the Material and may decide to include any Contribution We consider appropriate. 38 | 39 | 2.6 Reservation of Rights. Any rights not expressly licensed under this section are expressly reserved by You. 40 | 41 | ## 3. Agreement 42 | 43 | You confirm that: 44 | 45 | (a) You have the legal authority to enter into this Agreement. 46 | 47 | (b) You own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2. 48 | 49 | (c) The grant of rights under Section 2 does not violate any grant of rights which You have made to third parties, including Your employer. If You are an employee, You have had Your employer approve this Agreement or sign the Entity version of this document. If You are less than eighteen years old, please have Your parents or guardian sign the Agreement. 50 | 51 | (d) You have followed the instructions in https://github.com/viadee/sonarIssueScoring/blob/master/CONTRIBUTING.md, if You do not own the Copyright in the entire work of authorship Submitted. 52 | 53 | ## 4. Disclaimer 54 | 55 | EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW. 56 | 57 | ## 5. Consequential Damage Waiver 58 | 59 | TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. 60 | ## 6. Miscellaneous 61 | 62 | 6.1 This Agreement will be governed by and construed in accordance with the laws of Germany excluding its conflicts of law provisions. Under certain circumstances, the governing law in this section might be superseded by the United Nations Convention on Contracts for the International Sale of Goods ("UN Convention") and the parties intend to avoid the application of the UN Convention to this Agreement and, thus, exclude the application of the UN Convention in its entirety to this Agreement. 63 | 64 | 6.2 This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings. 65 | 66 | 6.3 If You or We assign the rights or obligations received through this Agreement to a third party, as a condition of the assignment, that third party must agree in writing to abide by all the rights and obligations in the Agreement. 67 | 68 | 6.4 The failure of either party to require performance by the other party of any provision of this Agreement in one situation shall not affect the right of a party to require such performance at any time in the future. A waiver of performance under a provision in one situation shall not be considered a waiver of the performance of the provision in the future or a waiver of the provision in its entirety. 69 | 70 | 6.5 If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law. 71 | 72 | You 73 | ________________________ 74 | Name: __________________ 75 | Address: ________________ 76 | ________________________ 77 | 78 | Us 79 | ________________________ 80 | Name: __________________ 81 | Title: ___________________ 82 | Address: ________________ 83 | ________________________ 84 | 85 | Harmony (HA-CLA-I-ANY) Version 1.0 86 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Camunda Kafka Polling Client 2 | 3 | Most important first: Thank you for your contribution! We are happy to hear that and try to make this as efficient and hassle free as we possibly can. 4 | 5 | This document is intended to give contributors a set of guidelines for the contribution. 6 | The guidelines should provide help for your contribution. 7 | Feel free to suggest changes or enhancements to this guideline. 8 | 9 | # How can I contribute? 10 | 1. Let's talk about it. Preferrably in the form of a github issue. 11 | 2. Sign the [Contributor License Agreement](CLA_individual.md) and send it via e-mail to one of the maintainers of the project (we store CLAs separately for GDPR reasons). There is a separate form for those, [contributing as a corporate entity](CLA_corporate.md) and not as an individual. 12 | 3. Fork this repository. 13 | 4. Push your changes to a topic branch in your fork of the repository and make sure that sonar is happy with it (i.e. the quality gate holds). 14 | 5. Submit a pull request - we will get back to you shortly. 15 | 16 | ## File a bug 17 | If you find a bug, feel free to submit an issue. 18 | 19 | To be able to understand the bug, please attach additional information to enable reproducing the bug. 20 | Especially the used version of the polling client, used polling method (rest or jdbc) and used version of Camunda BPM 21 | will help to understand the bug. 22 | 23 | ## Create a pull request 24 | If you already have a suggested bugfix or an enhancement, you can also provide a pull request. 25 | In case of a bugfix, the pull request should include information about the fixed bug. 26 | In case of an enhancement, the pull request should include a description about the intended extension. 27 | 28 | # Styleguide 29 | There is a set of Eclipse code formatting rules available as `code-formatter.xml` in the project root. 30 | These rules can be imported into Eclipse or IntelliJ. There is also a maven plugin configured, which can 31 | format the project source code based on these formatting rules by using `mvn formatter:format`. 32 | 33 | The maven plugin is also configured to validate source code is formatted using these rules during `verify` phase 34 | of the build. -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11-jre 2 | 3 | RUN addgroup --system --gid 1000 appuser && \ 4 | adduser --system --no-create-home --disabled-login --uid 1000 --ingroup appuser appuser && \ 5 | mkdir -p /app && \ 6 | mkdir -p /data 7 | 8 | ARG APP_COMPONENT_DIR=camunda-kafka-polling-client/target/dependency 9 | 10 | COPY ${APP_COMPONENT_DIR}/BOOT-INF/lib /app/lib 11 | COPY ${APP_COMPONENT_DIR}/BOOT-INF/classes /app/bin 12 | COPY ${APP_COMPONENT_DIR}/META-INF /app/bin/META-INF 13 | 14 | RUN chown -R appuser:appuser /app && \ 15 | chown -R appuser:appuser /data && \ 16 | find /app -type d -exec chmod 550 {} + && \ 17 | find /app -type f -exec chmod 660 {} + && \ 18 | chmod 770 /data 19 | 20 | VOLUME /data 21 | USER appuser 22 | 23 | WORKDIR /data 24 | ENTRYPOINT ["java", "-cp", "/app/bin:/app/lib/*", "de.viadee.camunda.kafka.pollingclient.PollingClientApplication"] 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2018, viadee IT-Unternehmensberatung AG 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Camunda-Kafka Polling Client 2 | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) 3 | ![CI Build](https://github.com/viadee/camunda-kafka-polling-client/actions/workflows/ci_build.yml/badge.svg) 4 | [![Maven Central](https://img.shields.io/maven-central/v/de.viadee.camunda/camunda-kafka-polling-client-parent.svg)](https://search.maven.org/search?q=g:de.viadee.camunda%20a:camunda-kafka-polling-client-parent) 5 | 6 | The Polling Client is a useful tool for the extraction of Camunda process data and their permanent storage in Apache Kafka. As such it is used in the projects [bpmn.ai](https://github.com/viadee/bpmn.ai) or [vPW](https://www.viadee.de/business-process-management/process-warehouse), that aim to open up standard process data for data mining and exploration. 7 | 8 | Two different polling modes are supported: Polling via JDBC access from a Camunda database using an embedded Camunda engine and polling via the Camunda engines own REST API from an existing Camunda instance. 9 | 10 | ## Configuration 11 | We provide a pre-configured docker image on [Amazon Elastic Container Registry (ECR)](https://gallery.ecr.aws/viadee/camunda-kafka-polling-client). 12 | 13 | The polling mode selection is done by using Spring profiles. 14 | The polling client can be configured on several levels, i.e. directly via the applications properties files or by setting environment variables. 15 | 16 | #### Data Store Configuration 17 | 18 | | Property | Value | Example | 19 | | ------------- | ------------- | ------------- | 20 | | KAFKA_BOOTSTRAP_SERVERS | *name:port* | 127.0.0.1:19092 | 21 | 22 | Depending on its retention policy your Kafka server might discard messages after a defined time period. 23 | You can set the retention policy for the broker by adjusting the value for the key log.retention.hours. 24 | ```bash 25 | bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config log.retention.hours=1073741824 26 | ``` 27 | 28 | #### REST Polling 29 | 30 | | Property | Value | Example | 31 | | ------------- | ------------- | ------------- | 32 | | SPRING_PROFILES_ACTIVE | *rest* | rest | 33 | | CAMUNDA_REST_URL | *url to camunda rest api* | http://localhost:8080/engine-rest/ | 34 | | CAMUNDA_REST_USERNAME | *(optional) username for authentication* | demo | 35 | | CAMUNDA_REST_PASSWORD | *(optional) password for authentication* | demo | 36 | | CAMUNDA_REST_SOURCE_TIME_ZONE | *(optional) Time zone used for formatting timestamps provided to camunda rest api (Default: System timezone)* | CEST | 37 | | CAMUNDA_REST_DATE_FORMAT_PATERN | *(optional) Format string used for formatting timestamps provided to camunda rest api (Default: See example)* | yyyy-MM-dd'T'HH:mm:ss.SSSZ | 38 | 39 | #### JDBC Polling 40 | 41 | | Property | Value | Example | 42 | | ------------- | ------------- | ------------- | 43 | | SPRING_PROFILES_ACTIVE | *jdbc* | jdbc | 44 | | CAMUNDA_JDBC_URL | *jdbc url* | | 45 | | CAMUNDA_JDBC_USERNAME | *db username* | demo | 46 | | CAMUNDA_JDBC_PASSWORD | *db password* | demo | 47 | 48 | #### Polling start time configuration 49 | | Property | Value | Example | 50 | | ------------- | ------------- | ------------- | 51 | | POLLING_RUNTIME_DATA_INITIAL_TIMESTAMP | *(optional) initial start time the polling of runtime data (only relevant for initial polling);
format: "yyyy-MM-dd HH:mm:ss".
Default is the current time.* | 2018-01-01 00:00:00 | 52 | | POLLING_REPOSITORY_DATA_INITIAL_TIMESTAMP | *(optional) initial start time the polling of repository data (only relevant for initial polling);
format: "yyyy-MM-dd HH:mm:ss.
Default is the current time."* | 2018-01-01 00:00:00 | 53 | 54 | #### Further configurations 55 | 56 | Further configurations can be made via the application.properties file, e.g. setting the polling interval (default: every 30000 ms). 57 | 58 | ## Docker Tags 59 | There are several tags available on [Amazon Elastic Container Registry (ECR)](https://gallery.ecr.aws/viadee/camunda-kafka-polling-client) and [docker hub](https://hub.docker.com/r/viadee/camunda-kafka-polling-client): 60 | 61 | * Version tags (e.g. 1.0.2) are build from corresponding release tags and reflect the release version which is also available from [maven central](https://search.maven.org/search?q=g:de.viadee.camunda%20a:camunda-kafka-polling-client-parent). 62 | * `latest` refers the latest version. 63 | 64 | ## Extending Docker Image 65 | All data is stored in `/data`. This is also the working directory and the only directory with write permissions. 66 | 67 | All JAR files available in `/app/lib` are included in applications classpath. Adding e.g. an additional jdbc 68 | driver can thus be done by just adding the driver library to `/app/lib`. 69 | 70 | ## Collaboration 71 | 72 | The project is operated and further developed by the viadee Consulting AG in Münster, Westphalia. 73 | * Community contributions to the project are welcome: Please open Github-Issues with suggestions (or PR), which we can then edit in the team. For contribution please take account of our [contributing guidelines](https://github.com/viadee/camunda-kafka-polling-client/blob/master/CONTRIBUTING.md). 74 | * We are also looking for further partners who have interesting process data to refine our tooling as well as partners that are simply interested in a discussion about AI and data warehouses in the context of business process automation. 75 | 76 | 77 | ## Commitments 78 | 79 | This library will remain under an open source licence indefinately. 80 | 81 | We follow the semantic versioning scheme (2.0.0). 82 | 83 | In the sense of semantic versioning, the resulting JSON outputs are the only public "API" provided here. We will keep these as stable as possible. 84 | 85 | ## Roadmap 86 | This software component is considered to be stable and ready for production use. 87 | However, we plan to extend on it if there is demand or if the Camunda APIs change. 88 | 89 | ## License 90 | This project is licensed under the BSD 3-Clause "New" or "Revised" License - see the [LICENSE](https://github.com/viadee/camunda-kafka-polling-client/blob/master/LICENSE) file for details. 91 | -------------------------------------------------------------------------------- /camunda-kafka-model/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | de.viadee.camunda 9 | camunda-kafka-polling-client-parent 10 | 2.1.0 11 | ../pom.xml 12 | 13 | 14 | camunda-kafka-model 15 | 16 | https://github.com/viadee/camunda-kafka-polling-client 17 | 18 | viadee Unternehmensberatung AG 19 | www.viadee.de 20 | 21 | 22 | camunda-kafka-model 23 | 24 | A small Java-based toolset to gather event data from a Camunda BPM engine and store it in Apache Kafka. 25 | Repository contains the camunda-kafka-polling-client and the camunda-kafka-model, to make reuse of the data 26 | structures easy. 27 | This tooling is meant to be used as a part of the viadee Process Warehouse or the bpmn.ai concepts. 28 | 29 | This is the model module, i.e. it contains the data model classes for reuse by Java-based, downstream analysis 30 | components. 31 | 32 | 2018 33 | 34 | 35 | BSD-3 Clause 36 | https://opensource.org/licenses/BSD-3-Clause 37 | 38 | 39 | 40 | 41 | https://travis-ci.org/viadee/camunda-kafka-polling-client 42 | Travis 43 | 44 | 45 | 46 | https://github.com/viadee/camunda-kafka-polling-client/issues 47 | GitHub 48 | 49 | 50 | 51 | https://github.com/viadee/camunda-kafka-polling-client 52 | GitHub 53 | 54 | 55 | 56 | 57 | Michael Twelkemeier 58 | Michael.Twelkemeier@viadee.de 59 | viadee Unternehmensberatung AG 60 | http://www.viadee.de 61 | 62 | 63 | Jan-Philipp Friedenstab 64 | Jan-Philipp.Friedenstab@viadee.de 65 | viadee Unternehmensberatung AG 66 | http://www.viadee.de 67 | 68 | 69 | Sebastian Sirch 70 | Sebastian.Sirch@viadee.de 71 | viadee Unternehmensberatung AG 72 | http://www.viadee.de 73 | 74 | 75 | Mario Micudaj 76 | Mario.Micudaj@viadee.de 77 | viadee Unternehmensberatung AG 78 | http://www.viadee.de 79 | 80 | 81 | Thorben Hellweg 82 | Thorben.Hellweg@viadee.de 83 | viadee Unternehmensberatung AG 84 | http://www.viadee.de 85 | 86 | 87 | Caroline Methner 88 | Caroline.Methner@viadee.de 89 | viadee Unternehmensberatung AG 90 | http://www.viadee.de 91 | 92 | 93 | Frank Koehne 94 | Frank.Koehne@viadee.de 95 | viadee Unternehmensberatung AG 96 | http://www.viadee.de 97 | 98 | 99 | 100 | 101 | 102 | release-sign-artifacts 103 | 104 | 105 | performRelease 106 | true 107 | 108 | 109 | 110 | 111 | 112 | org.apache.maven.plugins 113 | maven-gpg-plugin 114 | 115 | 116 | sign-artifacts 117 | verify 118 | 119 | sign 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | com.fasterxml.jackson.core 133 | jackson-annotations 134 | 135 | 136 | 137 | 138 | 139 | 140 | net.revelc.code.formatter 141 | formatter-maven-plugin 142 | 143 | ${project.basedir}/../code-formatter.xml 144 | 145 | 146 | 147 | 148 | org.apache.maven.plugins 149 | maven-source-plugin 150 | 151 | 152 | attach-sources 153 | 154 | jar-no-fork 155 | 156 | 157 | 158 | 159 | 160 | 161 | org.apache.maven.plugins 162 | maven-javadoc-plugin 163 | 164 | 165 | attach-javadocs 166 | 167 | jar 168 | 169 | 170 | -Xdoclint:none 171 | 172 | 173 | 174 | 175 | 176 | 177 | org.apache.maven.plugins 178 | maven-deploy-plugin 179 | 180 | false 181 | 182 | 183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/ActivityInstanceEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | /** 5 | *

6 | * ActivityInstanceEvent class. 7 | *

8 | * 9 | * 10 | * 11 | * @author viadee 12 | * 13 | * @version $Id: $Id 14 | */ 15 | public class ActivityInstanceEvent extends ScopeInstanceEvent { 16 | 17 | private String activityId; 18 | private String activityName; 19 | private String activityType; 20 | private String activityInstanceId; 21 | private int activityInstanceState; 22 | private String parentActivityInstanceId; 23 | private String calledProcessInstanceId; 24 | private String calledCaseInstanceId; 25 | private String taskId; 26 | private String taskAssignee; 27 | private String tenantId; 28 | 29 | @java.lang.SuppressWarnings("all") 30 | public String getActivityId() { 31 | return this.activityId; 32 | } 33 | 34 | @java.lang.SuppressWarnings("all") 35 | public String getActivityName() { 36 | return this.activityName; 37 | } 38 | 39 | @java.lang.SuppressWarnings("all") 40 | public String getActivityType() { 41 | return this.activityType; 42 | } 43 | 44 | @java.lang.SuppressWarnings("all") 45 | public String getActivityInstanceId() { 46 | return this.activityInstanceId; 47 | } 48 | 49 | @java.lang.SuppressWarnings("all") 50 | public int getActivityInstanceState() { 51 | return this.activityInstanceState; 52 | } 53 | 54 | @java.lang.SuppressWarnings("all") 55 | public String getParentActivityInstanceId() { 56 | return this.parentActivityInstanceId; 57 | } 58 | 59 | @java.lang.SuppressWarnings("all") 60 | public String getCalledProcessInstanceId() { 61 | return this.calledProcessInstanceId; 62 | } 63 | 64 | @java.lang.SuppressWarnings("all") 65 | public String getCalledCaseInstanceId() { 66 | return this.calledCaseInstanceId; 67 | } 68 | 69 | @java.lang.SuppressWarnings("all") 70 | public String getTaskId() { 71 | return this.taskId; 72 | } 73 | 74 | @java.lang.SuppressWarnings("all") 75 | public String getTaskAssignee() { 76 | return this.taskAssignee; 77 | } 78 | 79 | @java.lang.SuppressWarnings("all") 80 | public String getTenantId() { 81 | return this.tenantId; 82 | } 83 | 84 | @java.lang.SuppressWarnings("all") 85 | public void setActivityId(final String activityId) { 86 | this.activityId = activityId; 87 | } 88 | 89 | @java.lang.SuppressWarnings("all") 90 | public void setActivityName(final String activityName) { 91 | this.activityName = activityName; 92 | } 93 | 94 | @java.lang.SuppressWarnings("all") 95 | public void setActivityType(final String activityType) { 96 | this.activityType = activityType; 97 | } 98 | 99 | @java.lang.SuppressWarnings("all") 100 | public void setActivityInstanceId(final String activityInstanceId) { 101 | this.activityInstanceId = activityInstanceId; 102 | } 103 | 104 | @java.lang.SuppressWarnings("all") 105 | public void setActivityInstanceState(final int activityInstanceState) { 106 | this.activityInstanceState = activityInstanceState; 107 | } 108 | 109 | @java.lang.SuppressWarnings("all") 110 | public void setParentActivityInstanceId(final String parentActivityInstanceId) { 111 | this.parentActivityInstanceId = parentActivityInstanceId; 112 | } 113 | 114 | @java.lang.SuppressWarnings("all") 115 | public void setCalledProcessInstanceId(final String calledProcessInstanceId) { 116 | this.calledProcessInstanceId = calledProcessInstanceId; 117 | } 118 | 119 | @java.lang.SuppressWarnings("all") 120 | public void setCalledCaseInstanceId(final String calledCaseInstanceId) { 121 | this.calledCaseInstanceId = calledCaseInstanceId; 122 | } 123 | 124 | @java.lang.SuppressWarnings("all") 125 | public void setTaskId(final String taskId) { 126 | this.taskId = taskId; 127 | } 128 | 129 | @java.lang.SuppressWarnings("all") 130 | public void setTaskAssignee(final String taskAssignee) { 131 | this.taskAssignee = taskAssignee; 132 | } 133 | 134 | @java.lang.SuppressWarnings("all") 135 | public void setTenantId(final String tenantId) { 136 | this.tenantId = tenantId; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/CommentEvent.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.event; 2 | 3 | /** 4 | *

5 | * CommentEvent class. 6 | *

7 | * 8 | * 9 | * @version $Id: $Id 10 | */ 11 | public class CommentEvent extends DetailEvent { 12 | 13 | private String message; 14 | private String userId; 15 | 16 | public String getMessage() { 17 | return message; 18 | } 19 | 20 | public void setMessage(String message) { 21 | this.message = message; 22 | } 23 | 24 | public String getUserId() { 25 | return userId; 26 | } 27 | 28 | public void setUserId(String userId) { 29 | this.userId = userId; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/DeploymentEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | import java.util.Date; 5 | 6 | /** 7 | *

8 | * DeploymentEvent class. 9 | *

10 | * 11 | * 12 | * 13 | * @author viadee 14 | * 15 | * @version $Id: $Id 16 | */ 17 | public class DeploymentEvent { 18 | 19 | private String id; 20 | private String deploymentId; 21 | private String name; 22 | private String source; 23 | private Date deploymentTime; 24 | private String tenantId; 25 | 26 | @java.lang.SuppressWarnings("all") 27 | public String getId() { 28 | return this.id; 29 | } 30 | 31 | @java.lang.SuppressWarnings("all") 32 | public String getDeploymentId() { 33 | return this.deploymentId; 34 | } 35 | 36 | @java.lang.SuppressWarnings("all") 37 | public String getName() { 38 | return this.name; 39 | } 40 | 41 | @java.lang.SuppressWarnings("all") 42 | public String getSource() { 43 | return this.source; 44 | } 45 | 46 | @java.lang.SuppressWarnings("all") 47 | public Date getDeploymentTime() { 48 | return this.deploymentTime; 49 | } 50 | 51 | @java.lang.SuppressWarnings("all") 52 | public String getTenantId() { 53 | return this.tenantId; 54 | } 55 | 56 | @java.lang.SuppressWarnings("all") 57 | public void setId(final String id) { 58 | this.id = id; 59 | } 60 | 61 | @java.lang.SuppressWarnings("all") 62 | public void setDeploymentId(final String deploymentId) { 63 | this.deploymentId = deploymentId; 64 | } 65 | 66 | @java.lang.SuppressWarnings("all") 67 | public void setName(final String name) { 68 | this.name = name; 69 | } 70 | 71 | @java.lang.SuppressWarnings("all") 72 | public void setSource(final String source) { 73 | this.source = source; 74 | } 75 | 76 | @java.lang.SuppressWarnings("all") 77 | public void setDeploymentTime(final Date deploymentTime) { 78 | this.deploymentTime = deploymentTime; 79 | } 80 | 81 | @java.lang.SuppressWarnings("all") 82 | public void setTenantId(final String tenantId) { 83 | this.tenantId = tenantId; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/DetailEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | import java.util.Date; 5 | 6 | /** 7 | *

8 | * DetailEvent class. 9 | *

10 | * 11 | * 12 | * 13 | * @author viadee 14 | * 15 | * @version $Id: $Id 16 | */ 17 | public class DetailEvent extends HistoryEvent { 18 | 19 | private String activityInstanceId; 20 | private String taskId; 21 | private Date timestamp; 22 | private String tenantId; 23 | private String userOperationId; 24 | 25 | @java.lang.SuppressWarnings("all") 26 | public String getActivityInstanceId() { 27 | return this.activityInstanceId; 28 | } 29 | 30 | @java.lang.SuppressWarnings("all") 31 | public String getTaskId() { 32 | return this.taskId; 33 | } 34 | 35 | @java.lang.SuppressWarnings("all") 36 | public Date getTimestamp() { 37 | return this.timestamp; 38 | } 39 | 40 | @java.lang.SuppressWarnings("all") 41 | public String getTenantId() { 42 | return this.tenantId; 43 | } 44 | 45 | @java.lang.SuppressWarnings("all") 46 | public String getUserOperationId() { 47 | return this.userOperationId; 48 | } 49 | 50 | @java.lang.SuppressWarnings("all") 51 | public void setActivityInstanceId(final String activityInstanceId) { 52 | this.activityInstanceId = activityInstanceId; 53 | } 54 | 55 | @java.lang.SuppressWarnings("all") 56 | public void setTaskId(final String taskId) { 57 | this.taskId = taskId; 58 | } 59 | 60 | @java.lang.SuppressWarnings("all") 61 | public void setTimestamp(final Date timestamp) { 62 | this.timestamp = timestamp; 63 | } 64 | 65 | @java.lang.SuppressWarnings("all") 66 | public void setTenantId(final String tenantId) { 67 | this.tenantId = tenantId; 68 | } 69 | 70 | @java.lang.SuppressWarnings("all") 71 | public void setUserOperationId(final String userOperationId) { 72 | this.userOperationId = userOperationId; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/HistoryEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | /** 7 | *

8 | * HistoryEvent class. 9 | *

10 | * 11 | * 12 | * 13 | * @author viadee 14 | * 15 | * @version $Id: $Id 16 | */ 17 | @JsonIgnoreProperties(ignoreUnknown = true) 18 | public class HistoryEvent { 19 | 20 | private String id; 21 | private String processInstanceId; 22 | private String executionId; 23 | private String processDefinitionId; 24 | private String processDefinitionKey; 25 | private String processDefinitionName; 26 | private Integer processDefinitionVersion; 27 | private String caseInstanceId; 28 | private String caseExecutionId; 29 | private String caseDefinitionId; 30 | private String caseDefinitionKey; 31 | private String caseDefinitionName; 32 | private String eventType; 33 | private long sequenceCounter; 34 | 35 | @java.lang.SuppressWarnings("all") 36 | public String getId() { 37 | return this.id; 38 | } 39 | 40 | @java.lang.SuppressWarnings("all") 41 | public String getProcessInstanceId() { 42 | return this.processInstanceId; 43 | } 44 | 45 | @java.lang.SuppressWarnings("all") 46 | public String getExecutionId() { 47 | return this.executionId; 48 | } 49 | 50 | @java.lang.SuppressWarnings("all") 51 | public String getProcessDefinitionId() { 52 | return this.processDefinitionId; 53 | } 54 | 55 | @java.lang.SuppressWarnings("all") 56 | public String getProcessDefinitionKey() { 57 | return this.processDefinitionKey; 58 | } 59 | 60 | @java.lang.SuppressWarnings("all") 61 | public String getProcessDefinitionName() { 62 | return this.processDefinitionName; 63 | } 64 | 65 | @java.lang.SuppressWarnings("all") 66 | public Integer getProcessDefinitionVersion() { 67 | return this.processDefinitionVersion; 68 | } 69 | 70 | @java.lang.SuppressWarnings("all") 71 | public String getCaseInstanceId() { 72 | return this.caseInstanceId; 73 | } 74 | 75 | @java.lang.SuppressWarnings("all") 76 | public String getCaseExecutionId() { 77 | return this.caseExecutionId; 78 | } 79 | 80 | @java.lang.SuppressWarnings("all") 81 | public String getCaseDefinitionId() { 82 | return this.caseDefinitionId; 83 | } 84 | 85 | @java.lang.SuppressWarnings("all") 86 | public String getCaseDefinitionKey() { 87 | return this.caseDefinitionKey; 88 | } 89 | 90 | @java.lang.SuppressWarnings("all") 91 | public String getCaseDefinitionName() { 92 | return this.caseDefinitionName; 93 | } 94 | 95 | @java.lang.SuppressWarnings("all") 96 | public String getEventType() { 97 | return this.eventType; 98 | } 99 | 100 | @java.lang.SuppressWarnings("all") 101 | public long getSequenceCounter() { 102 | return this.sequenceCounter; 103 | } 104 | 105 | @java.lang.SuppressWarnings("all") 106 | public void setId(final String id) { 107 | this.id = id; 108 | } 109 | 110 | @java.lang.SuppressWarnings("all") 111 | public void setProcessInstanceId(final String processInstanceId) { 112 | this.processInstanceId = processInstanceId; 113 | } 114 | 115 | @java.lang.SuppressWarnings("all") 116 | public void setExecutionId(final String executionId) { 117 | this.executionId = executionId; 118 | } 119 | 120 | @java.lang.SuppressWarnings("all") 121 | public void setProcessDefinitionId(final String processDefinitionId) { 122 | this.processDefinitionId = processDefinitionId; 123 | } 124 | 125 | @java.lang.SuppressWarnings("all") 126 | public void setProcessDefinitionKey(final String processDefinitionKey) { 127 | this.processDefinitionKey = processDefinitionKey; 128 | } 129 | 130 | @java.lang.SuppressWarnings("all") 131 | public void setProcessDefinitionName(final String processDefinitionName) { 132 | this.processDefinitionName = processDefinitionName; 133 | } 134 | 135 | @java.lang.SuppressWarnings("all") 136 | public void setProcessDefinitionVersion(final Integer processDefinitionVersion) { 137 | this.processDefinitionVersion = processDefinitionVersion; 138 | } 139 | 140 | @java.lang.SuppressWarnings("all") 141 | public void setCaseInstanceId(final String caseInstanceId) { 142 | this.caseInstanceId = caseInstanceId; 143 | } 144 | 145 | @java.lang.SuppressWarnings("all") 146 | public void setCaseExecutionId(final String caseExecutionId) { 147 | this.caseExecutionId = caseExecutionId; 148 | } 149 | 150 | @java.lang.SuppressWarnings("all") 151 | public void setCaseDefinitionId(final String caseDefinitionId) { 152 | this.caseDefinitionId = caseDefinitionId; 153 | } 154 | 155 | @java.lang.SuppressWarnings("all") 156 | public void setCaseDefinitionKey(final String caseDefinitionKey) { 157 | this.caseDefinitionKey = caseDefinitionKey; 158 | } 159 | 160 | @java.lang.SuppressWarnings("all") 161 | public void setCaseDefinitionName(final String caseDefinitionName) { 162 | this.caseDefinitionName = caseDefinitionName; 163 | } 164 | 165 | @java.lang.SuppressWarnings("all") 166 | public void setEventType(final String eventType) { 167 | this.eventType = eventType; 168 | } 169 | 170 | @java.lang.SuppressWarnings("all") 171 | public void setSequenceCounter(final long sequenceCounter) { 172 | this.sequenceCounter = sequenceCounter; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/IdentityLinkEvent.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.event; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | *

7 | * IdentityLinkEvent class. 8 | *

9 | * 10 | * 11 | * @version $Id: $Id 12 | */ 13 | public class IdentityLinkEvent extends DetailEvent { 14 | 15 | public enum OperationType { 16 | add, delete 17 | } 18 | 19 | private String type; 20 | private String userId; 21 | private String groupId; 22 | private OperationType operationType; 23 | private String assignerId; 24 | private Date removalTime; 25 | 26 | public String getType() { 27 | return type; 28 | } 29 | 30 | public void setType(String type) { 31 | this.type = type; 32 | } 33 | 34 | public String getUserId() { 35 | return userId; 36 | } 37 | 38 | public void setUserId(String userId) { 39 | this.userId = userId; 40 | } 41 | 42 | public String getGroupId() { 43 | return groupId; 44 | } 45 | 46 | public void setGroupId(String groupId) { 47 | this.groupId = groupId; 48 | } 49 | 50 | public OperationType getOperationType() { 51 | return operationType; 52 | } 53 | 54 | public void setOperationType(OperationType operationType) { 55 | this.operationType = operationType; 56 | } 57 | 58 | public String getAssignerId() { 59 | return assignerId; 60 | } 61 | 62 | public void setAssignerId(String assignerId) { 63 | this.assignerId = assignerId; 64 | } 65 | 66 | public Date getRemovalTime() { 67 | return removalTime; 68 | } 69 | 70 | public void setRemovalTime(Date removalTime) { 71 | this.removalTime = removalTime; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/IncidentEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | import java.util.Date; 5 | 6 | /** 7 | *

8 | * IncidentEvent class. 9 | *

10 | * 11 | * 12 | * 13 | * @author viadee 14 | * 15 | * @version $Id: $Id 16 | */ 17 | public class IncidentEvent extends HistoryEvent { 18 | 19 | private Date createTime; 20 | private Date endTime; 21 | private String incidentType; 22 | private String activityId; 23 | private String causeIncidentId; 24 | private String rootCauseIncidentId; 25 | private String configuration; 26 | private String incidentMessage; 27 | private int incidentState; 28 | private String tenantId; 29 | private String jobDefinitionId; 30 | 31 | @java.lang.SuppressWarnings("all") 32 | public Date getCreateTime() { 33 | return this.createTime; 34 | } 35 | 36 | @java.lang.SuppressWarnings("all") 37 | public Date getEndTime() { 38 | return this.endTime; 39 | } 40 | 41 | @java.lang.SuppressWarnings("all") 42 | public String getIncidentType() { 43 | return this.incidentType; 44 | } 45 | 46 | @java.lang.SuppressWarnings("all") 47 | public String getActivityId() { 48 | return this.activityId; 49 | } 50 | 51 | @java.lang.SuppressWarnings("all") 52 | public String getCauseIncidentId() { 53 | return this.causeIncidentId; 54 | } 55 | 56 | @java.lang.SuppressWarnings("all") 57 | public String getRootCauseIncidentId() { 58 | return this.rootCauseIncidentId; 59 | } 60 | 61 | @java.lang.SuppressWarnings("all") 62 | public String getConfiguration() { 63 | return this.configuration; 64 | } 65 | 66 | @java.lang.SuppressWarnings("all") 67 | public String getIncidentMessage() { 68 | return this.incidentMessage; 69 | } 70 | 71 | @java.lang.SuppressWarnings("all") 72 | public int getIncidentState() { 73 | return this.incidentState; 74 | } 75 | 76 | @java.lang.SuppressWarnings("all") 77 | public String getTenantId() { 78 | return this.tenantId; 79 | } 80 | 81 | @java.lang.SuppressWarnings("all") 82 | public String getJobDefinitionId() { 83 | return this.jobDefinitionId; 84 | } 85 | 86 | @java.lang.SuppressWarnings("all") 87 | public void setCreateTime(final Date createTime) { 88 | this.createTime = createTime; 89 | } 90 | 91 | @java.lang.SuppressWarnings("all") 92 | public void setEndTime(final Date endTime) { 93 | this.endTime = endTime; 94 | } 95 | 96 | @java.lang.SuppressWarnings("all") 97 | public void setIncidentType(final String incidentType) { 98 | this.incidentType = incidentType; 99 | } 100 | 101 | @java.lang.SuppressWarnings("all") 102 | public void setActivityId(final String activityId) { 103 | this.activityId = activityId; 104 | } 105 | 106 | @java.lang.SuppressWarnings("all") 107 | public void setCauseIncidentId(final String causeIncidentId) { 108 | this.causeIncidentId = causeIncidentId; 109 | } 110 | 111 | @java.lang.SuppressWarnings("all") 112 | public void setRootCauseIncidentId(final String rootCauseIncidentId) { 113 | this.rootCauseIncidentId = rootCauseIncidentId; 114 | } 115 | 116 | @java.lang.SuppressWarnings("all") 117 | public void setConfiguration(final String configuration) { 118 | this.configuration = configuration; 119 | } 120 | 121 | @java.lang.SuppressWarnings("all") 122 | public void setIncidentMessage(final String incidentMessage) { 123 | this.incidentMessage = incidentMessage; 124 | } 125 | 126 | @java.lang.SuppressWarnings("all") 127 | public void setIncidentState(final int incidentState) { 128 | this.incidentState = incidentState; 129 | } 130 | 131 | @java.lang.SuppressWarnings("all") 132 | public void setTenantId(final String tenantId) { 133 | this.tenantId = tenantId; 134 | } 135 | 136 | @java.lang.SuppressWarnings("all") 137 | public void setJobDefinitionId(final String jobDefinitionId) { 138 | this.jobDefinitionId = jobDefinitionId; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/ProcessDefinitionEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | /** 5 | *

6 | * ProcessDefinitionEvent class. 7 | *

8 | * 9 | * 10 | * 11 | * @author viadee 12 | * 13 | * @version $Id: $Id 14 | */ 15 | public class ProcessDefinitionEvent extends DeploymentEvent { 16 | 17 | private String key; 18 | private String category; 19 | private String description; 20 | private Integer version; 21 | private String resource; 22 | private String xml; 23 | private Boolean suspended; 24 | private String versionTag; 25 | private Integer historyTimeToLive; 26 | 27 | @java.lang.SuppressWarnings("all") 28 | public String getKey() { 29 | return this.key; 30 | } 31 | 32 | @java.lang.SuppressWarnings("all") 33 | public String getCategory() { 34 | return this.category; 35 | } 36 | 37 | @java.lang.SuppressWarnings("all") 38 | public String getDescription() { 39 | return this.description; 40 | } 41 | 42 | @java.lang.SuppressWarnings("all") 43 | public Integer getVersion() { 44 | return this.version; 45 | } 46 | 47 | @java.lang.SuppressWarnings("all") 48 | public String getResource() { 49 | return this.resource; 50 | } 51 | 52 | @java.lang.SuppressWarnings("all") 53 | public String getXml() { 54 | return this.xml; 55 | } 56 | 57 | @java.lang.SuppressWarnings("all") 58 | public Boolean getSuspended() { 59 | return this.suspended; 60 | } 61 | 62 | @java.lang.SuppressWarnings("all") 63 | public String getVersionTag() { 64 | return this.versionTag; 65 | } 66 | 67 | @java.lang.SuppressWarnings("all") 68 | public Integer getHistoryTimeToLive() { 69 | return this.historyTimeToLive; 70 | } 71 | 72 | @java.lang.SuppressWarnings("all") 73 | public void setKey(final String key) { 74 | this.key = key; 75 | } 76 | 77 | @java.lang.SuppressWarnings("all") 78 | public void setCategory(final String category) { 79 | this.category = category; 80 | } 81 | 82 | @java.lang.SuppressWarnings("all") 83 | public void setDescription(final String description) { 84 | this.description = description; 85 | } 86 | 87 | @java.lang.SuppressWarnings("all") 88 | public void setVersion(final Integer version) { 89 | this.version = version; 90 | } 91 | 92 | @java.lang.SuppressWarnings("all") 93 | public void setResource(final String resource) { 94 | this.resource = resource; 95 | } 96 | 97 | @java.lang.SuppressWarnings("all") 98 | public void setXml(final String xml) { 99 | this.xml = xml; 100 | } 101 | 102 | @java.lang.SuppressWarnings("all") 103 | public void setSuspended(final Boolean suspended) { 104 | this.suspended = suspended; 105 | } 106 | 107 | @java.lang.SuppressWarnings("all") 108 | public void setVersionTag(final String versionTag) { 109 | this.versionTag = versionTag; 110 | } 111 | 112 | @java.lang.SuppressWarnings("all") 113 | public void setHistoryTimeToLive(final Integer historyTimeToLive) { 114 | this.historyTimeToLive = historyTimeToLive; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/ProcessInstanceEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | /** 5 | *

6 | * ProcessInstanceEvent class. 7 | *

8 | * 9 | * 10 | * 11 | * @author viadee 12 | * 13 | * @version $Id: $Id 14 | */ 15 | public class ProcessInstanceEvent extends ScopeInstanceEvent { 16 | 17 | private String businessKey; 18 | private String startUserId; 19 | private String superProcessInstanceId; 20 | private String superCaseInstanceId; 21 | private String deleteReason; 22 | private String endActivityId; 23 | private String startActivityId; 24 | private String tenantId; 25 | private String state; 26 | 27 | @java.lang.SuppressWarnings("all") 28 | public String getBusinessKey() { 29 | return this.businessKey; 30 | } 31 | 32 | @java.lang.SuppressWarnings("all") 33 | public String getStartUserId() { 34 | return this.startUserId; 35 | } 36 | 37 | @java.lang.SuppressWarnings("all") 38 | public String getSuperProcessInstanceId() { 39 | return this.superProcessInstanceId; 40 | } 41 | 42 | @java.lang.SuppressWarnings("all") 43 | public String getSuperCaseInstanceId() { 44 | return this.superCaseInstanceId; 45 | } 46 | 47 | @java.lang.SuppressWarnings("all") 48 | public String getDeleteReason() { 49 | return this.deleteReason; 50 | } 51 | 52 | @java.lang.SuppressWarnings("all") 53 | public String getEndActivityId() { 54 | return this.endActivityId; 55 | } 56 | 57 | @java.lang.SuppressWarnings("all") 58 | public String getStartActivityId() { 59 | return this.startActivityId; 60 | } 61 | 62 | @java.lang.SuppressWarnings("all") 63 | public String getTenantId() { 64 | return this.tenantId; 65 | } 66 | 67 | @java.lang.SuppressWarnings("all") 68 | public String getState() { 69 | return this.state; 70 | } 71 | 72 | @java.lang.SuppressWarnings("all") 73 | public void setBusinessKey(final String businessKey) { 74 | this.businessKey = businessKey; 75 | } 76 | 77 | @java.lang.SuppressWarnings("all") 78 | public void setStartUserId(final String startUserId) { 79 | this.startUserId = startUserId; 80 | } 81 | 82 | @java.lang.SuppressWarnings("all") 83 | public void setSuperProcessInstanceId(final String superProcessInstanceId) { 84 | this.superProcessInstanceId = superProcessInstanceId; 85 | } 86 | 87 | @java.lang.SuppressWarnings("all") 88 | public void setSuperCaseInstanceId(final String superCaseInstanceId) { 89 | this.superCaseInstanceId = superCaseInstanceId; 90 | } 91 | 92 | @java.lang.SuppressWarnings("all") 93 | public void setDeleteReason(final String deleteReason) { 94 | this.deleteReason = deleteReason; 95 | } 96 | 97 | @java.lang.SuppressWarnings("all") 98 | public void setEndActivityId(final String endActivityId) { 99 | this.endActivityId = endActivityId; 100 | } 101 | 102 | @java.lang.SuppressWarnings("all") 103 | public void setStartActivityId(final String startActivityId) { 104 | this.startActivityId = startActivityId; 105 | } 106 | 107 | @java.lang.SuppressWarnings("all") 108 | public void setTenantId(final String tenantId) { 109 | this.tenantId = tenantId; 110 | } 111 | 112 | @java.lang.SuppressWarnings("all") 113 | public void setState(final String state) { 114 | this.state = state; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/ScopeInstanceEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | import java.util.Date; 5 | 6 | /** 7 | *

8 | * ScopeInstanceEvent class. 9 | *

10 | * 11 | * 12 | * 13 | * @author viadee 14 | * 15 | * @version $Id: $Id 16 | */ 17 | public class ScopeInstanceEvent extends HistoryEvent { 18 | 19 | private Long durationInMillis; 20 | private Date startTime; 21 | private Date endTime; 22 | 23 | @java.lang.SuppressWarnings("all") 24 | public Long getDurationInMillis() { 25 | return this.durationInMillis; 26 | } 27 | 28 | @java.lang.SuppressWarnings("all") 29 | public Date getStartTime() { 30 | return this.startTime; 31 | } 32 | 33 | @java.lang.SuppressWarnings("all") 34 | public Date getEndTime() { 35 | return this.endTime; 36 | } 37 | 38 | @java.lang.SuppressWarnings("all") 39 | public void setDurationInMillis(final Long durationInMillis) { 40 | this.durationInMillis = durationInMillis; 41 | } 42 | 43 | @java.lang.SuppressWarnings("all") 44 | public void setStartTime(final Date startTime) { 45 | this.startTime = startTime; 46 | } 47 | 48 | @java.lang.SuppressWarnings("all") 49 | public void setEndTime(final Date endTime) { 50 | this.endTime = endTime; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /camunda-kafka-model/src/main/java/de/viadee/camunda/kafka/event/VariableUpdateEvent.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Wed Jan 09 13:24:24 CET 2019 2 | package de.viadee.camunda.kafka.event; 3 | 4 | /** 5 | *

6 | * VariableUpdateEvent class. 7 | *

8 | * 9 | * 10 | * 11 | * @author viadee 12 | * 13 | * @version $Id: $Id 14 | */ 15 | public class VariableUpdateEvent extends DetailEvent { 16 | 17 | private int revision; 18 | private String variableName; 19 | private String variableInstanceId; 20 | private String scopeActivityInstanceId; 21 | private String serializerName; 22 | private Long longValue; 23 | private Double doubleValue; 24 | private String textValue; 25 | private Object complexValue; 26 | 27 | @java.lang.SuppressWarnings("all") 28 | public int getRevision() { 29 | return this.revision; 30 | } 31 | 32 | @java.lang.SuppressWarnings("all") 33 | public String getVariableName() { 34 | return this.variableName; 35 | } 36 | 37 | @java.lang.SuppressWarnings("all") 38 | public String getVariableInstanceId() { 39 | return this.variableInstanceId; 40 | } 41 | 42 | @java.lang.SuppressWarnings("all") 43 | public String getScopeActivityInstanceId() { 44 | return this.scopeActivityInstanceId; 45 | } 46 | 47 | @java.lang.SuppressWarnings("all") 48 | public String getSerializerName() { 49 | return this.serializerName; 50 | } 51 | 52 | @java.lang.SuppressWarnings("all") 53 | public Long getLongValue() { 54 | return this.longValue; 55 | } 56 | 57 | @java.lang.SuppressWarnings("all") 58 | public Double getDoubleValue() { 59 | return this.doubleValue; 60 | } 61 | 62 | @java.lang.SuppressWarnings("all") 63 | public String getTextValue() { 64 | return this.textValue; 65 | } 66 | 67 | @java.lang.SuppressWarnings("all") 68 | public Object getComplexValue() { 69 | return this.complexValue; 70 | } 71 | 72 | @java.lang.SuppressWarnings("all") 73 | public void setRevision(final int revision) { 74 | this.revision = revision; 75 | } 76 | 77 | @java.lang.SuppressWarnings("all") 78 | public void setVariableName(final String variableName) { 79 | this.variableName = variableName; 80 | } 81 | 82 | @java.lang.SuppressWarnings("all") 83 | public void setVariableInstanceId(final String variableInstanceId) { 84 | this.variableInstanceId = variableInstanceId; 85 | } 86 | 87 | @java.lang.SuppressWarnings("all") 88 | public void setScopeActivityInstanceId(final String scopeActivityInstanceId) { 89 | this.scopeActivityInstanceId = scopeActivityInstanceId; 90 | } 91 | 92 | @java.lang.SuppressWarnings("all") 93 | public void setSerializerName(final String serializerName) { 94 | this.serializerName = serializerName; 95 | } 96 | 97 | @java.lang.SuppressWarnings("all") 98 | public void setLongValue(final Long longValue) { 99 | this.longValue = longValue; 100 | } 101 | 102 | @java.lang.SuppressWarnings("all") 103 | public void setDoubleValue(final Double doubleValue) { 104 | this.doubleValue = doubleValue; 105 | } 106 | 107 | @java.lang.SuppressWarnings("all") 108 | public void setTextValue(final String textValue) { 109 | this.textValue = textValue; 110 | } 111 | 112 | @java.lang.SuppressWarnings("all") 113 | public void setComplexValue(final Object complexValue) { 114 | this.complexValue = complexValue; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/README.md: -------------------------------------------------------------------------------- 1 | # The Polling Client 2 | The Polling Client can serve as an interface between a Camunda process engine and a Kafka Streaming Platform, where the former is the data source and the later acts as a data store. 3 | Twwo polling modes are supported: Polling via JDBC access from a Camunda database using an embedded Camunda engine and polling via the Camunda engines own REST API from an existing Camunda instance. 4 | 5 | ## Polling Client Configuration 6 | The polling mode selection is done by using profiles. 7 | The polling client can be configured on several levels, i.e. directly via the applications properties files or by setting environment variables. 8 | 9 | #### Data Store Configuration 10 | 11 | | Property | Value | Example | 12 | | ------------- | ------------- | ------------- | 13 | | KAFKA_BOOTSTRAP_SERVERS | *name:port* | 127.0.0.1:19092 | 14 | 15 | #### REST Polling 16 | 17 | | Property | Value | Example | 18 | | ------------- | ------------- | ------------- | 19 | | SPRING_PROFILES_ACTIVE | *rest* | rest | 20 | | CAMUNDA_REST_URL | *url to camunda rest api* | http://localhost:8080/engine-rest/ | 21 | | CAMUNDA_REST_USERNAME | *(optional) username for authentication* | demo | 22 | | CAMUNDA_REST_PASSWORD | *(optional) password for authentication* | demo | 23 | | POLLING_REPOSITORY_DATA_INITIAL_TIMESTAMP | 24 | 25 | #### JDBC Polling 26 | 27 | | Property | Value | Example | 28 | | ------------- | ------------- | ------------- | 29 | | SPRING_PROFILES_ACTIVE | *jdbc* | jdbc | 30 | | CAMUNDA_JDBC_URL | *jdbc url* | | 31 | | CAMUNDA_JDBC_USERNAME | *db username* | demo | 32 | | CAMUNDA_JDBC_PASSWORD | *db password* | demo | 33 | 34 | #### Polling start time configuration 35 | | Property | Value | Example | 36 | | ------------- | ------------- | ------------- | 37 | | POLLING_RUNTIME_DATA_INITIAL_TIMESTAMP | *(optional) initial start time the polling of runtime data (only relevant for initial polling);
format: "yyyy-MM-dd HH:mm:ss".
Default is the current time.* | 2018-01-01 00:00:00 | 38 | | POLLING_REPOSITORY_DATA_INITIAL_TIMESTAMP | *(optional) initial start time the polling of repository data (only relevant for initial polling);
format: "yyyy-MM-dd HH:mm:ss.
Default is the current time."* | 2018-01-01 00:00:00 | 39 | 40 | #### Further configurations 41 | 42 | Further configurations can be made via the application.properties file, e.g. setting the polling interval (default: every 30000 ms). 43 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/Tutorial 3 Archiving of process data in Kafka.md: -------------------------------------------------------------------------------- 1 | This tutorial explains how process data can be stored and archived in the Apache Kafka Streaming Platform. 2 | First, we will look at how data is extracted from Camunda and stored in Kafka using the Polling Client. 3 | For users who do not have a Camunda instance or Camunda process data available, this tutorial alternatively explains how JSON-based process data can be archived to Kafka (continue reading at [section 2](2.-Using-the-JSON-Import)). 4 | 5 | ## 1. Using the Polling Client 6 | The Polling Client serves as an interface between the Camunda process engine and the Kafka Streaming Platform. The Client supports two polling modes: Polling via JDBC access from a Camunda database using an embedded Camunda engine and polling via the Camunda engines own REST API from an existing Camunda instance. 7 | After cloning and building this repository, configure the Client to retrieve data from your Camunda Engine. 8 | 9 | ### 1.1. Configuration 10 | The polling client can be configured on several levels, i.e. directly via the applications properties files or by setting environment variables (**recommended**). 11 | First, we define where the Polling Client should store the data it has retrieved from Camunda. 12 | 13 | #### Data Store Configuration 14 | 15 | | Property | Value | Example | 16 | | ------------- | ------------- | ------------- | 17 | | KAFKA_BOOTSTRAP_SERVERS | *name:port* | 127.0.0.1:19092 | 18 | 19 | You can omit this property if you have no Kafka instance running yet (no process data will be stored then). 20 | 21 | Next, set environment variables corresponding to the chosen polling mode. 22 | 23 | #### REST Polling 24 | 25 | | Property | Value | Example | 26 | | ------------- | ------------- | ------------- | 27 | | SPRING_PROFILES_ACTIVE | *rest* | rest | 28 | | CAMUNDA_REST_URL | *url to camunda rest api* | http://localhost:8080/engine-rest/ | 29 | | CAMUNDA_REST_USERNAME | *(optional) username for authentication* | demo | 30 | | CAMUNDA_REST_PASSWORD | *(optional) password for authentication* | demo | 31 | 32 | #### JDBC Polling 33 | 34 | | Property | Value | Example | 35 | | ------------- | ------------- | ------------- | 36 | | SPRING_PROFILES_ACTIVE | *jdbc* | jdbc | 37 | | CAMUNDA_JDBC_URL | *jdbc url* | | 38 | | CAMUNDA_JDBC_USERNAME | *db username* | demo | 39 | | CAMUNDA_JDBC_PASSWORD | *db password* | demo | 40 | 41 | #### Further configurations 42 | 43 | Further configurations can be made via the applications property file *application.properties*, e.g. setting the polling interval (default: every 30000 ms). 44 | 45 | ### 1.2. Run the Polling Client 46 | Run the *PollingClientApllication* to extract the process data and store them in Kafka. 47 | 48 | ## 2. Using the JSON-Import 49 | This part of the tutorial serves to store process data in Apache Kafka **without having a Camunda database available**. This is for illustrative purposes and integration testing only. 50 | 51 | Since you cloned the spark-importer repository already, you can now build the [kafkatutorialproducer](https://github.com/viadee/bpmn.ai/tree/develop/tutorials/spark%20importer/kafkatutorialproducer) submodule. 52 | 53 | Two JSON based data sources are provided to be imported to Kafka: The *processInstances.json* contains 7 entries to be processed, the *variableUpdate.json* consists of 36 variable updates to be processed. 54 | 55 | By running the *KafkaProducerApp*, Kafka will be filled with data on server defined in the app: "127.0.0.1:19092". 56 | 57 | 58 | ## 3. Next steps 59 | In the fourth tutorial ["Kafka Import and Preprocessing"](https://github.com/viadee/bpmn.ai/wiki/Tutorial-4-%E2%80%90-Kafka-Import-and-Preprocessing), we will look at how to import and preprocess the data in Spark. 60 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: vpw-polling-client 3 | description: A Helm chart for Kubernetes - component of The viadee Process Warehouse - viadee Unternehmensberatung AG 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 1.0.3 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "2.1.0" 25 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. Get the application URL by running these commands: 2 | {{- if .Values.ingress.enabled }} 3 | {{- range $host := .Values.ingress.hosts }} 4 | {{- range .paths }} 5 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} 6 | {{- end }} 7 | {{- end }} 8 | {{- else if contains "NodePort" .Values.service.type }} 9 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "vpw-polling-client-chart.fullname" . }}) 10 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 11 | echo http://$NODE_IP:$NODE_PORT 12 | {{- else if contains "LoadBalancer" .Values.service.type }} 13 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 14 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "vpw-polling-client-chart.fullname" . }}' 15 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "vpw-polling-client-chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") 16 | echo http://$SERVICE_IP:{{ .Values.service.port }} 17 | {{- else if contains "ClusterIP" .Values.service.type }} 18 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "vpw-polling-client-chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") 19 | export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") 20 | echo "Visit http://127.0.0.1:8080 to use your application" 21 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT 22 | {{- end }} 23 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | 5 | {{- define "vpw-polling-client-chart.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 7 | {{- end }} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | 15 | {{- define "vpw-polling-client-chart.fullname" -}} 16 | {{- if .Values.fullnameOverride }} 17 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 18 | {{- else }} 19 | {{- $name := default .Chart.Name .Values.nameOverride }} 20 | {{- if contains $name .Release.Name }} 21 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 22 | {{- else }} 23 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 24 | {{- end }} 25 | {{- end }} 26 | {{- end }} 27 | 28 | {{/* 29 | Create chart name and version as used by the chart label. 30 | */}} 31 | 32 | {{- define "vpw-polling-client-chart.chart" -}} 33 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 34 | {{- end }} 35 | 36 | {{/* 37 | Common labels 38 | */}} 39 | 40 | {{- define "vpw-polling-client-chart.labels" -}} 41 | helm.sh/chart: {{ include "vpw-polling-client-chart.chart" . }} 42 | {{ include "vpw-polling-client-chart.selectorLabels" . }} 43 | {{- if .Chart.AppVersion }} 44 | appVersion: {{ .Chart.AppVersion | quote }} 45 | {{- end }} 46 | managed-by: {{ .Release.Service }} 47 | {{- end }} 48 | 49 | {{/* 50 | Selector labels 51 | */}} 52 | 53 | {{- define "vpw-polling-client-chart.selectorLabels" -}} 54 | name: {{ include "vpw-polling-client-chart.name" . }} 55 | app: {{ .Values.selectorLabels.app | quote }} 56 | component: {{ .Values.selectorLabels.component | quote }} 57 | release: {{ .Values.selectorLabels.release | quote }} 58 | {{- end }} 59 | 60 | {{/* 61 | Create the name of the service account to use 62 | */}} 63 | {{- define "vpw-polling-client-chart.serviceAccountName" -}} 64 | {{- if .Values.serviceAccount.create }} 65 | {{- default (include "vpw-polling-client-chart.fullname" .) .Values.serviceAccount.name }} 66 | {{- else }} 67 | {{- default "default" .Values.serviceAccount.name }} 68 | {{- end }} 69 | {{- end }} 70 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/vpw-polling-client-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | 4 | metadata: 5 | name: {{ .Chart.Name }} 6 | labels: 7 | {{- include "vpw-polling-client-chart.labels" . | nindent 4 }} 8 | 9 | spec: 10 | {{- if not .Values.autoscaling.enabled }} 11 | replicas: {{ .Values.replicaCount }} 12 | {{- end }} 13 | strategy: 14 | type: Recreate 15 | selector: 16 | matchLabels: 17 | {{- include "vpw-polling-client-chart.selectorLabels" . | nindent 6 }} 18 | 19 | template: 20 | metadata: 21 | {{- with .Values.podAnnotations }} 22 | annotations: 23 | {{- toYaml . | nindent 8 }} 24 | {{- end }} 25 | labels: 26 | {{- include "vpw-polling-client-chart.selectorLabels" . | nindent 8 }} 27 | 28 | spec: 29 | {{- with .Values.imagePullSecrets }} 30 | imagePullSecrets: 31 | {{- toYaml . | nindent 8 }} 32 | {{- end }} 33 | serviceAccountName: {{ include "vpw-polling-client-chart.serviceAccountName" . }} 34 | volumes: 35 | {{- if not .Values.persistence.enabled }} 36 | - name: data 37 | emptyDir: { } 38 | {{- end }} 39 | {{- if .Values.persistence.enabled }} 40 | - name: data 41 | persistentVolumeClaim: 42 | claimName: {{ .Chart.Name }}-pvc-data 43 | {{- end }} 44 | securityContext: 45 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 46 | 47 | containers: 48 | - name: {{ .Chart.Name }} 49 | securityContext: 50 | {{- toYaml .Values.securityContext | nindent 12 }} 51 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 52 | imagePullPolicy: {{ .Values.image.pullPolicy }} 53 | ports: 54 | - name: http 55 | containerPort: 8081 56 | protocol: TCP 57 | livenessProbe: 58 | {{ toYaml .Values.livenessProbe | indent 12 }} 59 | readinessProbe: 60 | {{ toYaml .Values.readinessProbe | indent 12 }} 61 | envFrom: 62 | - configMapRef: 63 | name: {{ .Chart.Name }}-environment-config 64 | env: 65 | - name: CAMUNDA_REST_PASSWORD 66 | valueFrom: 67 | secretKeyRef: 68 | {{- if not .Values.environment.secret.externalCamundaSecret }} 69 | name: {{ .Chart.Name }}-environment-secret 70 | key: CAMUNDA_REST_PASSWORD 71 | {{- else -}} 72 | {{- toYaml .Values.environment.secret.externalCamundaSecretData | nindent 18 }} 73 | {{- end}} 74 | volumeMounts: 75 | - mountPath: /data 76 | name: data 77 | resources: 78 | {{- toYaml .Values.resources | nindent 12 }} 79 | 80 | {{- with .Values.nodeSelector }} 81 | nodeSelector: 82 | {{- toYaml . | nindent 8 }} 83 | {{- end }} 84 | {{- with .Values.affinity }} 85 | affinity: 86 | {{- toYaml . | nindent 8 }} 87 | {{- end }} 88 | {{- with .Values.tolerations }} 89 | tolerations: 90 | {{- toYaml . | nindent 8 }} 91 | {{- end }} 92 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/vpw-polling-client-environment-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ .Chart.Name }}-environment-config 5 | labels: 6 | {{- include "vpw-polling-client-chart.labels" . | nindent 4 }} 7 | data: 8 | CAMUNDA_REST_USERNAME: {{ .Values.environment.configMap.camundaRestUsername | quote }} 9 | SERVER_PORT: {{ .Values.environment.configMap.serverPort | quote }} 10 | TZ: {{ .Values.environment.configMap.timeZone | quote }} 11 | polling_runtime-data_interval-in-ms: {{ .Values.environment.configMap.pollingRuntimeDataIntervalInMs | quote }} 12 | polling_runtime-data_last-polled-file: {{ .Values.environment.configMap.pollingRuntimeDataLastPolledFile | quote }} 13 | polling_runtime-data_initial-timestamp: {{ .Values.environment.configMap.pollingRuntimeDataInitialTimestamp | quote }} 14 | polling_repository-data_initial-timestamp: {{ .Values.environment.configMap.pollingRepositoryDataInitialTimestamp | quote }} 15 | polling_repository-data_interval-in-ms: {{ .Values.environment.configMap.pollingRepositoryDataIntervalInMs | quote }} 16 | polling_repository-data_last-polled-file: {{ .Values.environment.configMap.pollingRepositoryDataLastPolledFile | quote }} 17 | KAFKA_BOOTSTRAP_SERVERS: {{ .Values.environment.configMap.kafkaBootstrapServers | quote }} 18 | CAMUNDA_REST_URL: {{ .Values.environment.configMap.camundaRestUrl | quote }} 19 | LOGGING_LEVEL_DE_VIADEE_CAMUNDA_KAFKA_POLLINGCLIENT: {{ .Values.environment.configMap.logLevel | quote }} 20 | LOGGING_LEVEL_ROOT: {{ .Values.environment.configMap.logLevel | quote }} 21 | {{- range .Values.environment.env }} 22 | {{ .name }}: {{ .value | quote}} 23 | {{- end }} -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/vpw-polling-client-environment-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: {{ .Chart.Name }}-environment-secret 5 | labels: 6 | {{- include "vpw-polling-client-chart.labels" . | nindent 4 }} 7 | data: 8 | CAMUNDA_REST_PASSWORD: {{ .Values.environment.secret.camundaPassword | b64enc | quote}} 9 | 10 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/vpw-polling-client-hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2beta1 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "vpw-polling-client-chart.fullname" . }} 6 | labels: 7 | {{- include "vpw-polling-client-chart.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "vpw-polling-client-chart.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 21 | {{- end }} 22 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 23 | - type: Resource 24 | resource: 25 | name: memory 26 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/vpw-polling-client-pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled }} 2 | apiVersion: v1 3 | kind: PersistentVolumeClaim 4 | metadata: 5 | name: {{ .Chart.Name }}-pvc-data 6 | labels: 7 | {{- include "vpw-polling-client-chart.labels" . | nindent 4 }} 8 | spec: 9 | accessModes: 10 | - ReadWriteOnce 11 | resources: 12 | requests: 13 | storage: {{ .Values.persistence.size }} 14 | storageClassName: {{ .Values.persistence.storageClass | quote }} 15 | {{- end }} -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/templates/vpw-polling-client-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "vpw-polling-client-chart.serviceAccountName" . }} 6 | labels: 7 | {{- include "vpw-polling-client-chart.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/deployment/helm/vpw-polling-client-chart/values.yaml: -------------------------------------------------------------------------------- 1 | # 2 | ## viadee Unternehmensberatung AG 3 | # 4 | 5 | # Default values for vpw-polling-client of the viadee Process Warehouse. 6 | # This is a YAML-formatted file. 7 | # Declare variables to be passed into your templates. 8 | 9 | replicaCount: 1 10 | 11 | image: 12 | repository: "public.ecr.aws/viadee/camunda-kafka-polling-client" 13 | pullPolicy: IfNotPresent 14 | # Overrides the image tag whose default is the chart appVersion. 15 | tag: "" 16 | 17 | imagePullSecrets: [] 18 | nameOverride: "" 19 | fullnameOverride: "" 20 | 21 | # Specify labels 22 | labels: {} 23 | 24 | selectorLabels: 25 | # Name of whole application: viadee Process Warehouse (vpw) 26 | app: vpw 27 | # Analyzer as part of the viadee Process Warehouse (vpw) 28 | component: polling-client 29 | # Release name of deployment 30 | release: showcase 31 | 32 | serviceAccount: 33 | # Specifies whether a service account should be created 34 | create: false 35 | # Annotations to add to the service account 36 | annotations: {} 37 | # The name of the service account to use. 38 | # If not set and create is true, a name is generated using the fullname template 39 | name: "" 40 | 41 | podAnnotations: {} 42 | 43 | podSecurityContext: 44 | fsGroup: 1000 # Write access for volume for appuser 45 | 46 | securityContext: {} 47 | # capabilities: 48 | # drop: 49 | # - ALL 50 | # readOnlyRootFilesystem: true 51 | # runAsNonRoot: true 52 | # runAsUser: 1000 53 | 54 | # Polling Client containers' liveness probe. 55 | livenessProbe: 56 | httpGet: 57 | path: /actuator/health 58 | port: http 59 | initialDelaySeconds: 30 60 | timeoutSeconds: 2 61 | periodSeconds: 15 62 | failureThreshold: 3 63 | 64 | # Polling Client containers' readiness probe. 65 | readinessProbe: 66 | httpGet: 67 | path: /actuator/health 68 | port: http 69 | initialDelaySeconds: 10 70 | timeoutSeconds: 2 71 | periodSeconds: 10 72 | failureThreshold: 5 73 | 74 | service: 75 | enabled: false 76 | type: ClusterIP 77 | port: 80 78 | 79 | ingress: 80 | enabled: false 81 | className: "" 82 | annotations: {} 83 | # kubernetes.io/ingress.class: nginx 84 | # kubernetes.io/tls-acme: "true" 85 | hosts: 86 | - host: chart-example.local 87 | paths: 88 | - path: / 89 | pathType: ImplementationSpecific 90 | tls: [] 91 | # - secretName: chart-example-tls 92 | # hosts: 93 | # - chart-example.local 94 | 95 | resources: {} 96 | # We usually recommend not to specify default resources and to leave this as a conscious 97 | # choice for the user. This also increases chances charts run on environments with little 98 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 99 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 100 | # limits: 101 | # cpu: 100m 102 | # memory: 128Mi 103 | # requests: 104 | # cpu: 100m 105 | # memory: 128Mi 106 | 107 | # Volumes 108 | persistence: 109 | enabled: true 110 | storageClass: standard 111 | size: 1Gi 112 | 113 | autoscaling: 114 | enabled: false 115 | minReplicas: 1 116 | maxReplicas: 100 117 | targetCPUUtilizationPercentage: 80 118 | # targetMemoryUtilizationPercentage: 80 119 | 120 | environment: 121 | secret: 122 | # Camunda password to set for authentication from external secret 123 | externalCamundaSecret: false 124 | externalCamundaSecretData: 125 | name: name 126 | key: key 127 | # Camunda password to set directly here if no externalCamundaSecret is specified 128 | camundaPassword: "demo" 129 | configMap: 130 | # Camunda rest url to connect to camunda rest engine 131 | camundaRestUrl: http://camunda-webapp-camunda-bpm-platform:8080/engine-rest/ 132 | # Camunda username for authentication 133 | camundaRestUsername: demo 134 | # Application (Tomcat) server port 135 | serverPort: 8081 136 | # Time zone used for formatting timestamps provided to camunda rest api (Default: System timezone) 137 | timeZone: CEST 138 | # Kafka bootstrap server url to connect to kafka broker (namespace vpw here) 139 | kafkaBootstrapServers: vpw-kafka-0.vpw-kafka-brokers.vpw.svc:9092 140 | # Intervals of data polling 141 | pollingRuntimeDataIntervalInMs: 30000 142 | # Last polled file 143 | pollingRuntimeDataLastPolledFile: /data/lastPolled-runtime.properties 144 | # Last polled repo 145 | pollingRepositoryDataLastPolledFile: data/lastPolled-repository.properties 146 | # Initial start time the polling of runtime data (only relevant for initial polling); format: "yyyy-MM-dd HH:mm:ss". Default is the current time. 147 | pollingRuntimeDataInitialTimestamp: "2000-01-01 00:00:00" 148 | # Initial start time the polling of repository data (only relevant for initial polling); format: "yyyy-MM-dd HH:mm:ss. Default is the current time." 149 | pollingRepositoryDataInitialTimestamp: "2000-01-01 00:00:00" 150 | # Intervals of repository polling 151 | pollingRepositoryDataIntervalInMs: 30000 152 | # Log level 153 | logLevel: INFO 154 | #Add name-value pairs here to inject them dynamically into the configmap. 155 | env: 156 | # Activate spring profile "rest" 157 | - name: SPRING_PROFILES_ACTIVE 158 | value: rest 159 | 160 | nodeSelector: {} 161 | tolerations: [] 162 | affinity: {} 163 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/PollingClientApplication.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | import de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties; 9 | 10 | /** 11 | * @author viadee 12 | * @version $Id: $Id 13 | */ 14 | @SpringBootApplication 15 | @EnableScheduling 16 | @EnableConfigurationProperties(ApplicationProperties.class) 17 | public class PollingClientApplication { 18 | 19 | /** 20 | *

21 | * main. 22 | *

23 | * 24 | * @param args 25 | * an array of {@link java.lang.String} objects. 26 | */ 27 | public static void main(String[] args) { 28 | SpringApplication.run(PollingClientApplication.class, args); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/CamundaJdbcPollingConfiguration.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import org.camunda.bpm.engine.HistoryService; 6 | import org.camunda.bpm.engine.ProcessEngine; 7 | import org.camunda.bpm.engine.ProcessEngineConfiguration; 8 | import org.camunda.bpm.engine.RepositoryService; 9 | import org.camunda.bpm.engine.TaskService; 10 | import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; 11 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 12 | import org.springframework.context.annotation.Bean; 13 | import org.springframework.context.annotation.Configuration; 14 | import org.springframework.context.annotation.Profile; 15 | 16 | import de.viadee.camunda.kafka.pollingclient.config.properties.CamundaJdbcPollingProperties; 17 | import de.viadee.camunda.kafka.pollingclient.service.polling.PollingService; 18 | import de.viadee.camunda.kafka.pollingclient.service.polling.jdbc.CamundaJdbcPollingServiceImpl; 19 | 20 | /** 21 | *

22 | * CamundaJdbcPollingConfiguration class. 23 | *

24 | * 25 | * @author viadee 26 | * @version $Id: $Id 27 | */ 28 | @Configuration 29 | @EnableConfigurationProperties(CamundaJdbcPollingProperties.class) 30 | @Profile("jdbc") 31 | public class CamundaJdbcPollingConfiguration { 32 | 33 | private CamundaJdbcPollingProperties camundaJdbcPollingProperties; 34 | 35 | /** 36 | *

37 | * Constructor for CamundaJdbcPollingConfiguration. 38 | *

39 | * 40 | * @param camundaJdbcPollingProperties 41 | * a {@link de.viadee.camunda.kafka.pollingclient.config.properties.CamundaJdbcPollingProperties} object. 42 | */ 43 | public CamundaJdbcPollingConfiguration(CamundaJdbcPollingProperties camundaJdbcPollingProperties) { 44 | this.camundaJdbcPollingProperties = camundaJdbcPollingProperties; 45 | } 46 | 47 | /** 48 | *

49 | * pollingService. 50 | *

51 | * 52 | * @param historyService 53 | * a {@link org.camunda.bpm.engine.HistoryService} object. 54 | * @param repositoryService 55 | * a {@link org.camunda.bpm.engine.RepositoryService} object. 56 | * @return a {@link de.viadee.camunda.kafka.pollingclient.service.polling.PollingService} object. 57 | */ 58 | @Bean 59 | public PollingService pollingService(HistoryService historyService, RepositoryService repositoryService, 60 | TaskService taskService) { 61 | return new CamundaJdbcPollingServiceImpl(historyService, repositoryService, taskService); 62 | } 63 | 64 | /** 65 | *

66 | * processEngine. 67 | *

68 | * 69 | * @param dataSource 70 | * a {@link javax.sql.DataSource} object. 71 | * @return a {@link org.camunda.bpm.engine.ProcessEngine} object. 72 | */ 73 | @Bean 74 | public ProcessEngine processEngine(DataSource dataSource) { 75 | ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration() 76 | .setDataSource(dataSource) 77 | .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE) 78 | .setJobExecutorActivate(false) 79 | .setHistory(camundaJdbcPollingProperties.getHistoryLevel()) 80 | .buildProcessEngine(); 81 | ProcessEngineConfigurationImpl configuration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration(); 82 | configuration.setMetricsEnabled(false); 83 | return processEngine; 84 | } 85 | 86 | /** 87 | *

88 | * historyService. 89 | *

90 | * 91 | * @param processEngine 92 | * a {@link org.camunda.bpm.engine.ProcessEngine} object. 93 | * @return a {@link org.camunda.bpm.engine.HistoryService} object. 94 | */ 95 | @Bean 96 | public HistoryService historyService(ProcessEngine processEngine) { 97 | return processEngine.getHistoryService(); 98 | } 99 | 100 | @Bean 101 | RepositoryService repositoryService(ProcessEngine processEngine) { 102 | return processEngine.getRepositoryService(); 103 | } 104 | 105 | @Bean 106 | TaskService taskService(ProcessEngine processEngine) { 107 | return processEngine.getTaskService(); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/CamundaRestPollingConfiguration.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config; 2 | 3 | import de.viadee.camunda.kafka.pollingclient.config.properties.CamundaRestPollingProperties; 4 | import de.viadee.camunda.kafka.pollingclient.service.polling.PollingService; 5 | import de.viadee.camunda.kafka.pollingclient.service.polling.rest.CamundaRestPollingServiceImpl; 6 | 7 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 8 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 9 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | import org.springframework.context.annotation.Profile; 13 | import org.springframework.http.client.support.BasicAuthorizationInterceptor; 14 | import org.springframework.web.client.RestTemplate; 15 | import org.springframework.web.util.DefaultUriBuilderFactory; 16 | 17 | import java.util.Collections; 18 | 19 | /** 20 | *

21 | * CamundaRestPollingConfiguration class. 22 | *

23 | * {@link DataSourceAutoConfiguration} is disabled, since data source must not be configured if using rest. 24 | * 25 | * @author viadee 26 | * @version $Id: $Id 27 | */ 28 | @Configuration 29 | @EnableConfigurationProperties(CamundaRestPollingProperties.class) 30 | @EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class) 31 | @Profile("rest") 32 | public class CamundaRestPollingConfiguration { 33 | 34 | private final CamundaRestPollingProperties camundaProperties; 35 | 36 | /** 37 | *

38 | * Constructor for CamundaRestPollingConfiguration. 39 | *

40 | * 41 | * @param camundaProperties 42 | * a {@link de.viadee.camunda.kafka.pollingclient.config.properties.CamundaRestPollingProperties} object. 43 | */ 44 | public CamundaRestPollingConfiguration(CamundaRestPollingProperties camundaProperties) { 45 | this.camundaProperties = camundaProperties; 46 | } 47 | 48 | /** 49 | *

50 | * pollingService. 51 | *

52 | * 53 | * @return a {@link de.viadee.camunda.kafka.pollingclient.service.polling.PollingService} object. 54 | */ 55 | @Bean 56 | public PollingService pollingService() { 57 | return new CamundaRestPollingServiceImpl(camundaProperties, camundaApiRestTemplate()); 58 | } 59 | 60 | /** 61 | *

62 | * camundaApiRestTemplate. 63 | *

64 | * 65 | * @return a {@link org.springframework.web.client.RestTemplate} object. 66 | */ 67 | @Bean 68 | public RestTemplate camundaApiRestTemplate() { 69 | final RestTemplate template = new RestTemplate(); 70 | 71 | // Enable escaping url parameter values. 72 | // Otherwise timezone offset designator (+/-) will result in invalid urls. 73 | final DefaultUriBuilderFactory factory = new DefaultUriBuilderFactory(); 74 | factory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); 75 | template.setUriTemplateHandler(factory); 76 | 77 | if (camundaProperties.isAuthenticationEnabled()) { 78 | template.setInterceptors(Collections.singletonList(new BasicAuthorizationInterceptor( 79 | camundaProperties.getUsername(), 80 | camundaProperties.getPassword()))); 81 | } 82 | 83 | return template; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/RepositoryDataPollingConfiguration.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config; 2 | 3 | import de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties; 4 | import de.viadee.camunda.kafka.pollingclient.job.repository.RepositoryDataPollingJob; 5 | import de.viadee.camunda.kafka.pollingclient.job.repository.RepositoryDataPollingService; 6 | import de.viadee.camunda.kafka.pollingclient.service.event.EventService; 7 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService; 8 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.filebased.FilebasedLastPolledServiceImpl; 9 | import de.viadee.camunda.kafka.pollingclient.service.polling.PollingService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 12 | import org.springframework.context.annotation.Bean; 13 | import org.springframework.context.annotation.Configuration; 14 | 15 | /** 16 | *

17 | * RepositoryDataPollingConfiguration class. 18 | *

19 | * 20 | * @author viadee 21 | * @version $Id: $Id 22 | */ 23 | @Configuration 24 | public class RepositoryDataPollingConfiguration { 25 | 26 | @Autowired 27 | private ApplicationProperties properties; 28 | 29 | @Autowired 30 | private PollingService pollingService; 31 | 32 | @Autowired 33 | private EventService eventService; 34 | 35 | /** 36 | *

37 | * repositoryDataLastPolledService. 38 | *

39 | * 40 | * @return a {@link de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService} object. 41 | */ 42 | @Bean 43 | public LastPolledService repositoryDataLastPolledService() { 44 | return new FilebasedLastPolledServiceImpl(properties.getRepositoryData()); 45 | } 46 | 47 | /** 48 | *

49 | * repositoryDataPollingService. 50 | *

51 | * 52 | * @return a {@link de.viadee.camunda.kafka.pollingclient.job.repository.RepositoryDataPollingService} object. 53 | */ 54 | @Bean 55 | public RepositoryDataPollingService repositoryDataPollingService() { 56 | return new RepositoryDataPollingService(pollingService, repositoryDataLastPolledService(), eventService, 57 | properties); 58 | } 59 | 60 | /** 61 | *

62 | * repositoryDataPollingJob. 63 | *

64 | * 65 | * @return a {@link de.viadee.camunda.kafka.pollingclient.job.repository.RepositoryDataPollingJob} object. 66 | */ 67 | @Bean 68 | @ConditionalOnProperty(name = "polling.repository-data.enabled", havingValue = "true", matchIfMissing = true) 69 | public RepositoryDataPollingJob repositoryDataPollingJob() { 70 | return new RepositoryDataPollingJob(repositoryDataPollingService()); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/RuntimeDataPollingConfiguration.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config; 2 | 3 | import de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties; 4 | import de.viadee.camunda.kafka.pollingclient.job.runtime.RuntimeDataPollingJob; 5 | import de.viadee.camunda.kafka.pollingclient.job.runtime.RuntimeDataPollingService; 6 | import de.viadee.camunda.kafka.pollingclient.service.event.EventService; 7 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService; 8 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.filebased.FilebasedLastPolledServiceImpl; 9 | import de.viadee.camunda.kafka.pollingclient.service.polling.PollingService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 12 | import org.springframework.context.annotation.Bean; 13 | import org.springframework.context.annotation.Configuration; 14 | 15 | /** 16 | *

17 | * RuntimeDataPollingConfiguration class. 18 | *

19 | * 20 | * @author viadee 21 | * @version $Id: $Id 22 | */ 23 | @Configuration 24 | public class RuntimeDataPollingConfiguration { 25 | 26 | @Autowired 27 | private ApplicationProperties properties; 28 | 29 | @Autowired 30 | private PollingService pollingService; 31 | 32 | @Autowired 33 | private EventService eventService; 34 | 35 | /** 36 | *

37 | * runtimeDataLastPolledService. 38 | *

39 | * 40 | * @return a {@link de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService} object. 41 | */ 42 | @Bean 43 | public LastPolledService runtimeDataLastPolledService() { 44 | return new FilebasedLastPolledServiceImpl(properties.getRuntimeData()); 45 | } 46 | 47 | /** 48 | *

49 | * runtimeDataPollingService. 50 | *

51 | * 52 | * @return a {@link de.viadee.camunda.kafka.pollingclient.job.runtime.RuntimeDataPollingService} object. 53 | */ 54 | @Bean 55 | public RuntimeDataPollingService runtimeDataPollingService() { 56 | return new RuntimeDataPollingService(pollingService, runtimeDataLastPolledService(), eventService, properties); 57 | } 58 | 59 | /** 60 | *

61 | * runtimeDataPollingJob. 62 | *

63 | * 64 | * @return a {@link de.viadee.camunda.kafka.pollingclient.job.runtime.RuntimeDataPollingJob} object. 65 | */ 66 | @Bean 67 | @ConditionalOnProperty(name = "polling.runtime-data.enabled", havingValue = "true", matchIfMissing = true) 68 | public RuntimeDataPollingJob runtimeDataPollingJob() { 69 | return new RuntimeDataPollingJob(runtimeDataPollingService()); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/properties/ApplicationProperties.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config.properties; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | import org.springframework.boot.context.properties.NestedConfigurationProperty; 5 | 6 | import java.util.HashMap; 7 | import java.util.HashSet; 8 | import java.util.Map; 9 | import java.util.Set; 10 | 11 | /** 12 | *

13 | * ApplicationProperties class. 14 | *

15 | * 16 | * @author viadee 17 | * @version $Id: $Id 18 | */ 19 | @ConfigurationProperties(prefix = "polling") 20 | public class ApplicationProperties { 21 | 22 | /** 23 | * Configuration for polling runtime data 24 | */ 25 | @NestedConfigurationProperty 26 | private PollingProperties runtimeData = new PollingProperties(); 27 | 28 | /** 29 | * Configuration for polling repository data 30 | */ 31 | @NestedConfigurationProperty 32 | private PollingProperties repositoryData = new PollingProperties(); 33 | 34 | /** 35 | * Configuration of kafka topics to use on event type basis: Mapping of event type (event class name without "Event" 36 | * suffix) to kafka topic name. Default topic of an event is the event type. 37 | */ 38 | private Map eventTopics = new HashMap<>(); 39 | 40 | /** 41 | * Configuration of events to poll 42 | */ 43 | private Set pollingEvents = new HashSet<>(); 44 | 45 | /** 46 | * Timeout to wait while sending an polling event to kafka 47 | */ 48 | private long kafkaSendTimeoutInSeconds = 60; 49 | 50 | public enum PollingEvents { 51 | PROCESS_INSTANCE_UNFINISHED, 52 | PROCESS_INSTANCE_FINISHED, 53 | ACTIVITY_UNFINISHED, 54 | ACTIVITY_FINISHED, 55 | /** 56 | * Poll variable details of finished process instances. (Only possible if finished process instances are also 57 | * polled {@link #PROCESS_INSTANCE_FINISHED}) 58 | */ 59 | VARIABLE_DETAILS_FINISHED, 60 | /** 61 | * Poll variable details of unfinished process instances. (Only possible if unfinished process instances are 62 | * also polled {@link #PROCESS_INSTANCE_UNFINISHED}) 63 | */ 64 | VARIABLE_DETAILS_UNFINISHED, 65 | /** 66 | * Poll last variable values of finished process instances. (Only possible if finished process instances are 67 | * also polled {@link #PROCESS_INSTANCE_FINISHED}) 68 | */ 69 | VARIABLE_CURRENT_FINISHED, 70 | /** 71 | * Poll last variable values of unfinished process instances. (Only possible if unfinished process instances are 72 | * also polled {@link #PROCESS_INSTANCE_UNFINISHED}) 73 | */ 74 | VARIABLE_CURRENT_UNFINISHED, 75 | PROCESS_DEFINITION, 76 | TASK_COMMENTS, 77 | IDENTITY_LINKS_UNFINISHED_ACTIVITIES, 78 | IDENTITY_LINKS_FINISHED_ACTIVITIES 79 | } 80 | 81 | public long getKafkaSendTimeoutInSeconds() { 82 | return kafkaSendTimeoutInSeconds; 83 | } 84 | 85 | public void setKafkaSendTimeoutInSeconds(long kafkaSendTimeoutInSeconds) { 86 | this.kafkaSendTimeoutInSeconds = kafkaSendTimeoutInSeconds; 87 | } 88 | 89 | public PollingProperties getRuntimeData() { 90 | return runtimeData; 91 | } 92 | 93 | public void setRuntimeData(PollingProperties runtimeData) { 94 | this.runtimeData = runtimeData; 95 | } 96 | 97 | public PollingProperties getRepositoryData() { 98 | return repositoryData; 99 | } 100 | 101 | public void setRepositoryData(PollingProperties repositoryData) { 102 | this.repositoryData = repositoryData; 103 | } 104 | 105 | public Map getEventTopics() { 106 | return eventTopics; 107 | } 108 | 109 | public void setEventTopics(Map eventTopics) { 110 | this.eventTopics = eventTopics; 111 | } 112 | 113 | public Set getPollingEvents() { 114 | return pollingEvents; 115 | } 116 | 117 | public void setPollingEvents(Set pollingEvents) { 118 | this.pollingEvents = pollingEvents; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/properties/CamundaJdbcPollingProperties.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config.properties; 2 | 3 | import org.camunda.bpm.engine.ProcessEngineConfiguration; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | 6 | /** 7 | * Properties for polling using Camunda JDBC API 8 | * 9 | * @version $Id: $Id 10 | */ 11 | @ConfigurationProperties(prefix = "polling.camunda.jdbc") 12 | public class CamundaJdbcPollingProperties { 13 | 14 | /** 15 | * History level to set in process engine. One of 'auto', 'full', 'audit', 'variable'. For details, see Camunda 16 | * documentation. 17 | */ 18 | private String historyLevel = ProcessEngineConfiguration.HISTORY_AUTO; 19 | 20 | /** 21 | * Camunda history level 22 | */ 23 | public String getHistoryLevel() { 24 | return historyLevel; 25 | } 26 | 27 | /** 28 | * Camunda history level 29 | */ 30 | public void setHistoryLevel(String historyLevel) { 31 | this.historyLevel = historyLevel; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/properties/CamundaRestPollingProperties.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config.properties; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | 6 | /** 7 | * Properties for polling using Camunda REST API 8 | * 9 | * @author viadee 10 | * @version $Id: $Id 11 | */ 12 | @ConfigurationProperties(prefix = "polling.camunda.rest") 13 | public class CamundaRestPollingProperties { 14 | 15 | private static final String DEFAULT_DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; 16 | 17 | /** 18 | * URL of Camunda REST API 19 | */ 20 | private String url; 21 | 22 | /** 23 | * Username used for authentication 24 | */ 25 | private String username; 26 | 27 | /** 28 | * Password used for authentication 29 | */ 30 | private String password; 31 | 32 | /** 33 | * Source Time Zone used for Date formatting 34 | */ 35 | private String sourceTimeZone; 36 | 37 | /** 38 | * The pattern string for Date formatter. 39 | */ 40 | private String dateFormatPattern; 41 | 42 | /** 43 | *

44 | * isAuthenticationEnabled. 45 | *

46 | * 47 | * @return a boolean. 48 | */ 49 | public boolean isAuthenticationEnabled() { 50 | return StringUtils.isNotEmpty(username); 51 | } 52 | 53 | /** 54 | * URL of Camunda REST API 55 | */ 56 | @java.lang.SuppressWarnings("all") 57 | public String getUrl() { 58 | return this.url; 59 | } 60 | 61 | /** 62 | * Username used for authentication 63 | */ 64 | @java.lang.SuppressWarnings("all") 65 | public String getUsername() { 66 | return this.username; 67 | } 68 | 69 | /** 70 | * Password used for authentication 71 | */ 72 | @java.lang.SuppressWarnings("all") 73 | public String getPassword() { 74 | return this.password; 75 | } 76 | 77 | /** 78 | * Source Time Zone used for Date formatting 79 | */ 80 | @SuppressWarnings("all") 81 | public String getSourceTimeZone() { 82 | return sourceTimeZone; 83 | } 84 | 85 | /** 86 | * The pattern string for Date formatter. 87 | */ 88 | @java.lang.SuppressWarnings("all") 89 | public String getDateFormatPattern() { 90 | if (dateFormatPattern == null || dateFormatPattern.isEmpty()) 91 | dateFormatPattern = DEFAULT_DATE_FORMAT_PATTERN; 92 | return dateFormatPattern; 93 | } 94 | 95 | /** 96 | * URL of Camunda REST API 97 | */ 98 | @java.lang.SuppressWarnings("all") 99 | public void setUrl(final String url) { 100 | this.url = url; 101 | } 102 | 103 | /** 104 | * Username used for authentication 105 | */ 106 | @java.lang.SuppressWarnings("all") 107 | public void setUsername(final String username) { 108 | this.username = username; 109 | } 110 | 111 | /** 112 | * Password used for authentication 113 | */ 114 | @java.lang.SuppressWarnings("all") 115 | public void setPassword(final String password) { 116 | this.password = password; 117 | } 118 | 119 | /** 120 | * Source Time Zone used for Date formatting 121 | */ 122 | @SuppressWarnings("all") 123 | public void setSourceTimeZone(String sourceTimeZone) { 124 | this.sourceTimeZone = sourceTimeZone; 125 | } 126 | 127 | /** 128 | * The pattern string for Date formatter. 129 | */ 130 | @SuppressWarnings("all") 131 | public void setDateFormatPattern(String dateFormatPattern) { 132 | this.dateFormatPattern = dateFormatPattern; 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/config/properties/PollingProperties.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.config.properties; 2 | 3 | import org.springframework.format.annotation.DateTimeFormat; 4 | 5 | import java.io.File; 6 | import java.util.Date; 7 | 8 | /** 9 | *

10 | * PollingProperties class. 11 | *

12 | * 13 | * @author viadee 14 | * @version $Id: $Id 15 | */ 16 | 17 | public class PollingProperties { 18 | 19 | /** 20 | * Initial timestamp to start polling with in case no polling has been performed before. (Default: Start timestamp 21 | * of polling client) 22 | */ 23 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 24 | private Date initialTimestamp = new Date(); 25 | 26 | /** 27 | * Polling intervall in ms 28 | */ 29 | private long intervalInMs; 30 | 31 | /** 32 | * File to store properties of last polled marker 33 | */ 34 | private File lastPolledFile; 35 | 36 | /** 37 | * Enable/disable polling 38 | */ 39 | private boolean enabled; 40 | 41 | /** 42 | * The ms polling slice ends before the current time stamp 43 | */ 44 | private long backwardOffsetInMs; 45 | 46 | /** 47 | * Initial timestamp to start polling with in case no polling has been performed before. (Default: Start timestamp 48 | * of polling client) 49 | */ 50 | @java.lang.SuppressWarnings("all") 51 | public Date getInitialTimestamp() { 52 | return this.initialTimestamp; 53 | } 54 | 55 | /** 56 | * Polling intervall in ms 57 | */ 58 | @java.lang.SuppressWarnings("all") 59 | public long getIntervalInMs() { 60 | return this.intervalInMs; 61 | } 62 | 63 | /** 64 | * File to store properties of last polled marker 65 | */ 66 | @java.lang.SuppressWarnings("all") 67 | public File getLastPolledFile() { 68 | return this.lastPolledFile; 69 | } 70 | 71 | /** 72 | * Enable/disable polling 73 | */ 74 | @java.lang.SuppressWarnings("all") 75 | public boolean isEnabled() { 76 | return this.enabled; 77 | } 78 | 79 | /** 80 | * Initial timestamp to start polling with in case no polling has been performed before. (Default: Start timestamp 81 | * of polling client) 82 | */ 83 | @java.lang.SuppressWarnings("all") 84 | public void setInitialTimestamp(final Date initialTimestamp) { 85 | this.initialTimestamp = initialTimestamp; 86 | } 87 | 88 | /** 89 | * Polling intervall in ms 90 | */ 91 | @java.lang.SuppressWarnings("all") 92 | public void setIntervalInMs(final long intervalInMs) { 93 | this.intervalInMs = intervalInMs; 94 | } 95 | 96 | /** 97 | * File to store properties of last polled marker 98 | */ 99 | @java.lang.SuppressWarnings("all") 100 | public void setLastPolledFile(final File lastPolledFile) { 101 | this.lastPolledFile = lastPolledFile; 102 | } 103 | 104 | /** 105 | * Enable/disable polling 106 | */ 107 | @java.lang.SuppressWarnings("all") 108 | public void setEnabled(final boolean enabled) { 109 | this.enabled = enabled; 110 | } 111 | 112 | /** 113 | * The ms polling slice ends before the current time stamp 114 | */ 115 | @java.lang.SuppressWarnings("all") 116 | public long getBackwardOffsetInMs() { 117 | return backwardOffsetInMs; 118 | } 119 | 120 | /** 121 | * The ms polling slice ends before the current time stamp 122 | */ 123 | @java.lang.SuppressWarnings("all") 124 | public void setBackwardOffsetInMs(long backwardOffsetInMs) { 125 | this.backwardOffsetInMs = backwardOffsetInMs; 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/job/repository/RepositoryDataPollingJob.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.job.repository; 2 | 3 | import org.springframework.scheduling.annotation.Scheduled; 4 | 5 | /** 6 | *

7 | * RepositoryDataPollingJob class. 8 | *

9 | * 10 | * @author viadee 11 | * @version $Id: $Id 12 | */ 13 | public class RepositoryDataPollingJob { 14 | 15 | private final RepositoryDataPollingService repositoryDataPollingService; 16 | 17 | /** 18 | *

19 | * Constructor for RepositoryDataPollingJob. 20 | *

21 | * 22 | * @param repositoryDataPollingService 23 | * a {@link de.viadee.camunda.kafka.pollingclient.job.repository.RepositoryDataPollingService} object. 24 | */ 25 | public RepositoryDataPollingJob(final RepositoryDataPollingService repositoryDataPollingService) { 26 | this.repositoryDataPollingService = repositoryDataPollingService; 27 | } 28 | 29 | /** 30 | *

31 | * executeScheduled. 32 | *

33 | */ 34 | @Scheduled(initialDelay = 500L, fixedDelayString = "${polling.repository-data.interval-in-ms}") 35 | public void executeScheduled() { 36 | repositoryDataPollingService.run(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/job/repository/RepositoryDataPollingService.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.job.repository; 2 | 3 | import de.viadee.camunda.kafka.event.ProcessDefinitionEvent; 4 | import de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties; 5 | import de.viadee.camunda.kafka.pollingclient.service.event.EventService; 6 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService; 7 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.PollingTimeslice; 8 | import de.viadee.camunda.kafka.pollingclient.service.polling.PollingService; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | 12 | /** 13 | * Implementation of polling repository data 14 | * 15 | * @author viadee 16 | * @version $Id: $Id 17 | */ 18 | public class RepositoryDataPollingService implements Runnable { 19 | 20 | private static final Logger LOGGER = LoggerFactory.getLogger(RepositoryDataPollingService.class); 21 | 22 | private final PollingService pollingService; 23 | 24 | private final LastPolledService lastPolledService; 25 | 26 | private final EventService eventService; 27 | 28 | private final ApplicationProperties properties; 29 | 30 | /** 31 | *

32 | * Constructor for RepositoryDataPollingService. 33 | *

34 | * 35 | * @param pollingService 36 | * a {@link de.viadee.camunda.kafka.pollingclient.service.polling.PollingService} object. 37 | * @param lastPolledService 38 | * a {@link de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService} object. 39 | * @param eventService 40 | * a {@link de.viadee.camunda.kafka.pollingclient.service.event.EventService} object. 41 | * @param properties 42 | * a {@link de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties} object. 43 | */ 44 | public RepositoryDataPollingService(PollingService pollingService, LastPolledService lastPolledService, 45 | EventService eventService, ApplicationProperties properties) { 46 | this.pollingService = pollingService; 47 | this.lastPolledService = lastPolledService; 48 | this.eventService = eventService; 49 | this.properties = properties; 50 | } 51 | 52 | /** {@inheritDoc} */ 53 | @Override 54 | public void run() { 55 | final PollingTimeslice pollingTimeslice = lastPolledService.getPollingTimeslice(); 56 | 57 | LOGGER.info("Start polling repository data: {}", pollingTimeslice); 58 | 59 | pollProcessDefinitions(pollingTimeslice); 60 | 61 | lastPolledService.updatePollingTimeslice(pollingTimeslice); 62 | 63 | LOGGER.info("Finished polling repository data: {}", pollingTimeslice); 64 | } 65 | 66 | private void pollProcessDefinitions(final PollingTimeslice pollingTimeslice) { 67 | if (properties.getPollingEvents().contains(ApplicationProperties.PollingEvents.PROCESS_DEFINITION)) { 68 | for (final ProcessDefinitionEvent processDefinitionEvent : pollingService 69 | .pollProcessDefinitions(pollingTimeslice.getStartTime(), 70 | pollingTimeslice.getEndTime())) { 71 | eventService.sendEvent(processDefinitionEvent); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/job/runtime/RuntimeDataPollingJob.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.job.runtime; 2 | 3 | import org.springframework.scheduling.annotation.Scheduled; 4 | 5 | /** 6 | *

7 | * RuntimeDataPollingJob class. 8 | *

9 | * 10 | * @author viadee 11 | * @version $Id: $Id 12 | */ 13 | public class RuntimeDataPollingJob { 14 | 15 | private final RuntimeDataPollingService runtimeDataPollingService; 16 | 17 | /** 18 | *

19 | * Constructor for RuntimeDataPollingJob. 20 | *

21 | * 22 | * @param runtimeDataPollingService 23 | * a {@link de.viadee.camunda.kafka.pollingclient.job.runtime.RuntimeDataPollingService} object. 24 | */ 25 | public RuntimeDataPollingJob(final RuntimeDataPollingService runtimeDataPollingService) { 26 | this.runtimeDataPollingService = runtimeDataPollingService; 27 | } 28 | 29 | /** 30 | *

31 | * executeScheduled. 32 | *

33 | */ 34 | @Scheduled(initialDelay = 500L, fixedDelayString = "${polling.runtime-data.interval-in-ms}") 35 | public void executeScheduled() { 36 | runtimeDataPollingService.run(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/event/EventService.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.event; 2 | 3 | import de.viadee.camunda.kafka.event.DeploymentEvent; 4 | import de.viadee.camunda.kafka.event.HistoryEvent; 5 | 6 | /** 7 | *

8 | * EventService interface. 9 | *

10 | * 11 | * @author viadee 12 | * @version $Id: $Id 13 | */ 14 | public interface EventService { 15 | 16 | /** 17 | *

18 | * sendEvent. 19 | *

20 | * 21 | * @param event 22 | * a {@link de.viadee.camunda.kafka.event.HistoryEvent} object. 23 | */ 24 | void sendEvent(HistoryEvent event); 25 | 26 | /** 27 | *

28 | * sendEvent. 29 | *

30 | * 31 | * @param event 32 | * a {@link de.viadee.camunda.kafka.event.DeploymentEvent} object. 33 | */ 34 | void sendEvent(DeploymentEvent event); 35 | } 36 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/event/kafka/KafkaEventServiceImpl.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.event.kafka; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import de.viadee.camunda.kafka.event.DeploymentEvent; 6 | import de.viadee.camunda.kafka.event.HistoryEvent; 7 | import de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties; 8 | import de.viadee.camunda.kafka.pollingclient.service.event.EventService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.kafka.core.KafkaTemplate; 11 | import org.springframework.stereotype.Component; 12 | 13 | import java.util.concurrent.ExecutionException; 14 | import java.util.concurrent.TimeUnit; 15 | import java.util.concurrent.TimeoutException; 16 | 17 | import static org.apache.commons.lang3.StringUtils.removeEnd; 18 | import static org.apache.commons.lang3.StringUtils.uncapitalize; 19 | 20 | /** 21 | *

22 | * KafkaEventServiceImpl class. 23 | *

24 | * 25 | * @author viadee 26 | * @version $Id: $Id 27 | */ 28 | @Component 29 | public class KafkaEventServiceImpl implements EventService { 30 | 31 | private final ObjectMapper objectMapper = new ObjectMapper(); 32 | 33 | private final KafkaTemplate kafkaTemplate; 34 | 35 | private final ApplicationProperties properties; 36 | 37 | /** 38 | *

39 | * Constructor for KafkaEventServiceImpl. 40 | *

41 | * 42 | * @param kafkaTemplate 43 | * a {@link org.springframework.kafka.core.KafkaTemplate} object. 44 | * @param properties 45 | * a {@link de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties} object. 46 | */ 47 | @Autowired 48 | public KafkaEventServiceImpl(KafkaTemplate kafkaTemplate, ApplicationProperties properties) { 49 | this.kafkaTemplate = kafkaTemplate; 50 | this.properties = properties; 51 | } 52 | 53 | /** 54 | * {@inheritDoc} 55 | */ 56 | @Override 57 | public void sendEvent(HistoryEvent event) { 58 | try { 59 | final String payload = this.objectMapper.writeValueAsString(event); 60 | 61 | kafkaTemplate.send(getTopicName(event), event.getId(), payload) 62 | .get(properties.getKafkaSendTimeoutInSeconds(), TimeUnit.SECONDS); 63 | } catch (JsonProcessingException | ExecutionException e) { 64 | throw new RuntimeException("Error sending history event to kafka", e); 65 | } catch (InterruptedException | TimeoutException e) { 66 | throw new RuntimeException("Waiting for history event being send to kafka interrupted / timed out", e); 67 | } 68 | } 69 | 70 | /** 71 | * {@inheritDoc} 72 | */ 73 | @Override 74 | public void sendEvent(final DeploymentEvent event) { 75 | try { 76 | final String payload = this.objectMapper.writeValueAsString(event); 77 | 78 | kafkaTemplate.send(getTopicName(event), event.getId(), payload) 79 | .get(properties.getKafkaSendTimeoutInSeconds(), TimeUnit.SECONDS); 80 | } catch (JsonProcessingException | ExecutionException e) { 81 | throw new RuntimeException("Error sending deployment event to kafka", e); 82 | } catch (InterruptedException | TimeoutException e) { 83 | throw new RuntimeException("Waiting for deployment event being send to kafka interrupted / timed out", e); 84 | } 85 | } 86 | 87 | private String getTopicName(DeploymentEvent event) { 88 | final String eventName = uncapitalize(removeEnd(event.getClass().getSimpleName(), "Event")); 89 | 90 | return properties.getEventTopics().getOrDefault(eventName, eventName); 91 | } 92 | 93 | private String getTopicName(HistoryEvent event) { 94 | final String eventName = uncapitalize(removeEnd(event.getClass().getSimpleName(), "Event")); 95 | 96 | return properties.getEventTopics().getOrDefault(eventName, eventName); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/lastpolled/LastPolledService.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.lastpolled; 2 | 3 | /** 4 | *

5 | * LastPolledService interface. 6 | *

7 | * 8 | * @author viadee 9 | * @version $Id: $Id 10 | */ 11 | public interface LastPolledService { 12 | 13 | /** 14 | * Provide time slice of last polling. If none already available, initial slice is provided. 15 | * 16 | * @return a {@link de.viadee.camunda.kafka.pollingclient.service.lastpolled.PollingTimeslice} object. 17 | */ 18 | PollingTimeslice getPollingTimeslice(); 19 | 20 | /** 21 | * Update polling time slice to mark given slice as polled. 22 | * 23 | * @param pollingTimeslice 24 | * a {@link de.viadee.camunda.kafka.pollingclient.service.lastpolled.PollingTimeslice} object. 25 | */ 26 | void updatePollingTimeslice(PollingTimeslice pollingTimeslice); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/lastpolled/PollingTimeslice.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.lastpolled; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | /** 7 | * Defines the time slice to perform polling for. 8 | * 9 | * The slice is defined by the interval to poll data starting with {@link #startTime} and ending with {@link #endTime}. 10 | * To prevent polling incomplete process data, an initial cutoff timestamp {@link #cutoffTime} is provided. All data 11 | * polled must be after this cutoff time. This means, a process started before this cutoff time, must not be polled at 12 | * all. 13 | * 14 | * Following rules apply: 15 | *
    16 | *
  1. {@link #cutoffTime} < {@link #startTime}
  2. 17 | *
  3. {@link #startTime} < {@link #endTime}
  4. 18 | *
  5. {@link #cutoffTime} is inclusive
  6. 19 | *
  7. {@link #startTime} is inclusive
  8. 20 | *
  9. {@link #endTime} is exclusive
  10. 21 | *
22 | * 23 | * @author viadee 24 | * @version $Id: $Id 25 | */ 26 | public class PollingTimeslice { 27 | 28 | private final SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); 29 | 30 | /** 31 | * First polling slice start. No data should be polled before this point. 32 | */ 33 | private final Date cutoffTime; 34 | 35 | /** 36 | * Start of polling slice 37 | */ 38 | private final Date startTime; 39 | 40 | /** 41 | * End of polling slice 42 | */ 43 | private final Date endTime; 44 | 45 | public PollingTimeslice(final Date cutoffTime, final Date startTime, final Date endTime) { 46 | this.cutoffTime = cutoffTime; 47 | this.startTime = startTime; 48 | this.endTime = endTime; 49 | } 50 | 51 | /** 52 | * First polling slice start. No data should be polled before this point. 53 | */ 54 | public Date getCutoffTime() { 55 | return this.cutoffTime; 56 | } 57 | 58 | /** 59 | * Start of polling slice 60 | */ 61 | public Date getStartTime() { 62 | return this.startTime; 63 | } 64 | 65 | /** 66 | * End of polling slice 67 | */ 68 | public Date getEndTime() { 69 | return this.endTime; 70 | } 71 | 72 | @Override 73 | public java.lang.String toString() { 74 | return "PollingTimeslice(cutoffTime=" + timeFormat.format(cutoffTime) + ", startTime=" + timeFormat 75 | .format(startTime) 76 | + ", endTime=" + timeFormat.format(endTime) + ")"; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/lastpolled/filebased/FilebasedLastPolledServiceImpl.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.lastpolled.filebased; 2 | 3 | import de.viadee.camunda.kafka.pollingclient.config.properties.PollingProperties; 4 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService; 5 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.PollingTimeslice; 6 | import org.apache.commons.collections4.MapUtils; 7 | import org.apache.commons.io.FileUtils; 8 | 9 | import java.io.BufferedInputStream; 10 | import java.io.BufferedOutputStream; 11 | import java.io.File; 12 | import java.io.IOException; 13 | import java.util.Date; 14 | import java.util.Properties; 15 | 16 | import static org.apache.commons.lang3.StringUtils.join; 17 | 18 | /** 19 | * Implementation of file based last polled data. 20 | *

21 | * This implementation might be optimized to perform some kind of caching instead of always performing synchronous IO. 22 | * 23 | * @author viadee 24 | * @version $Id: $Id 25 | */ 26 | public class FilebasedLastPolledServiceImpl implements LastPolledService { 27 | 28 | private static final String CUTOFF_TIMESTAMP_PROPERTY = "cutoff"; 29 | 30 | private static final String LAST_POLLED_TIMESTAMP_PROPERTY = "lastPolled"; 31 | 32 | private final PollingProperties pollingProperties; 33 | 34 | /** 35 | *

36 | * Constructor for FilebasedLastPolledServiceImpl. 37 | *

38 | * 39 | * @param pollingProperties 40 | * a {@link de.viadee.camunda.kafka.pollingclient.config.properties.PollingProperties} object. 41 | */ 42 | public FilebasedLastPolledServiceImpl(final PollingProperties pollingProperties) { 43 | this.pollingProperties = pollingProperties; 44 | } 45 | 46 | /** {@inheritDoc} */ 47 | @Override 48 | public PollingTimeslice getPollingTimeslice() { 49 | final Properties properties = readProperties(); 50 | final Long lastPolledTimestampLong = MapUtils.getLong(properties, LAST_POLLED_TIMESTAMP_PROPERTY); 51 | final Long cutoffTimestampLong = MapUtils.getLong(properties, CUTOFF_TIMESTAMP_PROPERTY); 52 | 53 | final Date cutoffTimestamp; 54 | if (cutoffTimestampLong == null) { 55 | cutoffTimestamp = pollingProperties.getInitialTimestamp(); 56 | } else { 57 | cutoffTimestamp = new Date(cutoffTimestampLong); 58 | } 59 | 60 | Date startTimestamp; 61 | if (lastPolledTimestampLong == null) { 62 | startTimestamp = cutoffTimestamp; 63 | } else { 64 | startTimestamp = new Date(lastPolledTimestampLong); 65 | 66 | if (startTimestamp.compareTo(cutoffTimestamp) < 0) { 67 | startTimestamp = cutoffTimestamp; 68 | } 69 | } 70 | 71 | Date endTimestamp = new Date(new Date().getTime() - pollingProperties.getBackwardOffsetInMs()); 72 | if (endTimestamp.compareTo(startTimestamp) < 0) { 73 | endTimestamp = startTimestamp; 74 | } 75 | 76 | return new PollingTimeslice(cutoffTimestamp, startTimestamp, endTimestamp); 77 | } 78 | 79 | private Properties readProperties() { 80 | final File lastPolledFile = pollingProperties.getLastPolledFile(); 81 | final Properties properties = new Properties(); 82 | 83 | if (!lastPolledFile.canRead()) { 84 | return properties; 85 | } 86 | 87 | try (final BufferedInputStream in = new BufferedInputStream(FileUtils.openInputStream(lastPolledFile))) { 88 | properties.load(in); 89 | } catch (final IOException e) { 90 | throw new RuntimeException(join("Error reading last polled data from ", lastPolledFile), e); 91 | } 92 | 93 | return properties; 94 | } 95 | 96 | /** {@inheritDoc} */ 97 | @Override 98 | public void updatePollingTimeslice(final PollingTimeslice pollingTimeslice) { 99 | final File lastPolledFile = pollingProperties.getLastPolledFile(); 100 | 101 | final Properties properties = new Properties(); 102 | properties.put(LAST_POLLED_TIMESTAMP_PROPERTY, Long.toString(pollingTimeslice.getEndTime().getTime())); 103 | properties.put(CUTOFF_TIMESTAMP_PROPERTY, Long.toString(pollingTimeslice.getCutoffTime().getTime())); 104 | 105 | try (final BufferedOutputStream out = new BufferedOutputStream(FileUtils.openOutputStream(lastPolledFile))) { 106 | properties.store(out, ""); 107 | } catch (final IOException e) { 108 | throw new RuntimeException(join("Error writing last polled timestamp to ", lastPolledFile), e); 109 | } 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/PollingService.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.polling; 2 | 3 | import de.viadee.camunda.kafka.event.*; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | *

9 | * PollingService interface. 10 | *

11 | * 12 | * @author viadee 13 | * @version $Id: $Id 14 | */ 15 | public interface PollingService { 16 | 17 | /** 18 | * Poll finished process instances from history. 19 | * 20 | * @param startedAfter 21 | * inclusive 22 | * @param startedBefore 23 | * exclusive 24 | * @param finishedAfter 25 | * inclusive 26 | * @return a {@link java.lang.Iterable} object. 27 | */ 28 | Iterable pollFinishedProcessInstances(Date startedAfter, Date startedBefore, 29 | Date finishedAfter); 30 | 31 | /** 32 | * Poll unfinished process instances. 33 | * 34 | * @param startedAfter 35 | * inclusive 36 | * @param startedBefore 37 | * exclusive 38 | * @return a {@link java.lang.Iterable} object. 39 | */ 40 | Iterable pollUnfinishedProcessInstances(Date startedAfter, Date startedBefore); 41 | 42 | /** 43 | * Poll finished activities from history. 44 | * 45 | * @param processInstanceId 46 | * a {@link java.lang.String} object. 47 | * @param finishedAfter 48 | * inclusive 49 | * @param finishedBefore 50 | * exclusive 51 | * @return a {@link java.lang.Iterable} object. 52 | */ 53 | Iterable pollFinishedActivities(String processInstanceId, Date finishedAfter, 54 | Date finishedBefore); 55 | 56 | /** 57 | * Poll unfinished activities. 58 | * 59 | * @param processInstanceId 60 | * a {@link java.lang.String} object. 61 | * @param startedAfter 62 | * inclusive 63 | * @param startedBefore 64 | * exclusive 65 | * @return a {@link java.lang.Iterable} object. 66 | */ 67 | Iterable pollUnfinishedActivities(String processInstanceId, Date startedAfter, 68 | Date startedBefore); 69 | 70 | /** 71 | *

72 | * pollCurrentVariables. 73 | *

74 | * 75 | * @param activityInstanceId 76 | * a {@link java.lang.String} object. 77 | * @return a {@link java.lang.Iterable} object. 78 | */ 79 | Iterable pollCurrentVariables(String activityInstanceId); 80 | 81 | /** 82 | *

83 | * pollVariableDetails. 84 | *

85 | * 86 | * @param activityInstanceId 87 | * a {@link java.lang.String} object. 88 | * @return a {@link java.lang.Iterable} object. 89 | */ 90 | Iterable pollVariableDetails(String activityInstanceId); 91 | 92 | /** 93 | * Poll process definitions 94 | * 95 | * @param deploymentAfter 96 | * inclusive 97 | * @param deploymentBefore 98 | * exclusive 99 | * @return a {@link java.lang.Iterable} object. 100 | */ 101 | Iterable pollProcessDefinitions(Date deploymentAfter, Date deploymentBefore); 102 | 103 | /** 104 | * Poll comments for specified task 105 | * 106 | * @param activityInstanceEvent 107 | * @return a {@link java.lang.Iterable} object. 108 | */ 109 | Iterable pollComments(ActivityInstanceEvent activityInstanceEvent); 110 | 111 | /** 112 | * Poll Identity-Links for specified task 113 | * 114 | * @param activityInstanceEvent 115 | * @return a {@link java.lang.Iterable} object. 116 | */ 117 | Iterable pollIdentityLinks(ActivityInstanceEvent activityInstanceEvent); 118 | } 119 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetCommentResponse.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | * Response structure of Camunda REST API GET task/{task-id}/comment 9 | */ 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class GetCommentResponse { 12 | 13 | private String id; 14 | private String userId; 15 | private Date time; 16 | private String taskId; 17 | private String message; 18 | 19 | public String getId() { 20 | return id; 21 | } 22 | 23 | public void setId(String id) { 24 | this.id = id; 25 | } 26 | 27 | public String getUserId() { 28 | return userId; 29 | } 30 | 31 | public void setUserId(String userId) { 32 | this.userId = userId; 33 | } 34 | 35 | public Date getTime() { 36 | return time; 37 | } 38 | 39 | public void setTime(Date time) { 40 | this.time = time; 41 | } 42 | 43 | public String getTaskId() { 44 | return taskId; 45 | } 46 | 47 | public void setTaskId(String taskId) { 48 | this.taskId = taskId; 49 | } 50 | 51 | public String getMessage() { 52 | return message; 53 | } 54 | 55 | public void setMessage(String message) { 56 | this.message = message; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetDeploymentResponse.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | import java.util.Date; 7 | 8 | /** 9 | * Response structure of Camunda REST API GET /deployment 10 | */ 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class GetDeploymentResponse { 13 | 14 | private String id; 15 | private String name; 16 | private String source; 17 | private Date deploymentTime; 18 | private String tenantId; 19 | 20 | @java.lang.SuppressWarnings("all") 21 | public String getId() { 22 | return this.id; 23 | } 24 | 25 | @java.lang.SuppressWarnings("all") 26 | public String getName() { 27 | return this.name; 28 | } 29 | 30 | @java.lang.SuppressWarnings("all") 31 | public String getSource() { 32 | return this.source; 33 | } 34 | 35 | @java.lang.SuppressWarnings("all") 36 | public Date getDeploymentTime() { 37 | return this.deploymentTime; 38 | } 39 | 40 | @java.lang.SuppressWarnings("all") 41 | public String getTenantId() { 42 | return this.tenantId; 43 | } 44 | 45 | @java.lang.SuppressWarnings("all") 46 | public void setId(final String id) { 47 | this.id = id; 48 | } 49 | 50 | @java.lang.SuppressWarnings("all") 51 | public void setName(final String name) { 52 | this.name = name; 53 | } 54 | 55 | @java.lang.SuppressWarnings("all") 56 | public void setSource(final String source) { 57 | this.source = source; 58 | } 59 | 60 | @java.lang.SuppressWarnings("all") 61 | public void setDeploymentTime(final Date deploymentTime) { 62 | this.deploymentTime = deploymentTime; 63 | } 64 | 65 | @java.lang.SuppressWarnings("all") 66 | public void setTenantId(final String tenantId) { 67 | this.tenantId = tenantId; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetHistoricActivityInstanceRespone.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | import java.util.Date; 7 | 8 | /** 9 | * Response structure of Camunda REST API GET /history/activity-instance 10 | */ 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class GetHistoricActivityInstanceRespone { 13 | 14 | private String id; 15 | private String parentActivityInstanceId; 16 | private String activityId; 17 | private String activityName; 18 | private String activityType; 19 | private String processDefinitionKey; 20 | private String processDefinitionId; 21 | private String processInstanceId; 22 | private String executionId; 23 | private String taskId; 24 | private String assignee; 25 | private String calledProcessInstanceId; 26 | private String calledCaseInstanceId; 27 | private Date startTime; 28 | private Date endTime; 29 | private Long durationInMillis; 30 | private Boolean canceled; 31 | private Boolean completeScope; 32 | private String tenantId; 33 | 34 | @java.lang.SuppressWarnings("all") 35 | public String getId() { 36 | return this.id; 37 | } 38 | 39 | @java.lang.SuppressWarnings("all") 40 | public String getParentActivityInstanceId() { 41 | return this.parentActivityInstanceId; 42 | } 43 | 44 | @java.lang.SuppressWarnings("all") 45 | public String getActivityId() { 46 | return this.activityId; 47 | } 48 | 49 | @java.lang.SuppressWarnings("all") 50 | public String getActivityName() { 51 | return this.activityName; 52 | } 53 | 54 | @java.lang.SuppressWarnings("all") 55 | public String getActivityType() { 56 | return this.activityType; 57 | } 58 | 59 | @java.lang.SuppressWarnings("all") 60 | public String getProcessDefinitionKey() { 61 | return this.processDefinitionKey; 62 | } 63 | 64 | @java.lang.SuppressWarnings("all") 65 | public String getProcessDefinitionId() { 66 | return this.processDefinitionId; 67 | } 68 | 69 | @java.lang.SuppressWarnings("all") 70 | public String getProcessInstanceId() { 71 | return this.processInstanceId; 72 | } 73 | 74 | @java.lang.SuppressWarnings("all") 75 | public String getExecutionId() { 76 | return this.executionId; 77 | } 78 | 79 | @java.lang.SuppressWarnings("all") 80 | public String getTaskId() { 81 | return this.taskId; 82 | } 83 | 84 | @java.lang.SuppressWarnings("all") 85 | public String getAssignee() { 86 | return this.assignee; 87 | } 88 | 89 | @java.lang.SuppressWarnings("all") 90 | public String getCalledProcessInstanceId() { 91 | return this.calledProcessInstanceId; 92 | } 93 | 94 | @java.lang.SuppressWarnings("all") 95 | public String getCalledCaseInstanceId() { 96 | return this.calledCaseInstanceId; 97 | } 98 | 99 | @java.lang.SuppressWarnings("all") 100 | public Date getStartTime() { 101 | return this.startTime; 102 | } 103 | 104 | @java.lang.SuppressWarnings("all") 105 | public Date getEndTime() { 106 | return this.endTime; 107 | } 108 | 109 | @java.lang.SuppressWarnings("all") 110 | public Long getDurationInMillis() { 111 | return this.durationInMillis; 112 | } 113 | 114 | @java.lang.SuppressWarnings("all") 115 | public Boolean getCanceled() { 116 | return this.canceled; 117 | } 118 | 119 | @java.lang.SuppressWarnings("all") 120 | public Boolean getCompleteScope() { 121 | return this.completeScope; 122 | } 123 | 124 | @java.lang.SuppressWarnings("all") 125 | public String getTenantId() { 126 | return this.tenantId; 127 | } 128 | 129 | @java.lang.SuppressWarnings("all") 130 | public void setId(final String id) { 131 | this.id = id; 132 | } 133 | 134 | @java.lang.SuppressWarnings("all") 135 | public void setParentActivityInstanceId(final String parentActivityInstanceId) { 136 | this.parentActivityInstanceId = parentActivityInstanceId; 137 | } 138 | 139 | @java.lang.SuppressWarnings("all") 140 | public void setActivityId(final String activityId) { 141 | this.activityId = activityId; 142 | } 143 | 144 | @java.lang.SuppressWarnings("all") 145 | public void setActivityName(final String activityName) { 146 | this.activityName = activityName; 147 | } 148 | 149 | @java.lang.SuppressWarnings("all") 150 | public void setActivityType(final String activityType) { 151 | this.activityType = activityType; 152 | } 153 | 154 | @java.lang.SuppressWarnings("all") 155 | public void setProcessDefinitionKey(final String processDefinitionKey) { 156 | this.processDefinitionKey = processDefinitionKey; 157 | } 158 | 159 | @java.lang.SuppressWarnings("all") 160 | public void setProcessDefinitionId(final String processDefinitionId) { 161 | this.processDefinitionId = processDefinitionId; 162 | } 163 | 164 | @java.lang.SuppressWarnings("all") 165 | public void setProcessInstanceId(final String processInstanceId) { 166 | this.processInstanceId = processInstanceId; 167 | } 168 | 169 | @java.lang.SuppressWarnings("all") 170 | public void setExecutionId(final String executionId) { 171 | this.executionId = executionId; 172 | } 173 | 174 | @java.lang.SuppressWarnings("all") 175 | public void setTaskId(final String taskId) { 176 | this.taskId = taskId; 177 | } 178 | 179 | @java.lang.SuppressWarnings("all") 180 | public void setAssignee(final String assignee) { 181 | this.assignee = assignee; 182 | } 183 | 184 | @java.lang.SuppressWarnings("all") 185 | public void setCalledProcessInstanceId(final String calledProcessInstanceId) { 186 | this.calledProcessInstanceId = calledProcessInstanceId; 187 | } 188 | 189 | @java.lang.SuppressWarnings("all") 190 | public void setCalledCaseInstanceId(final String calledCaseInstanceId) { 191 | this.calledCaseInstanceId = calledCaseInstanceId; 192 | } 193 | 194 | @java.lang.SuppressWarnings("all") 195 | public void setStartTime(final Date startTime) { 196 | this.startTime = startTime; 197 | } 198 | 199 | @java.lang.SuppressWarnings("all") 200 | public void setEndTime(final Date endTime) { 201 | this.endTime = endTime; 202 | } 203 | 204 | @java.lang.SuppressWarnings("all") 205 | public void setDurationInMillis(final Long durationInMillis) { 206 | this.durationInMillis = durationInMillis; 207 | } 208 | 209 | @java.lang.SuppressWarnings("all") 210 | public void setCanceled(final Boolean canceled) { 211 | this.canceled = canceled; 212 | } 213 | 214 | @java.lang.SuppressWarnings("all") 215 | public void setCompleteScope(final Boolean completeScope) { 216 | this.completeScope = completeScope; 217 | } 218 | 219 | @java.lang.SuppressWarnings("all") 220 | public void setTenantId(final String tenantId) { 221 | this.tenantId = tenantId; 222 | } 223 | 224 | @java.lang.Override 225 | @java.lang.SuppressWarnings("all") 226 | public java.lang.String toString() { 227 | return "GetHistoricActivityInstanceRespone(id=" + this.getId() + ", parentActivityInstanceId=" 228 | + this.getParentActivityInstanceId() + ", activityId=" + this.getActivityId() + ", activityName=" 229 | + this.getActivityName() + ", activityType=" + this.getActivityType() + ", processDefinitionKey=" 230 | + this.getProcessDefinitionKey() + ", processDefinitionId=" + this.getProcessDefinitionId() 231 | + ", processInstanceId=" + this.getProcessInstanceId() + ", executionId=" + this.getExecutionId() 232 | + ", taskId=" + this.getTaskId() + ", assignee=" + this.getAssignee() + ", calledProcessInstanceId=" 233 | + this.getCalledProcessInstanceId() + ", calledCaseInstanceId=" + this.getCalledCaseInstanceId() 234 | + ", startTime=" + this.getStartTime() + ", endTime=" + this.getEndTime() + ", durationInMillis=" 235 | + this.getDurationInMillis() + ", canceled=" + this.getCanceled() + ", completeScope=" 236 | + this.getCompleteScope() + ", tenantId=" + this.getTenantId() + ")"; 237 | } 238 | } 239 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetHistoricDetailVariableUpdateResponse.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import org.apache.commons.lang3.StringUtils; 6 | 7 | import java.util.Date; 8 | import java.util.Map; 9 | import java.util.Objects; 10 | 11 | /** 12 | * Response structure of Camunda REST API GET /history/detail for type=variableUpdate 13 | */ 14 | @JsonIgnoreProperties(ignoreUnknown = true) 15 | public class GetHistoricDetailVariableUpdateResponse { 16 | 17 | private String id; 18 | private String type; 19 | private String processDefinitionKey; 20 | private String processDefinitionId; 21 | private String processInstanceId; 22 | private String activityInstanceId; 23 | private String executionId; 24 | private String caseDefinitionKey; 25 | private String caseDefinitionId; 26 | private String caseInstanceId; 27 | private String caseExecutionId; 28 | private String taskId; 29 | private String tenantId; 30 | private Date time; 31 | private String variableName; 32 | private String variableInstanceId; 33 | private String variableType; 34 | private Object value; 35 | private Object valueInfo; 36 | private Long revision; 37 | private String errorMessage; 38 | 39 | /** 40 | * If {@link #valueInfo} is available as Map-Data, retrieve value of given key as String. 41 | */ 42 | public String getValueInfoEntry(String key) { 43 | return valueInfo instanceof Map ? StringUtils.trimToNull(Objects.toString(((Map) valueInfo).get(key), null)) 44 | : null; 45 | } 46 | 47 | @java.lang.SuppressWarnings("all") 48 | public String getId() { 49 | return this.id; 50 | } 51 | 52 | @java.lang.SuppressWarnings("all") 53 | public String getType() { 54 | return this.type; 55 | } 56 | 57 | @java.lang.SuppressWarnings("all") 58 | public String getProcessDefinitionKey() { 59 | return this.processDefinitionKey; 60 | } 61 | 62 | @java.lang.SuppressWarnings("all") 63 | public String getProcessDefinitionId() { 64 | return this.processDefinitionId; 65 | } 66 | 67 | @java.lang.SuppressWarnings("all") 68 | public String getProcessInstanceId() { 69 | return this.processInstanceId; 70 | } 71 | 72 | @java.lang.SuppressWarnings("all") 73 | public String getActivityInstanceId() { 74 | return this.activityInstanceId; 75 | } 76 | 77 | @java.lang.SuppressWarnings("all") 78 | public String getExecutionId() { 79 | return this.executionId; 80 | } 81 | 82 | @java.lang.SuppressWarnings("all") 83 | public String getCaseDefinitionKey() { 84 | return this.caseDefinitionKey; 85 | } 86 | 87 | @java.lang.SuppressWarnings("all") 88 | public String getCaseDefinitionId() { 89 | return this.caseDefinitionId; 90 | } 91 | 92 | @java.lang.SuppressWarnings("all") 93 | public String getCaseInstanceId() { 94 | return this.caseInstanceId; 95 | } 96 | 97 | @java.lang.SuppressWarnings("all") 98 | public String getCaseExecutionId() { 99 | return this.caseExecutionId; 100 | } 101 | 102 | @java.lang.SuppressWarnings("all") 103 | public String getTaskId() { 104 | return this.taskId; 105 | } 106 | 107 | @java.lang.SuppressWarnings("all") 108 | public String getTenantId() { 109 | return this.tenantId; 110 | } 111 | 112 | @java.lang.SuppressWarnings("all") 113 | public Date getTime() { 114 | return this.time; 115 | } 116 | 117 | @java.lang.SuppressWarnings("all") 118 | public String getVariableName() { 119 | return this.variableName; 120 | } 121 | 122 | @java.lang.SuppressWarnings("all") 123 | public String getVariableInstanceId() { 124 | return this.variableInstanceId; 125 | } 126 | 127 | @java.lang.SuppressWarnings("all") 128 | public String getVariableType() { 129 | return this.variableType; 130 | } 131 | 132 | @java.lang.SuppressWarnings("all") 133 | public Object getValue() { 134 | return this.value; 135 | } 136 | 137 | @java.lang.SuppressWarnings("all") 138 | public Object getValueInfo() { 139 | return this.valueInfo; 140 | } 141 | 142 | @java.lang.SuppressWarnings("all") 143 | public Long getRevision() { 144 | return this.revision; 145 | } 146 | 147 | @java.lang.SuppressWarnings("all") 148 | public String getErrorMessage() { 149 | return this.errorMessage; 150 | } 151 | 152 | @java.lang.SuppressWarnings("all") 153 | public void setId(final String id) { 154 | this.id = id; 155 | } 156 | 157 | @java.lang.SuppressWarnings("all") 158 | public void setType(final String type) { 159 | this.type = type; 160 | } 161 | 162 | @java.lang.SuppressWarnings("all") 163 | public void setProcessDefinitionKey(final String processDefinitionKey) { 164 | this.processDefinitionKey = processDefinitionKey; 165 | } 166 | 167 | @java.lang.SuppressWarnings("all") 168 | public void setProcessDefinitionId(final String processDefinitionId) { 169 | this.processDefinitionId = processDefinitionId; 170 | } 171 | 172 | @java.lang.SuppressWarnings("all") 173 | public void setProcessInstanceId(final String processInstanceId) { 174 | this.processInstanceId = processInstanceId; 175 | } 176 | 177 | @java.lang.SuppressWarnings("all") 178 | public void setActivityInstanceId(final String activityInstanceId) { 179 | this.activityInstanceId = activityInstanceId; 180 | } 181 | 182 | @java.lang.SuppressWarnings("all") 183 | public void setExecutionId(final String executionId) { 184 | this.executionId = executionId; 185 | } 186 | 187 | @java.lang.SuppressWarnings("all") 188 | public void setCaseDefinitionKey(final String caseDefinitionKey) { 189 | this.caseDefinitionKey = caseDefinitionKey; 190 | } 191 | 192 | @java.lang.SuppressWarnings("all") 193 | public void setCaseDefinitionId(final String caseDefinitionId) { 194 | this.caseDefinitionId = caseDefinitionId; 195 | } 196 | 197 | @java.lang.SuppressWarnings("all") 198 | public void setCaseInstanceId(final String caseInstanceId) { 199 | this.caseInstanceId = caseInstanceId; 200 | } 201 | 202 | @java.lang.SuppressWarnings("all") 203 | public void setCaseExecutionId(final String caseExecutionId) { 204 | this.caseExecutionId = caseExecutionId; 205 | } 206 | 207 | @java.lang.SuppressWarnings("all") 208 | public void setTaskId(final String taskId) { 209 | this.taskId = taskId; 210 | } 211 | 212 | @java.lang.SuppressWarnings("all") 213 | public void setTenantId(final String tenantId) { 214 | this.tenantId = tenantId; 215 | } 216 | 217 | @java.lang.SuppressWarnings("all") 218 | public void setTime(final Date time) { 219 | this.time = time; 220 | } 221 | 222 | @java.lang.SuppressWarnings("all") 223 | public void setVariableName(final String variableName) { 224 | this.variableName = variableName; 225 | } 226 | 227 | @java.lang.SuppressWarnings("all") 228 | public void setVariableInstanceId(final String variableInstanceId) { 229 | this.variableInstanceId = variableInstanceId; 230 | } 231 | 232 | @java.lang.SuppressWarnings("all") 233 | public void setVariableType(final String variableType) { 234 | this.variableType = variableType; 235 | } 236 | 237 | @java.lang.SuppressWarnings("all") 238 | public void setValue(final Object value) { 239 | this.value = value; 240 | } 241 | 242 | @java.lang.SuppressWarnings("all") 243 | public void setValueInfo(final Object valueInfo) { 244 | this.valueInfo = valueInfo; 245 | } 246 | 247 | @java.lang.SuppressWarnings("all") 248 | public void setRevision(final Long revision) { 249 | this.revision = revision; 250 | } 251 | 252 | @java.lang.SuppressWarnings("all") 253 | public void setErrorMessage(final String errorMessage) { 254 | this.errorMessage = errorMessage; 255 | } 256 | } 257 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetHistoricProcessInstanceResponse.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | import java.util.Date; 7 | 8 | /** 9 | * Response structure of Camunda REST API GET /history/process-instance 10 | */ 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class GetHistoricProcessInstanceResponse { 13 | 14 | private String id; 15 | private String superProcessInstanceId; 16 | private String superCaseInstanceId; 17 | private String caseInstanceId; 18 | private String processDefinitionName; 19 | private String processDefinitionKey; 20 | private Integer processDefinitionVersion; 21 | private String processDefinitionId; 22 | private String businessKey; 23 | private Date startTime; 24 | private Date endTime; 25 | private Long durationInMillis; 26 | private String startUserId; 27 | private String startActivityId; 28 | private String deleteReason; 29 | private String tenantId; 30 | private String state; 31 | 32 | @java.lang.SuppressWarnings("all") 33 | public String getId() { 34 | return this.id; 35 | } 36 | 37 | @java.lang.SuppressWarnings("all") 38 | public String getSuperProcessInstanceId() { 39 | return this.superProcessInstanceId; 40 | } 41 | 42 | @java.lang.SuppressWarnings("all") 43 | public String getSuperCaseInstanceId() { 44 | return this.superCaseInstanceId; 45 | } 46 | 47 | @java.lang.SuppressWarnings("all") 48 | public String getCaseInstanceId() { 49 | return this.caseInstanceId; 50 | } 51 | 52 | @java.lang.SuppressWarnings("all") 53 | public String getProcessDefinitionName() { 54 | return this.processDefinitionName; 55 | } 56 | 57 | @java.lang.SuppressWarnings("all") 58 | public String getProcessDefinitionKey() { 59 | return this.processDefinitionKey; 60 | } 61 | 62 | @java.lang.SuppressWarnings("all") 63 | public Integer getProcessDefinitionVersion() { 64 | return this.processDefinitionVersion; 65 | } 66 | 67 | @java.lang.SuppressWarnings("all") 68 | public String getProcessDefinitionId() { 69 | return this.processDefinitionId; 70 | } 71 | 72 | @java.lang.SuppressWarnings("all") 73 | public String getBusinessKey() { 74 | return this.businessKey; 75 | } 76 | 77 | @java.lang.SuppressWarnings("all") 78 | public Date getStartTime() { 79 | return this.startTime; 80 | } 81 | 82 | @java.lang.SuppressWarnings("all") 83 | public Date getEndTime() { 84 | return this.endTime; 85 | } 86 | 87 | @java.lang.SuppressWarnings("all") 88 | public Long getDurationInMillis() { 89 | return this.durationInMillis; 90 | } 91 | 92 | @java.lang.SuppressWarnings("all") 93 | public String getStartUserId() { 94 | return this.startUserId; 95 | } 96 | 97 | @java.lang.SuppressWarnings("all") 98 | public String getStartActivityId() { 99 | return this.startActivityId; 100 | } 101 | 102 | @java.lang.SuppressWarnings("all") 103 | public String getDeleteReason() { 104 | return this.deleteReason; 105 | } 106 | 107 | @java.lang.SuppressWarnings("all") 108 | public String getTenantId() { 109 | return this.tenantId; 110 | } 111 | 112 | @java.lang.SuppressWarnings("all") 113 | public String getState() { 114 | return this.state; 115 | } 116 | 117 | @java.lang.SuppressWarnings("all") 118 | public void setId(final String id) { 119 | this.id = id; 120 | } 121 | 122 | @java.lang.SuppressWarnings("all") 123 | public void setSuperProcessInstanceId(final String superProcessInstanceId) { 124 | this.superProcessInstanceId = superProcessInstanceId; 125 | } 126 | 127 | @java.lang.SuppressWarnings("all") 128 | public void setSuperCaseInstanceId(final String superCaseInstanceId) { 129 | this.superCaseInstanceId = superCaseInstanceId; 130 | } 131 | 132 | @java.lang.SuppressWarnings("all") 133 | public void setCaseInstanceId(final String caseInstanceId) { 134 | this.caseInstanceId = caseInstanceId; 135 | } 136 | 137 | @java.lang.SuppressWarnings("all") 138 | public void setProcessDefinitionName(final String processDefinitionName) { 139 | this.processDefinitionName = processDefinitionName; 140 | } 141 | 142 | @java.lang.SuppressWarnings("all") 143 | public void setProcessDefinitionKey(final String processDefinitionKey) { 144 | this.processDefinitionKey = processDefinitionKey; 145 | } 146 | 147 | @java.lang.SuppressWarnings("all") 148 | public void setProcessDefinitionVersion(final Integer processDefinitionVersion) { 149 | this.processDefinitionVersion = processDefinitionVersion; 150 | } 151 | 152 | @java.lang.SuppressWarnings("all") 153 | public void setProcessDefinitionId(final String processDefinitionId) { 154 | this.processDefinitionId = processDefinitionId; 155 | } 156 | 157 | @java.lang.SuppressWarnings("all") 158 | public void setBusinessKey(final String businessKey) { 159 | this.businessKey = businessKey; 160 | } 161 | 162 | @java.lang.SuppressWarnings("all") 163 | public void setStartTime(final Date startTime) { 164 | this.startTime = startTime; 165 | } 166 | 167 | @java.lang.SuppressWarnings("all") 168 | public void setEndTime(final Date endTime) { 169 | this.endTime = endTime; 170 | } 171 | 172 | @java.lang.SuppressWarnings("all") 173 | public void setDurationInMillis(final Long durationInMillis) { 174 | this.durationInMillis = durationInMillis; 175 | } 176 | 177 | @java.lang.SuppressWarnings("all") 178 | public void setStartUserId(final String startUserId) { 179 | this.startUserId = startUserId; 180 | } 181 | 182 | @java.lang.SuppressWarnings("all") 183 | public void setStartActivityId(final String startActivityId) { 184 | this.startActivityId = startActivityId; 185 | } 186 | 187 | @java.lang.SuppressWarnings("all") 188 | public void setDeleteReason(final String deleteReason) { 189 | this.deleteReason = deleteReason; 190 | } 191 | 192 | @java.lang.SuppressWarnings("all") 193 | public void setTenantId(final String tenantId) { 194 | this.tenantId = tenantId; 195 | } 196 | 197 | @java.lang.SuppressWarnings("all") 198 | public void setState(final String state) { 199 | this.state = state; 200 | } 201 | 202 | @java.lang.Override 203 | @java.lang.SuppressWarnings("all") 204 | public java.lang.String toString() { 205 | return "GetHistoricProcessInstanceResponse(id=" + this.getId() + ", superProcessInstanceId=" 206 | + this.getSuperProcessInstanceId() + ", superCaseInstanceId=" + this.getSuperCaseInstanceId() 207 | + ", caseInstanceId=" + this.getCaseInstanceId() + ", processDefinitionName=" 208 | + this.getProcessDefinitionName() + ", processDefinitionKey=" + this.getProcessDefinitionKey() 209 | + ", processDefinitionVersion=" + this.getProcessDefinitionVersion() + ", processDefinitionId=" 210 | + this.getProcessDefinitionId() + ", businessKey=" + this.getBusinessKey() + ", startTime=" 211 | + this.getStartTime() + ", endTime=" + this.getEndTime() + ", durationInMillis=" 212 | + this.getDurationInMillis() + ", startUserId=" + this.getStartUserId() + ", startActivityId=" 213 | + this.getStartActivityId() + ", deleteReason=" + this.getDeleteReason() + ", tenantId=" 214 | + this.getTenantId() + ", state=" + this.getState() + ")"; 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetHistoricVariableInstancesResponse.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import org.apache.commons.lang3.StringUtils; 6 | 7 | import java.util.Map; 8 | import java.util.Objects; 9 | 10 | /** 11 | * Response structure of Camunda REST API GET /history/variable-instance 12 | */ 13 | @JsonIgnoreProperties(ignoreUnknown = true) 14 | public class GetHistoricVariableInstancesResponse { 15 | 16 | private String id; 17 | private String name; 18 | private String type; 19 | private Object value; 20 | private Object valueInfo; 21 | private String processDefinitionKey; 22 | private String processDefinitionId; 23 | private String processInstanceId; 24 | private String executionId; 25 | private String activityInstanceId; 26 | private String caseDefinitionKey; 27 | private String caseDefinitionId; 28 | private String caseInstanceId; 29 | private String caseExecutionId; 30 | private String taskId; 31 | private String tenantId; 32 | private String errorMessage; 33 | private String state; 34 | 35 | /** 36 | * If {@link #valueInfo} is available as Map-Data, retrieve value of given key as String. 37 | */ 38 | public String getValueInfoEntry(String key) { 39 | return valueInfo instanceof Map ? StringUtils.trimToNull(Objects.toString(((Map) valueInfo).get(key), null)) 40 | : null; 41 | } 42 | 43 | @java.lang.SuppressWarnings("all") 44 | public String getId() { 45 | return this.id; 46 | } 47 | 48 | @java.lang.SuppressWarnings("all") 49 | public String getName() { 50 | return this.name; 51 | } 52 | 53 | @java.lang.SuppressWarnings("all") 54 | public String getType() { 55 | return this.type; 56 | } 57 | 58 | @java.lang.SuppressWarnings("all") 59 | public Object getValue() { 60 | return this.value; 61 | } 62 | 63 | @java.lang.SuppressWarnings("all") 64 | public Object getValueInfo() { 65 | return this.valueInfo; 66 | } 67 | 68 | @java.lang.SuppressWarnings("all") 69 | public String getProcessDefinitionKey() { 70 | return this.processDefinitionKey; 71 | } 72 | 73 | @java.lang.SuppressWarnings("all") 74 | public String getProcessDefinitionId() { 75 | return this.processDefinitionId; 76 | } 77 | 78 | @java.lang.SuppressWarnings("all") 79 | public String getProcessInstanceId() { 80 | return this.processInstanceId; 81 | } 82 | 83 | @java.lang.SuppressWarnings("all") 84 | public String getExecutionId() { 85 | return this.executionId; 86 | } 87 | 88 | @java.lang.SuppressWarnings("all") 89 | public String getActivityInstanceId() { 90 | return this.activityInstanceId; 91 | } 92 | 93 | @java.lang.SuppressWarnings("all") 94 | public String getCaseDefinitionKey() { 95 | return this.caseDefinitionKey; 96 | } 97 | 98 | @java.lang.SuppressWarnings("all") 99 | public String getCaseDefinitionId() { 100 | return this.caseDefinitionId; 101 | } 102 | 103 | @java.lang.SuppressWarnings("all") 104 | public String getCaseInstanceId() { 105 | return this.caseInstanceId; 106 | } 107 | 108 | @java.lang.SuppressWarnings("all") 109 | public String getCaseExecutionId() { 110 | return this.caseExecutionId; 111 | } 112 | 113 | @java.lang.SuppressWarnings("all") 114 | public String getTaskId() { 115 | return this.taskId; 116 | } 117 | 118 | @java.lang.SuppressWarnings("all") 119 | public String getTenantId() { 120 | return this.tenantId; 121 | } 122 | 123 | @java.lang.SuppressWarnings("all") 124 | public String getErrorMessage() { 125 | return this.errorMessage; 126 | } 127 | 128 | @java.lang.SuppressWarnings("all") 129 | public String getState() { 130 | return this.state; 131 | } 132 | 133 | @java.lang.SuppressWarnings("all") 134 | public void setId(final String id) { 135 | this.id = id; 136 | } 137 | 138 | @java.lang.SuppressWarnings("all") 139 | public void setName(final String name) { 140 | this.name = name; 141 | } 142 | 143 | @java.lang.SuppressWarnings("all") 144 | public void setType(final String type) { 145 | this.type = type; 146 | } 147 | 148 | @java.lang.SuppressWarnings("all") 149 | public void setValue(final Object value) { 150 | this.value = value; 151 | } 152 | 153 | @java.lang.SuppressWarnings("all") 154 | public void setValueInfo(final Object valueInfo) { 155 | this.valueInfo = valueInfo; 156 | } 157 | 158 | @java.lang.SuppressWarnings("all") 159 | public void setProcessDefinitionKey(final String processDefinitionKey) { 160 | this.processDefinitionKey = processDefinitionKey; 161 | } 162 | 163 | @java.lang.SuppressWarnings("all") 164 | public void setProcessDefinitionId(final String processDefinitionId) { 165 | this.processDefinitionId = processDefinitionId; 166 | } 167 | 168 | @java.lang.SuppressWarnings("all") 169 | public void setProcessInstanceId(final String processInstanceId) { 170 | this.processInstanceId = processInstanceId; 171 | } 172 | 173 | @java.lang.SuppressWarnings("all") 174 | public void setExecutionId(final String executionId) { 175 | this.executionId = executionId; 176 | } 177 | 178 | @java.lang.SuppressWarnings("all") 179 | public void setActivityInstanceId(final String activityInstanceId) { 180 | this.activityInstanceId = activityInstanceId; 181 | } 182 | 183 | @java.lang.SuppressWarnings("all") 184 | public void setCaseDefinitionKey(final String caseDefinitionKey) { 185 | this.caseDefinitionKey = caseDefinitionKey; 186 | } 187 | 188 | @java.lang.SuppressWarnings("all") 189 | public void setCaseDefinitionId(final String caseDefinitionId) { 190 | this.caseDefinitionId = caseDefinitionId; 191 | } 192 | 193 | @java.lang.SuppressWarnings("all") 194 | public void setCaseInstanceId(final String caseInstanceId) { 195 | this.caseInstanceId = caseInstanceId; 196 | } 197 | 198 | @java.lang.SuppressWarnings("all") 199 | public void setCaseExecutionId(final String caseExecutionId) { 200 | this.caseExecutionId = caseExecutionId; 201 | } 202 | 203 | @java.lang.SuppressWarnings("all") 204 | public void setTaskId(final String taskId) { 205 | this.taskId = taskId; 206 | } 207 | 208 | @java.lang.SuppressWarnings("all") 209 | public void setTenantId(final String tenantId) { 210 | this.tenantId = tenantId; 211 | } 212 | 213 | @java.lang.SuppressWarnings("all") 214 | public void setErrorMessage(final String errorMessage) { 215 | this.errorMessage = errorMessage; 216 | } 217 | 218 | @java.lang.SuppressWarnings("all") 219 | public void setState(final String state) { 220 | this.state = state; 221 | } 222 | 223 | @java.lang.Override 224 | @java.lang.SuppressWarnings("all") 225 | public java.lang.String toString() { 226 | return "GetHistoricVariableInstancesResponse(id=" + this.getId() + ", name=" + this.getName() + ", type=" 227 | + this.getType() + ", value=" + this.getValue() + ", valueInfo=" + this.getValueInfo() 228 | + ", processDefinitionKey=" + this.getProcessDefinitionKey() + ", processDefinitionId=" 229 | + this.getProcessDefinitionId() + ", processInstanceId=" + this.getProcessInstanceId() 230 | + ", executionId=" + this.getExecutionId() + ", activityInstanceId=" + this.getActivityInstanceId() 231 | + ", caseDefinitionKey=" + this.getCaseDefinitionKey() + ", caseDefinitionId=" 232 | + this.getCaseDefinitionId() + ", caseInstanceId=" + this.getCaseInstanceId() + ", caseExecutionId=" 233 | + this.getCaseExecutionId() + ", taskId=" + this.getTaskId() + ", tenantId=" + this.getTenantId() 234 | + ", errorMessage=" + this.getErrorMessage() + ", state=" + this.getState() + ")"; 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetIdentityLinkResponse.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | * Response structure of Camunda REST API GET /history/identity-link-log?taskId={TASK_ID} 9 | */ 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class GetIdentityLinkResponse { 12 | 13 | private String id; 14 | private Date time; 15 | private String type; 16 | private String userId; 17 | private String groupId; 18 | private String taskId; 19 | private String processDefinitionId; 20 | private String processDefinitionKey; 21 | private String operationType; 22 | private String assignerId; 23 | private String tenantId; 24 | private Date removalTime; 25 | private String rootProcessInstanceId; 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | 35 | public Date getTime() { 36 | return time; 37 | } 38 | 39 | public void setTime(Date time) { 40 | this.time = time; 41 | } 42 | 43 | public String getType() { 44 | return type; 45 | } 46 | 47 | public void setType(String type) { 48 | this.type = type; 49 | } 50 | 51 | public String getUserId() { 52 | return userId; 53 | } 54 | 55 | public void setUserId(String userId) { 56 | this.userId = userId; 57 | } 58 | 59 | public String getGroupId() { 60 | return groupId; 61 | } 62 | 63 | public void setGroupId(String groupId) { 64 | this.groupId = groupId; 65 | } 66 | 67 | public String getTaskId() { 68 | return taskId; 69 | } 70 | 71 | public void setTaskId(String taskId) { 72 | this.taskId = taskId; 73 | } 74 | 75 | public String getProcessDefinitionId() { 76 | return processDefinitionId; 77 | } 78 | 79 | public void setProcessDefinitionId(String processDefinitionId) { 80 | this.processDefinitionId = processDefinitionId; 81 | } 82 | 83 | public String getProcessDefinitionKey() { 84 | return processDefinitionKey; 85 | } 86 | 87 | public void setProcessDefinitionKey(String processDefinitionKey) { 88 | this.processDefinitionKey = processDefinitionKey; 89 | } 90 | 91 | public String getOperationType() { 92 | return operationType; 93 | } 94 | 95 | public void setOperationType(String operationType) { 96 | this.operationType = operationType; 97 | } 98 | 99 | public String getAssignerId() { 100 | return assignerId; 101 | } 102 | 103 | public void setAssignerId(String assignerId) { 104 | this.assignerId = assignerId; 105 | } 106 | 107 | public String getTenantId() { 108 | return tenantId; 109 | } 110 | 111 | public void setTenantId(String tenantId) { 112 | this.tenantId = tenantId; 113 | } 114 | 115 | public Date getRemovalTime() { 116 | return removalTime; 117 | } 118 | 119 | public void setRemovalTime(Date removalTime) { 120 | this.removalTime = removalTime; 121 | } 122 | 123 | public String getRootProcessInstanceId() { 124 | return rootProcessInstanceId; 125 | } 126 | 127 | public void setRootProcessInstanceId(String rootProcessInstanceId) { 128 | this.rootProcessInstanceId = rootProcessInstanceId; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetProcessDefinitionResponse.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | /** 7 | * Response structure of Camunda REST API GET /process-definition 8 | */ 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class GetProcessDefinitionResponse { 11 | 12 | private String id; 13 | private String key; 14 | private String category; 15 | private String description; 16 | private String name; 17 | private Integer version; 18 | private String resource; 19 | private String deploymentId; 20 | private String diagram; 21 | private Boolean suspended; 22 | private String tenantId; 23 | private String versionTag; 24 | private Integer historyTimeToLive; 25 | 26 | @java.lang.SuppressWarnings("all") 27 | public String getId() { 28 | return this.id; 29 | } 30 | 31 | @java.lang.SuppressWarnings("all") 32 | public String getKey() { 33 | return this.key; 34 | } 35 | 36 | @java.lang.SuppressWarnings("all") 37 | public String getCategory() { 38 | return this.category; 39 | } 40 | 41 | @java.lang.SuppressWarnings("all") 42 | public String getDescription() { 43 | return this.description; 44 | } 45 | 46 | @java.lang.SuppressWarnings("all") 47 | public String getName() { 48 | return this.name; 49 | } 50 | 51 | @java.lang.SuppressWarnings("all") 52 | public Integer getVersion() { 53 | return this.version; 54 | } 55 | 56 | @java.lang.SuppressWarnings("all") 57 | public String getResource() { 58 | return this.resource; 59 | } 60 | 61 | @java.lang.SuppressWarnings("all") 62 | public String getDeploymentId() { 63 | return this.deploymentId; 64 | } 65 | 66 | @java.lang.SuppressWarnings("all") 67 | public String getDiagram() { 68 | return this.diagram; 69 | } 70 | 71 | @java.lang.SuppressWarnings("all") 72 | public Boolean getSuspended() { 73 | return this.suspended; 74 | } 75 | 76 | @java.lang.SuppressWarnings("all") 77 | public String getTenantId() { 78 | return this.tenantId; 79 | } 80 | 81 | @java.lang.SuppressWarnings("all") 82 | public String getVersionTag() { 83 | return this.versionTag; 84 | } 85 | 86 | @java.lang.SuppressWarnings("all") 87 | public Integer getHistoryTimeToLive() { 88 | return this.historyTimeToLive; 89 | } 90 | 91 | @java.lang.SuppressWarnings("all") 92 | public void setId(final String id) { 93 | this.id = id; 94 | } 95 | 96 | @java.lang.SuppressWarnings("all") 97 | public void setKey(final String key) { 98 | this.key = key; 99 | } 100 | 101 | @java.lang.SuppressWarnings("all") 102 | public void setCategory(final String category) { 103 | this.category = category; 104 | } 105 | 106 | @java.lang.SuppressWarnings("all") 107 | public void setDescription(final String description) { 108 | this.description = description; 109 | } 110 | 111 | @java.lang.SuppressWarnings("all") 112 | public void setName(final String name) { 113 | this.name = name; 114 | } 115 | 116 | @java.lang.SuppressWarnings("all") 117 | public void setVersion(final Integer version) { 118 | this.version = version; 119 | } 120 | 121 | @java.lang.SuppressWarnings("all") 122 | public void setResource(final String resource) { 123 | this.resource = resource; 124 | } 125 | 126 | @java.lang.SuppressWarnings("all") 127 | public void setDeploymentId(final String deploymentId) { 128 | this.deploymentId = deploymentId; 129 | } 130 | 131 | @java.lang.SuppressWarnings("all") 132 | public void setDiagram(final String diagram) { 133 | this.diagram = diagram; 134 | } 135 | 136 | @java.lang.SuppressWarnings("all") 137 | public void setSuspended(final Boolean suspended) { 138 | this.suspended = suspended; 139 | } 140 | 141 | @java.lang.SuppressWarnings("all") 142 | public void setTenantId(final String tenantId) { 143 | this.tenantId = tenantId; 144 | } 145 | 146 | @java.lang.SuppressWarnings("all") 147 | public void setVersionTag(final String versionTag) { 148 | this.versionTag = versionTag; 149 | } 150 | 151 | @java.lang.SuppressWarnings("all") 152 | public void setHistoryTimeToLive(final Integer historyTimeToLive) { 153 | this.historyTimeToLive = historyTimeToLive; 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/response/GetProcessDefinitionXmlResponse.java: -------------------------------------------------------------------------------- 1 | // Generated by delombok at Fri Jan 04 11:18:40 CET 2019 2 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest.response; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | /** 7 | * Response structure of Camunda REST API GET /process-definition/123/xml 8 | */ 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class GetProcessDefinitionXmlResponse { 11 | 12 | private String id; 13 | private String bpmn20Xml; 14 | 15 | @java.lang.SuppressWarnings("all") 16 | public String getId() { 17 | return this.id; 18 | } 19 | 20 | @java.lang.SuppressWarnings("all") 21 | public String getBpmn20Xml() { 22 | return this.bpmn20Xml; 23 | } 24 | 25 | @java.lang.SuppressWarnings("all") 26 | public void setId(final String id) { 27 | this.id = id; 28 | } 29 | 30 | @java.lang.SuppressWarnings("all") 31 | public void setBpmn20Xml(final String bpmn20Xml) { 32 | this.bpmn20Xml = bpmn20Xml; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/resources/application-jdbc.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=${CAMUNDA_JDBC_URL:} 2 | spring.datasource.username=${CAMUNDA_JDBC_USERNAME:} 3 | spring.datasource.password=${CAMUNDA_JDBC_PASSWORD:} -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/resources/application-rest.properties: -------------------------------------------------------------------------------- 1 | polling.camunda.rest.url=${CAMUNDA_REST_URL:} 2 | polling.camunda.rest.username=${CAMUNDA_REST_USERNAME:} 3 | polling.camunda.rest.password=${CAMUNDA_REST_PASSWORD:} 4 | polling.camunda.rest.source-time-zone=${CAMUNDA_REST_SOURCE_TIME_ZONE:} 5 | polling.camunda.rest.date-format-pattern=${CAMUNDA_REST_DATE_FORMAT_PATERN:} -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | 3 | polling.repository-data.enabled=true 4 | polling.repository-data.initial-timestamp=${POLLING_REPOSITORY_DATA_INITIAL_TIMESTAMP:} 5 | polling.repository-data.interval-in-ms=30000 6 | polling.repository-data.backward-offset-in-ms=100 7 | polling.repository-data.last-polled-file=./lastPolled-repository.properties 8 | 9 | polling.runtime-data.enabled=true 10 | polling.runtime-data.initial-timestamp=${POLLING_RUNTIME_DATA_INITIAL_TIMESTAMP:} 11 | polling.runtime-data.interval-in-ms=30000 12 | polling.runtime-data.backward-offset-in-ms=60000 13 | polling.runtime-data.last-polled-file=./lastPolled-runtime.properties 14 | 15 | polling.polling-events[0]=PROCESS_INSTANCE_UNFINISHED 16 | polling.polling-events[1]=PROCESS_INSTANCE_FINISHED 17 | polling.polling-events[2]=ACTIVITY_UNFINISHED 18 | polling.polling-events[3]=ACTIVITY_FINISHED 19 | polling.polling-events[4]=VARIABLE_DETAILS_UNFINISHED 20 | polling.polling-events[5]=VARIABLE_DETAILS_FINISHED 21 | polling.polling-events[6]=PROCESS_DEFINITION 22 | polling.polling-events[7]=TASK_COMMENTS 23 | polling.polling-events[8]=IDENTITY_LINKS_UNFINISHED_ACTIVITIES 24 | polling.polling-events[9]=IDENTITY_LINKS_FINISHED_ACTIVITIES 25 | 26 | 27 | spring.kafka.producer.bootstrap-servers=${KAFKA_BOOTSTRAP_SERVERS:} 28 | spring.kafka.producer.client-id=camunda-kafka-polling-client 29 | spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer 30 | spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer 31 | spring.kafka.producer.retries=1 32 | spring.kafka.producer.batch-size=0 33 | spring.kafka.producer.properties.linger.ms=0 34 | spring.kafka.producer.properties.request.timeout.ms=30000 35 | 36 | logging.level.root=WARN 37 | logging.level.de.viadee.camunda.kafka.pollingclient=INFO -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/test/java/de/viadee/camunda/kafka/pollingclient/job/repository/RepositoryDataPollingServiceTest.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.job.repository; 2 | 3 | import de.viadee.camunda.kafka.event.ProcessDefinitionEvent; 4 | import de.viadee.camunda.kafka.pollingclient.config.properties.ApplicationProperties; 5 | import de.viadee.camunda.kafka.pollingclient.service.event.EventService; 6 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.LastPolledService; 7 | import de.viadee.camunda.kafka.pollingclient.service.lastpolled.PollingTimeslice; 8 | import de.viadee.camunda.kafka.pollingclient.service.polling.jdbc.CamundaJdbcPollingServiceImpl; 9 | import org.apache.ibatis.logging.LogFactory; 10 | import org.camunda.bpm.engine.ProcessEngine; 11 | import org.camunda.bpm.engine.ProcessEngineConfiguration; 12 | import org.camunda.bpm.engine.impl.util.ClockUtil; 13 | import org.camunda.bpm.engine.repository.Deployment; 14 | import org.junit.jupiter.api.*; 15 | import org.junit.jupiter.params.ParameterizedTest; 16 | import org.junit.jupiter.params.provider.Arguments; 17 | import org.junit.jupiter.params.provider.MethodSource; 18 | import org.mockito.ArgumentCaptor; 19 | 20 | import java.time.LocalDateTime; 21 | import java.time.ZoneOffset; 22 | import java.util.Date; 23 | import java.util.HashSet; 24 | import java.util.stream.Stream; 25 | 26 | import static de.viadee.camunda.kafka.pollingclient.job.repository.RepositoryDataPollingServiceTest.PointOfTime.*; 27 | import static java.util.Arrays.asList; 28 | import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; 29 | import static org.junit.jupiter.params.provider.Arguments.arguments; 30 | import static org.mockito.Mockito.*; 31 | 32 | @TestInstance(PER_CLASS) 33 | public class RepositoryDataPollingServiceTest { 34 | 35 | enum PointOfTime { 36 | 37 | // @formatter:off 38 | BEFORE_CUTOFF (10, 0, 0), 39 | CUTOFF_TIME (10, 10, 0), 40 | WITHIN_PAST_TIMESLICE (10, 15, 0), 41 | START_TIME (10, 20, 0), 42 | WITHIN_TIMESLICE (10, 25, 0), 43 | END_TIME (10, 30, 0), 44 | AFTER_TIMESLICE (10, 35, 0), 45 | LONG_AFTER_TIMESLICE (10, 40, 0); 46 | // @formatter:on 47 | 48 | final Date date; 49 | 50 | PointOfTime(int hour, int minute, int second) { 51 | this.date = Date.from(LocalDateTime.of(2018, 11, 30, hour, minute, second).toInstant(ZoneOffset.UTC)); 52 | } 53 | } 54 | 55 | private CamundaJdbcPollingServiceImpl pollingApiService; 56 | private RepositoryDataPollingService pollingService; 57 | private LastPolledService lastPolledService; 58 | private EventService eventSendService; 59 | private ApplicationProperties applicationProperties; 60 | private ProcessEngine processEngine; 61 | 62 | @BeforeEach 63 | void setup() { 64 | LogFactory.useSlf4jLogging(); 65 | processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration() 66 | .setJobExecutorActivate(false) 67 | .setHistory(ProcessEngineConfiguration.HISTORY_FULL) 68 | .setDatabaseSchemaUpdate( 69 | ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP) 70 | .buildProcessEngine(); 71 | 72 | lastPolledService = mock(LastPolledService.class); 73 | eventSendService = mock(EventService.class); 74 | 75 | applicationProperties = new ApplicationProperties(); 76 | applicationProperties.setPollingEvents(new HashSet<>(asList(ApplicationProperties.PollingEvents.values()))); 77 | applicationProperties.getRepositoryData().setEnabled(true); 78 | 79 | pollingApiService = new CamundaJdbcPollingServiceImpl(processEngine.getHistoryService(), 80 | processEngine.getRepositoryService(), 81 | processEngine.getTaskService()); 82 | 83 | pollingService = new RepositoryDataPollingService(pollingApiService, lastPolledService, eventSendService, 84 | applicationProperties); 85 | } 86 | 87 | @AfterEach 88 | void cleanup() { 89 | processEngine.close(); 90 | ClockUtil.reset(); 91 | } 92 | 93 | @Test 94 | @DisplayName("Update of timeslice after polling") 95 | void updatePollingTimeslice() { 96 | 97 | // define polling cycle 98 | when(lastPolledService.getPollingTimeslice()) 99 | .thenReturn(new PollingTimeslice(CUTOFF_TIME.date, START_TIME.date, 100 | END_TIME.date)); 101 | 102 | // perform polling 103 | pollingService.run(); 104 | 105 | // verify timeslice update 106 | final ArgumentCaptor pollingTimesliceCaptor = ArgumentCaptor.forClass(PollingTimeslice.class); 107 | verify(lastPolledService, times(1)) 108 | .updatePollingTimeslice(pollingTimesliceCaptor.capture()); 109 | 110 | final PollingTimeslice updatePollingTimeslice = pollingTimesliceCaptor.getValue(); 111 | Assertions.assertEquals(CUTOFF_TIME.date, updatePollingTimeslice.getCutoffTime()); 112 | Assertions.assertEquals(START_TIME.date, updatePollingTimeslice.getStartTime()); 113 | Assertions.assertEquals(END_TIME.date, updatePollingTimeslice.getEndTime()); 114 | } 115 | 116 | @ParameterizedTest(name = "{index}: deployment time {0} => should be polled={1}") 117 | @MethodSource 118 | @DisplayName("Polling of process definitions") 119 | public void pollProcessDefinitions(PointOfTime deploymentTime, boolean shouldBePolled) { 120 | 121 | // create testdata 122 | setCurrentTime(deploymentTime); 123 | final Deployment deployment = processEngine.getRepositoryService() 124 | .createDeployment() 125 | .addClasspathResource("bpmn/simpleProcess.bpmn") 126 | .deploy(); 127 | 128 | // define polling cycle 129 | when(lastPolledService.getPollingTimeslice()) 130 | .thenReturn(new PollingTimeslice(CUTOFF_TIME.date, START_TIME.date, 131 | END_TIME.date)); 132 | 133 | // perform polling 134 | pollingService.run(); 135 | 136 | // Verify process instance event 137 | final ArgumentCaptor processDefinitionEventCaptor = ArgumentCaptor.forClass( 138 | ProcessDefinitionEvent.class); 139 | verify(eventSendService, times(shouldBePolled ? 1 : 0)) 140 | .sendEvent(processDefinitionEventCaptor.capture()); 141 | } 142 | 143 | static Stream pollProcessDefinitions() { 144 | // @formatter:off 145 | return Stream.of( 146 | // Process start Should be polled? 147 | arguments(BEFORE_CUTOFF, false), 148 | arguments(CUTOFF_TIME, false), 149 | arguments(WITHIN_PAST_TIMESLICE, false), 150 | arguments(START_TIME, true), 151 | arguments(WITHIN_TIMESLICE, true), 152 | arguments(END_TIME, false), 153 | arguments(AFTER_TIMESLICE, false) 154 | ); 155 | // @formatter:on 156 | } 157 | 158 | private static void setCurrentTime(PointOfTime time) { 159 | ClockUtil.setCurrentTime(time.date); 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/test/java/de/viadee/camunda/kafka/pollingclient/service/polling/rest/CamundaRestPollingServiceImplTest.java: -------------------------------------------------------------------------------- 1 | package de.viadee.camunda.kafka.pollingclient.service.polling.rest; 2 | 3 | import de.viadee.camunda.kafka.event.ProcessInstanceEvent; 4 | import de.viadee.camunda.kafka.pollingclient.config.properties.CamundaRestPollingProperties; 5 | import de.viadee.camunda.kafka.pollingclient.service.polling.rest.response.GetHistoricProcessInstanceResponse; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.core.ParameterizedTypeReference; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.client.RestTemplate; 10 | 11 | import java.text.DateFormat; 12 | import java.text.ParseException; 13 | import java.text.SimpleDateFormat; 14 | import java.util.*; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | import static org.junit.jupiter.api.Assertions.assertEquals; 18 | import static org.junit.jupiter.api.Assertions.assertFalse; 19 | import static org.mockito.Mockito.*; 20 | 21 | class CamundaRestPollingServiceImplTest { 22 | 23 | RestTemplate mockedRestTemplate = mock(RestTemplate.class); 24 | Date startedAfter = parseDate("2012-10-01T09:45:00.000UTC+00:00"); 25 | Date startedBefore = parseDate("2019-10-01T09:45:00.000UTC+00:00"); 26 | Date finishedAfter = parseDate("2012-10-01T09:45:00.000UTC+00:00"); 27 | 28 | @SuppressWarnings({ "rawtypes", "unchecked" }) 29 | @Test 30 | void pollFinishedProcessInstancesWithEmptyList() { 31 | 32 | // create CamundaRestPollingProperties 33 | CamundaRestPollingProperties prop = new CamundaRestPollingProperties(); 34 | prop.setPassword("XY"); 35 | prop.setUrl("XY"); 36 | prop.setUsername("XY"); 37 | 38 | List emptyResultList = new ArrayList(); 39 | 40 | // mocking 41 | ResponseEntity mockedResponseEntity = mock(ResponseEntity.class); 42 | when(mockedResponseEntity.getBody()).thenReturn(emptyResultList); 43 | when(mockedRestTemplate.exchange(any(), any(), any(), (ParameterizedTypeReference) any(), 44 | (Map) any())).thenReturn(mockedResponseEntity); 45 | 46 | // call functions 47 | CamundaRestPollingServiceImpl c = new CamundaRestPollingServiceImpl(prop, mockedRestTemplate); 48 | Iterable pieList = c.pollFinishedProcessInstances(startedAfter, startedBefore, 49 | finishedAfter); 50 | 51 | assertFalse(pieList.iterator().hasNext()); 52 | } 53 | 54 | @SuppressWarnings({ "rawtypes", "unchecked" }) 55 | @Test 56 | void pollFinishedProcessInstances() { 57 | 58 | // create CamundaRestPollingProperties 59 | CamundaRestPollingProperties prop = new CamundaRestPollingProperties(); 60 | prop.setPassword("XY"); 61 | prop.setUrl("XY"); 62 | prop.setUsername("XY"); 63 | 64 | // fill list with two events: one before start time and one exactly at start 65 | // time 66 | Date startTime = parseDate("2009-11-02T09:45:00.000UTC+00:00"); 67 | 68 | List resultList = new ArrayList(); 69 | GetHistoricProcessInstanceResponse g = new GetHistoricProcessInstanceResponse(); 70 | g.setId("123"); 71 | g.setStartTime(startTime); 72 | resultList.add(g); 73 | GetHistoricProcessInstanceResponse g2 = new GetHistoricProcessInstanceResponse(); 74 | g2.setId("124"); 75 | g2.setStartTime(startedBefore); 76 | resultList.add(g2); 77 | 78 | // mocking 79 | ResponseEntity mockedResponseEntity = mock(ResponseEntity.class); 80 | when(mockedResponseEntity.getBody()).thenReturn(resultList); 81 | when(mockedRestTemplate.exchange(any(), any(), any(), (ParameterizedTypeReference) any(), 82 | (Map) any())).thenReturn(mockedResponseEntity); 83 | 84 | // call functions 85 | CamundaRestPollingServiceImpl c = new CamundaRestPollingServiceImpl(prop, mockedRestTemplate); 86 | Iterable pieIterator = c.pollFinishedProcessInstances(startedAfter, startedBefore, 87 | finishedAfter); 88 | 89 | Iterator iter = pieIterator.iterator(); 90 | 91 | assertEquals("123", iter.next().getId()); 92 | assertFalse(iter.hasNext()); 93 | } 94 | 95 | @SuppressWarnings({ "rawtypes", "unchecked" }) 96 | @Test 97 | void diffSourceTimeZone() throws ParseException { 98 | 99 | final String noTimeZonePattern = "yyyy-MM-dd'T'HH:mm:ss"; 100 | final String testDateStr = "2012-10-01T09:45:00"; 101 | 102 | final String simulatedLocalTimeZone = "GMT"; 103 | final long simulatedHoursDiff = 3; 104 | final String simulatedSourceTimeZone = "GMT+" + simulatedHoursDiff; 105 | 106 | DateFormat noTimeZoneDateFormat = new SimpleDateFormat(noTimeZonePattern); 107 | noTimeZoneDateFormat.setTimeZone(TimeZone.getTimeZone(simulatedLocalTimeZone)); 108 | 109 | Date localDate = noTimeZoneDateFormat.parse(testDateStr); 110 | 111 | // create CamundaRestPollingProperties 112 | CamundaRestPollingProperties prop = new CamundaRestPollingProperties(); 113 | prop.setSourceTimeZone(simulatedSourceTimeZone); 114 | CamundaRestPollingServiceImpl camundaRestPollingService = new CamundaRestPollingServiceImpl(prop, 115 | mockedRestTemplate); 116 | String sourceFormatedDateStr = camundaRestPollingService.formatDate(localDate); 117 | 118 | // source Date without TimeZone information 119 | Date sourceDate = noTimeZoneDateFormat.parse(sourceFormatedDateStr); 120 | 121 | long diffInMillies = Math.abs(localDate.getTime() - sourceDate.getTime()); 122 | long diff = TimeUnit.HOURS.convert(diffInMillies, TimeUnit.MILLISECONDS); 123 | 124 | assertEquals(diff, simulatedHoursDiff); 125 | 126 | } 127 | 128 | // Generate date in needed format 129 | public static Date parseDate(String date) { 130 | final String API_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; 131 | try { 132 | return new SimpleDateFormat(API_DATE_FORMAT).parse(date); 133 | } catch (ParseException e) { 134 | return null; 135 | } 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/test/resources/bpmn/activityTestProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SequenceFlow_12ff9js 6 | 7 | 8 | 9 | SequenceFlow_0ein7ff 10 | 11 | 12 | 13 | SequenceFlow_12ff9js 14 | SequenceFlow_1wbse2j 15 | 16 | 17 | 18 | 19 | SequenceFlow_1wbse2j 20 | SequenceFlow_0ayreum 21 | 22 | 23 | 24 | 25 | SequenceFlow_0ayreum 26 | SequenceFlow_0ein7ff 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/test/resources/bpmn/simpleProcess.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Process Decription 5 | 6 | SequenceFlow1 7 | 8 | 9 | SequenceFlow_0wjuzdd 10 | 11 | 12 | 13 | 14 | SequenceFlow1 15 | SequenceFlow_0wjuzdd 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /camunda-kafka-polling-client/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /hooks/pre_build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "perform maven build" 4 | 5 | docker run -v $(pwd):/src -w /src maven:3.6-jdk-8-alpine mvn clean package 6 | --------------------------------------------------------------------------------