Commit f6e2e96b authored by Eduardo González Real's avatar Eduardo González Real
Browse files

Update README.md fix private URLs

parent 71dc866b
......@@ -2,10 +2,10 @@
This repository contains the project folder for the development of the WITDOM **Work Item Handlers** and **Protection Configurations**.
- Java classes for **Work Item Handlers** are available in [``src/main/java/core/po/utils``](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/tree/master/processesAndHandlers/src/main/java/core/po/utils).
- BPMN processes for **Protection Configurations** are available in [``src/main/resources``](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/tree/master/processesAndHandlers/src/main/resources).
- Java classes for **Work Item Handlers** are available in [``src/main/java/core/po/utils``](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-source/processesAndHandlers/src/main/java/core/po/utils).
- BPMN processes for **Protection Configurations** are available in [``src/main/resources``](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-source/processesAndHandlers/src/main/resources).
> **Note:** More detailed information about the internals of the WITDOM **Protection Configurations** and the **use cases** is available [**here**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/tree/master/resources/conf/protectionConfigurations).
> **Note:** More detailed information about the internals of the WITDOM **Protection Configurations** and the **use cases** is available [**here**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-deployment/resources/conf/protectionConfigurations).
## Requirements
- Compiling Java classes requires [**Java SDK**](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) to be installed.
......@@ -22,50 +22,50 @@ Overview description for adding ``processesAndHandlers`` into Eclipse workspace:
1. Create new **jBPM project** in Eclipse.
2. Untick *"User default location"* and select the ``processesAndHandlers`` folder.
3. Select *"an empty project"* in the **next tab** of the wizard.
4. Once the project is created, add all the external libraries located in [**``src/main/resources/META-INF/lib``**](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/tree/master/processesAndHandlers/src/main/resources/META-INF/lib) to the **project build path**.
4. Once the project is created, add all the external libraries located in [**``src/main/resources/META-INF/lib``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-source/processesAndHandlers/src/main/resources/META-INF/lib) to the **project build path**.
5. Everything is ready to start working on the code.
## Getting started
Overview description of the development of **Work Item Handlers**:
1. Compile the corresponding **Java REST client** and add it into the folder:
[**``src/main/resources/META-INF/lib``**](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/tree/master/processesAndHandlers/src/main/resources/META-INF/lib).
[**``src/main/resources/META-INF/lib``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-source/processesAndHandlers/src/main/resources/META-INF/lib).
2. If the Java class of the **Work Item Handler** requires any other external library, it must be also added in the folder mentioned above.
3. Once these libraries are located into the lib folder, they must be added to the **build path** of the project as external JARs (using **Eclipse**).
4. **Work Item Handlers** must extend ``WitdomWorkItemHandler``.
5. In order to retrieve **Protection Configuration** process variables, jBPM ``KieSession`` must be added to the **Work Item Handler** constructor.
6. Initialize **Java REST client** API and obtain the **Protection Component** endpoint from [**``protectionComponents.properties``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/blob/master/resources/conf/protectionComponents.properties).
7. Obtain the **Protection Component** JSON from a process variable named ``data`` (specified within the [**Protection Configuration**](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/blob/master/processesAndHandlers/src/main/resources/e2ee-test.bpmn#L35)).
8. Replace this JSON with the needed process values using [**``replace``**](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/blob/master/processesAndHandlers/src/main/java/core/po/utils/WitdomWorkItemHandler.java#L97) function.
6. Initialize **Java REST client** API and obtain the **Protection Component** endpoint from [**``protectionComponents.properties``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-deployment/resources/conf/protectionComponents.properties).
7. Obtain the **Protection Component** JSON from a process variable named ``data`` (specified within the [**Protection Configuration**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/resources/e2ee-test.bpmn#L35)).
8. Replace this JSON with the needed process values using [**``replace``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/java/core/po/utils/WitdomWorkItemHandler.java#L130) function.
9. Treat the JSON in order to convert it into the objects structure of the **Java REST client**.
10. Send the data to the **Protection Component** using the **Java REST client** methods.
11. Complete the **BPMN task node** by adding the corresponding [**method**](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/blob/master/processesAndHandlers/src/main/java/core/po/utils/E2EEWorkItemHandler.java#L144) at the end of the code.
11. Complete the **BPMN task node** by adding the corresponding [**method**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/java/core/po/utils/E2EEWorkItemHandler.java#L144) at the end of the code.
> **Note:** For a more detailed information about the development of **Work Item Handlers**, code example is available [**here**](https://gitlab.atosresearch.eu/ari/WITDOM-PCCLIENTS/blob/master/processesAndHandlers/src/main/java/core/po/utils/E2EEWorkItemHandler.java).
> **Note:** For a more detailed information about the development of **Work Item Handlers**, code example is available [**here**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/java/core/po/utils/E2EEWorkItemHandler.java).
Overview description of the development of **Protection Configurations**:
1. Create new **BPMN2 Process** in ``src/main/resources`` folder.
2. Edit the process with the **Eclipse BPMN modeler tool**.
3. Use the **Properties tab** of the modeler tool to configure the nodes of the process and the variables involved.
4. Once the work with the modeler tool is finished, manually add an [**``onEntry-script``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/blob/master/resources/conf/protectionConfigurations/backup-protect.bpmn#L112) with the process variables that need to be set before the execution of the **Work Item Handler**.
5. The [**name**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/blob/master/resources/conf/protectionConfigurations/backup-protect.bpmn#L162) of the signal events must be the **Protection Component** acronym, this is very important due to callbacks information.
4. Once the work with the modeler tool is finished, manually add an [**``onEntry-script``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/resources/backup-protect.bpmn#L55) with the process variables that need to be set before the execution of the **Work Item Handler**.
5. The [**name**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/resources/backup-protect.bpmn#L183) of the signal events must be the **Protection Component** acronym, this is very important due to callbacks information.
6. **Eclipse BPMN modeler tool** could raise some bugs that need to be manually fixed (process variables references setted to null, node identifiers mismatches, ...).
> **Note:** For a more detailed information about the development of **Protection Configurations**, code example is available [**here**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/blob/master/resources/conf/protectionConfigurations/backup-protect.bpmn).
> **Note:** For a more detailed information about the development of **Protection Configurations**, code example is available [**here**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-source/processesAndHandlers/src/main/resources/backup-protect.bpmn).
## Installation
Once the development of a **Work Item Handler** is finished:
- Compile the **Java class** with **Eclipse**.
- Add the **JAR file** to your [**compiled version**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po) of the **Protection Orchestrator** within the folder [**``protectionItemHandlers``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/tree/master/resources/conf/protectionItemHandlers).
- The JAR file of the **Java REST client** involved in the **Work Item Handler** must be added to [**``protectionItemHandlers``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/tree/master/resources/conf/protectionItemHandlers) as well.
- Add a reference between the name of the **process task node** and the **Work Item Handler** class in [**``CustomWorkItemHandlers.conf``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/blob/master/resources/conf/CustomWorkItemHandlers.conf).
- The endpoint of the **Protection Component** involved in the **Work Item Handler** must be specified in [**``protectionComponents.properties``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/blob/master/resources/conf/protectionComponents.properties).
- Add the **JAR file** to your [**compiled version**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-deployment) of the **Protection Orchestrator** within the folder [**``protectionItemHandlers``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-deployment/resources/conf/protectionItemHandlers).
- The JAR file of the **Java REST client** involved in the **Work Item Handler** must be added to [**``protectionComponentsClients``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-deployment/resources/conf/protectionComponentsClients) as well.
- Add a reference between the name of the **process task node** and the **Work Item Handler** class in [**``CustomWorkItemHandlers.conf``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-deployment/resources/conf/CustomWorkItemHandlers.conf).
- The endpoint of the **Protection Component** involved in the **Work Item Handler** must be specified in [**``protectionComponents.properties``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/blob/master/witdom-core-po-deployment/resources/conf/protectionComponents.properties).
Once the development of a **Protection Configuration** is finished:
- If the **Protection Configuration** is meant for demonstration or testing purposes, add it into [**``resources/samples``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/tree/master/resources/samples) folder with an exported image of the process and its entry parameters. It must be executed from the **Protection Orchestrator** demo feature.
- If the **Protection Configuration** is at final version, add it into [**``resources/conf/protectionConfigurations``**](https://gitlab-witdom.xlab.si/WitdomWP5/witdom-core-po/tree/master/resources/conf/protectionConfigurations) folder. It must be executed from the **Protection Orchestrator** API.
- If the **Protection Configuration** is meant for demonstration or testing purposes, add it into [**``resources/samples``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-deployment/resources/samples) folder with an exported image of the process and its entry parameters. It must be executed from the **Protection Orchestrator** demo feature.
- If the **Protection Configuration** is at final version, add it into [**``resources/conf/protectionConfigurations``**](https://gitlab.atosresearch.eu/ari/witdom-core-po-pub/tree/master/witdom-core-po-deployment/resources/conf/protectionConfigurations) folder. It must be executed from the **Protection Orchestrator** API.
> **Note:** When a **Protection Configuration** or a **Work Item Handler** is added to the **Protection Orchestrator**, the **Docker container** must be rebuilt and redeployed.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment