diff --git a/.run/No Profiles.run.xml b/.run/No Profiles.run.xml new file mode 100644 index 0000000..50efb82 --- /dev/null +++ b/.run/No Profiles.run.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/.run/TimeSyncCamunda7Application.run.xml b/.run/TimeSyncCamunda7Application.run.xml new file mode 100644 index 0000000..814fd92 --- /dev/null +++ b/.run/TimeSyncCamunda7Application.run.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/.run/With Profile.run.xml b/.run/With Profile.run.xml new file mode 100644 index 0000000..8ccbead --- /dev/null +++ b/.run/With Profile.run.xml @@ -0,0 +1,17 @@ + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 3b1dfe5..1e9c0f8 100644 --- a/README.md +++ b/README.md @@ -38,32 +38,49 @@ The process involves synchronizing time-related data within the HRworks system. - **Notify about error** user task informs the user about an error in the process. 4. Depending on the outcome, the subprocess concludes with either a successful `Times synced` end event or an `Error detected` end event. -## Run the Stack - -To run the Camunda Platform with the history plugin and a PostgreSQL database, follow these steps: - -### Step 1: Build the Docker Image - -First navigate to the hrworks-showcase-c7 directory: - -```bash -cd stack/hrworks-showcase-c7 -``` - -Then build the Docker image using the following command: - -```bash -docker compose build -``` - -### Step 2: Start the Stack - -Once the Docker image is built, use `docker-compose` to start the Camunda Platform along with the PostgreSQL database: - -```bash -docker compose up -``` -The Camunda Platform and the PostgreSQL database will now be up and running in a containerized environment. +## Quick Start + +1. Clone the Repository + + ```shell + git clone https://github.com/Miragon/hrworks-showcase.git + cd hrworks-showcase + ``` + +2. Build the Project + + ```shell + mvn clean package + ``` + +3. Add Environment Variables + + ```shell + cd timesync-stack + touch .env + ``` + + Add the following environment variables to the `.env` file: + + ```text + # Clockify + CLOCKIFY_API_KEY= + + # HRWorks + HRWORKS_AC_KEY= + HRWORKS_SAC_KEY= + ``` + + > Note: See [Find/Generate Credentials](#findgenerate-credentials) for more information about the credentials. + +4. Start the Stack + + ```bash + cd timesync-stack + docker compose --profile worker up + ``` + +5. Deploy the Artifacts (see [Deploy Artifacts](#deploy-artifacts)) ### Accessing Camunda Web Applications @@ -73,64 +90,48 @@ After starting the stack, you can access the Camunda Web Applications using the * [Camunda Cockpit](http://localhost:8080/camunda/app/cockpit/default/#/dashboard) * [Camunda Admin](http://localhost:8080/camunda/app/admin/default/#/) -## Project Setup - -To run this project, you need to have a running instance of Camunda Platform 7. -Set the base URL to it in the `application.yml` of the `timesync-camunda7` module: - -```yaml -# Camunda Platform 7 -camunda: - bpm: - client: - base-url: http://localhost:8080/engine-rest -``` - -Additionally, you must set the Clockify API key in the `application.yml`: +## Deploy artifacts -```yaml -# Clockify -clockify: - apiKey: "" -``` +You can use the [Camunda Modeler](https://camunda.com/de/download/modeler/) to deploy the process. +1. Open the [bpmn file](./timesync/timesync-camunda7/src/main/resources/bpmn/hrworks-timesync.bpmn) +2. Add the [form](./timesync/timesync-camunda7/src/main/resources/.camunda/forms/error.form) to your deployment + + deployment + +3. Click on `Deploy` -The Clockify API key can be found on the [Clockify website under "User Settings"](https://app.clockify.me/user/settings). -For convenience, we have set up two test accounts, and the credentials can be found in 1Password. +## Find/Generate Credentials -Moreover, you need to set the HRWorks `accessKey` and `secretAccessKey` inside the `application.yml`: +The **Clockify API** key can be found on the [Clockify website under "User Settings"](https://app.clockify.me/user/settings). -```yaml -# HRWorks -hrworks: - accessKey: "" - secretAccessKey: "" -``` -The HRWorks keys can be generated on the HRWorks admin page at https://ssl1.hrworks.de/demo-a03/HrwScStartView under +The **HRWorks Keys** can be generated on the HRWorks admin page at https://ssl1.hrworks.de/demo-a03/HrwScStartView under "Grundlagen" > "Integration" > "HRWorks-API". -Please ensure that you have obtained the necessary credentials and correctly configured the `application.yml` before -running the project. +## Development -## Running the Project +This project comes with a [run script](.run/TimeSyncCamunda7Application.run.xml) for *IntelliJ IDEA*. +This script expects a `.env` file under [timesync-stack](./timesync-stack) with the following environment variables: -After following the [Project Setup](#project-setup) you should be able to simply start the `TimeSyncCamunda7Application`. - -## Deploy artifacts +```text +# Clockify +CLOCKIFY_API_KEY= -You can use the [Camunda Modeler](https://camunda.com/de/download/modeler/) to deploy the process. -1. Open the [bpmn file](./timesync/timesync-camunda7/src/main/resources/bpmn/hrworks-timesync.bpmn) -2. Add the [form](./timesync/timesync-camunda7/src/main/resources/.camunda/forms/error.form) to your deployment -deployment -3. Click on `Deploy` +# HRWorks +HRWORKS_AC_KEY= +HRWORKS_SAC_KEY= +``` -## Run Tests +> Note: See [Find/Generate Credentials](#findgenerate-credentials) for more information about the credentials. -To run the tests for this showcase, execute the following command: +If you have obtained the necessary credentials, you can start the stack. -```bash -mvn clean test +```shell +cd timesync-stack +docker compose up ``` +If the stack is running, you can start the application using the run script. + ## License This showcase is licensed under the [MIT License](LICENSE).