Skip to content

Commit

Permalink
Merge branch 'main' into webhook-review
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrateau authored Oct 29, 2024
2 parents 066acf1 + 2ac0d3e commit ecad7ff
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "package-lock.json|FETCH_HEAD|^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-10-17T07:41:28Z",
"generated_at": "2024-10-29T13:41:56Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -82,7 +82,7 @@
"hashed_secret": "54dfd9c625c7fe5be99078f7f117bbccf50b49be",
"is_secret": false,
"is_verified": false,
"line_number": 49,
"line_number": 42,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
4 changes: 2 additions & 2 deletions decisioncenter/businessvalueeditor/README-DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Before following the steps below, make sure you have built the images as explain

### Running the sample

Run ODM docker images
Run ODM and Notifiers docker images
```bash
docker-compose -f compose-odm-dev.yml up odm-with-custom-value-editor
```

### Using the Sample

Access Decision Center using the URL **http://localhost:9060** <!-- markdown-link-check-disable-line -->
Access Decision Center using the URL **http://localhost:9060**

Click on the link **Decision Center Business Console**

Expand Down
4 changes: 2 additions & 2 deletions decisioncenter/businessvalueeditor/README-KUBERNETES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Introduction

This README explains how to run the Custom Value Editor sample in Kubernetes.
Before following the steps below, make sure you have built the Decision Center extension as explained in [README.md](README.md).
Before following the steps below, make sure you have built the images as explained in [README.md](README.md).

# Configuring the sample in Kubernetes

Expand Down Expand Up @@ -69,7 +69,7 @@ To activate the Custom Value Editor, after login in Decision Center as an admini

![Custom Settings](images/custom_settings_2.png)

Import the [ValueEditorService.zip](./projects/ValueEditorService.zip) Decision Service.
Load the [ValueEditorService.zip](./projects/ValueEditorService.zip) Decision Service.

Follow [Running this sample](https://www.ibm.com/docs/en/odm/9.0.0?topic=editor-custom-value-sample-details#businessconsolecustomvalueeditorsampledetails__rssamples.uss_rs_smp_tsauthoring.1025134__title__1) details to understand how to use the custom value editor.

Expand Down
4 changes: 3 additions & 1 deletion decisioncenter/businessvalueeditor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ To use the sample in Decision Center, you need to build a JAR for [Docker](READM
> ```
> Uninstall the ODM for Developer instance to avoid a port usage conflict if you continue this tutorial on [Docker](README-DOCKER.md) :
> ```
> docker-compose -f compose-odm-dev.yml down
> docker-compose -f compose-odm-dev.yml up down
> ```
2. Build the JAR

The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 17.

For ODM 8.12, you must use **maven:3.8.1-openjdk-11** instead and **maven:3.8-adoptopenjdk-8** for earlier releases.

Run the command below in the **decisioncenter/businessvalueeditor/businessvalueeditor-source** directory:

```bash
Expand Down
17 changes: 5 additions & 12 deletions decisioncenter/dynamicdomain/README-DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@ Before following the steps below, make sure you have built the customization JAR

1. In the BOM dynamic domain sample root directory (`odm-container-samples/decisioncenter/dynamicdomain`), run
```bash
docker run -d --name odmdev \
-v "$(pwd)/src/ilog.rules.studio.samples.bomdomainpopulate/target/bomdomainpopulate-1.0.jar":/config/apps/decisioncenter.war/WEB-INF/lib/bomdomainpopulate-1.0.jar \
-v "$(pwd)/sql_scripts":/script/sql \
-p 9060:9060 -p 9443:9443 \
-m 2048M --memory-reservation 2048M \
-e LICENSE=accept \
-e SAMPLE=true \
icr.io/cpopen/odm-k8s/odm:9.0
docker-compose up odm-dynamic-domain
```

1. then, run
```
docker exec odmdev sh -c "cp /config/resources/h2*.jar /config/apps/decisioncenter.war/WEB-INF/lib/h2.jar"
docker restart odmdev
docker-compose exec odm-dynamic-domain sh -c "cp /config/resources/h2*.jar /config/apps/decisioncenter.war/WEB-INF/lib/h2.jar"
docker-compose restart odm-dynamic-domain
```

## 2. Initializing the dynamic domains database

- Run
```bash
docker exec odmdev sh -c "java \
docker-compose exec odm-dynamic-domain sh -c "java \
-cp /config/resources/h2*.jar \
org.h2.tools.RunScript \
-url jdbc:h2:/config/dbdata/bomdomain \
Expand All @@ -60,7 +53,7 @@ Before following the steps below, make sure you have built the customization JAR
1. Display the rule `CheckCurrency > CurrencyRestriction`. No warning is displayed.
1. Let's now make some changes in the dynamic domains in the database. Run:
```bash
docker exec odmdev sh -c "java \
docker-compose exec odm-dynamic-domain sh -c "java \
-cp /config/resources/h2*.jar \
org.h2.tools.RunScript \
-url jdbc:h2:/config/dbdata/bomdomain \
Expand Down
88 changes: 39 additions & 49 deletions decisioncenter/dynamicdomain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To use the sample in Rule Designer, you need to build an Eclipse plugin.

### 1) Prerequisites

Before you begin, ensure you have one of the following **Container Platform**: Docker 24.0.x or Kubernetes 1.27+.
Ensure you have at least Docker 24.0.x (and optionally Kubernetes 1.27+).

### 2) Configuring how to connect to the database (kubernetes only)

Expand All @@ -69,65 +69,55 @@ To use the sample in Decision Center, you need to build a JAR.

1. Retrieve ODM libraries:

ODM libraries are required to compile the JAR. You can find them either from a running instance of Decision Center or from Rule Designer.
ODM libraries are required to compile the JAR.

* **Option 1:** Download ODM libraries from Decision Center
- Navigate to the source directory of the BOM dynamic domain sample:
```bash
cd decisioncenter/dynamicdomain/src/ilog.rules.studio.samples.bomdomainpopulate
```

- Navigate to the source directory of the BOM dynamic domain sample:
- Deploy ODM for Developer public docker image to quickly download the ODM libraries and then stop it :
```
docker-compose -f ../../compose.yaml up odm
```

```bash
cd decisioncenter/dynamicdomain/src/ilog.rules.studio.samples.bomdomainpopulate
```
- Download the decision-center-client-api.zip file :
```bash
wget http://localhost:9060/decisioncenter/assets/decision-center-client-api.zip
```

- Download the following compressed file: `https://DC_HOST:DC_PORT/decisioncenter/assets/decision-center-client-api.zip`
- Then, run:
```bash
unzip decision-center-client-api.zip -d "lib"
```

- Then, run:
```bash
unzip decision-center-client-api.zip -d "lib"
```

* **Option 2:** use ODM libraries from Rule Designer (available in Eclipse plugins directory)

Set the `ECLIPSE_PLUGINS` environment variable:
```bash
ECLIPSE_PLUGINS=<ECLIPSE PLUGINS DIRECTORY>
```
- Undeploy ODM for developer (especially if you continue this tutorial on [Docker](README-DOCKER.md) to avoid a TCP/IP port usage conflict) :
```
docker-compose -f ../../compose.yaml down
```

1. Build the JAR

The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 17. For ODM 8.12, you must use `maven:3.8.1-openjdk-11` instead and `maven:3.8-adoptopenjdk-8` for earlier releases.

Run one of the command below in the `decisioncenter/dynamicdomain/src/ilog.rules.studio.samples.bomdomainpopulate` directory:

* **Option 1:** when using ODM libraries from Decision Center

```bash
docker run --rm \
-v "$(pwd)":/usr/src/sample \
-w /usr/src/sample \
maven:3.8.5-openjdk-17 \
mvn clean install
```

* **Option 2** when using ODM libraries from Rule Designer

```bash
docker run --rm \
-v "$(pwd)":/usr/src/sample \
-w /usr/src/sample \
-v "${ECLIPSE_PLUGINS}":/usr/src/eclipse/plugins \
-e ECLIPSE_PLUGINS=/usr/src/eclipse/plugins \
maven:3.8.5-openjdk-17 \
mvn clean install
```

> [!IMPORTANT]
> add **`-Dtarget.docker`** after `mvn clean install` to use the sample in **Docker**, i.e:
> ```bash
> docker run --rm
> ...
> mvn clean install -Dtarget.docker
> ```
- to use the sample on **Kubernetes** :
```bash
docker run --rm \
-v "$(pwd)":/usr/src/sample \
-w /usr/src/sample \
maven:3.8.5-openjdk-17 \
mvn clean install
```

- to use the sample on **Docker** :
```bash
docker run --rm \
-v "$(pwd)":/usr/src/sample \
-w /usr/src/sample \
maven:3.8.5-openjdk-17 \
mvn clean install -Dtarget.docker
```

The JAR is generated in the `target` directory and is named `bomdomainpopulate-1.0.jar`.

Expand Down
27 changes: 27 additions & 0 deletions decisioncenter/dynamicdomain/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
odm:
image: icr.io/cpopen/odm-k8s/odm:9.0.0
mem_limit: 4G
memswap_limit: 4G
user: "1001:0"
environment:
- SAMPLE=true
- LICENSE=accept
ports:
- 9060:9060
- 9453:9453

odm-dynamic-domain:
image: icr.io/cpopen/odm-k8s/odm:9.0.0
mem_limit: 4G
memswap_limit: 4G
user: "1001:0"
environment:
- SAMPLE=true
- LICENSE=accept
ports:
- 9060:9060
- 9453:9453
volumes:
- $PWD/src/ilog.rules.studio.samples.bomdomainpopulate/target/bomdomainpopulate-1.0.jar:/config/download/bomdomainpopulate-1.0.jar
- $PWD/sql_scripts:/script/sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
</goals>
<configuration>
<target>
<javac srcdir="${project.build.sourceDirectory}"
<javac sourcepath="" srcdir="${project.build.sourceDirectory}"
destdir="${project.build.outputDirectory}"
includeantruntime="false"
compiler="modern">
<include name="**/*.java"/>
<exclude name="**/BomdomainpopulatePlugin.java"/>
<exclude name="**/actions/*"/>
<classpath>
<fileset dir="${env.ECLIPSE_PLUGINS}" includes="**/*.jar"/>
<fileset dir="${project.basedir}/lib" includes="**/*.jar"/>
</classpath>
</javac>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,11 @@ protected static void log(Throwable e) {
// BomdomainpopulatePlugin can only be used in Eclipse
// ignore the exception otherwise
try {
BomdomainpopulatePlugin.log(e);
} catch (Exception e1) {
Class<?> clazz = Class.forName("ilog.rules.studio.samples.bomdomainpopulate.BomdomainpopulatePlugin");
java.lang.reflect.Method method = clazz.getMethod("log", Throwable.class);
method.invoke(e);
}
catch (Exception e1) {
}
}
}
2 changes: 0 additions & 2 deletions decisioncenter/guicustomization/README-DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ To activate the Custom Value Editor, after login in Decision Center as an admini

![Custom Settings](images/custom_settings_2.png)

Load the [LoanValidationService.zip](./projects/LoanValidationService.zip) Decision Service.

Follow [Running this sample](https://www.ibm.com/docs/en/odm/9.0.0?topic=customization-gui-sample-details#descriptiveTopic1297785707571__rssamples.uss_rs_smp_tsauthoring.1028561__title__1) details to understand how to use some custom widgets by drilling in the LoanValidationService Decision Service.

![Business Console Custom GUI](images/custom_gui.png)
Expand Down
4 changes: 1 addition & 3 deletions decisioncenter/guicustomization/README-KUBERNETES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ However you must use the **legacy way** if you deploy a version of ODM older tha

Upload the guicustomization-1.0.jar file on the file server :
```
curl -T target/guicustomization-1.0.jar $FILESERVER_URL
curl -T guicustomization/guicustomization-source/target/guicustomization-1.0.jar $FILESERVER_URL
```

## 2. Deploying ODM
Expand Down Expand Up @@ -66,8 +66,6 @@ To activate the Custom Value Editor, after login in Decision Center as an admini

![Custom Settings](images/custom_settings_2.png)

Load the [LoanValidationService.zip](./projects/LoanValidationService.zip) Decision Service.

Follow [Running this sample](https://www.ibm.com/docs/en/odm/9.0.0?topic=customization-gui-sample-details#descriptiveTopic1297785707571__rssamples.uss_rs_smp_tsauthoring.1028561__title__1) details to understand how to use some custom widgets by drilling in the LoanValidationService Decision Service.

![Business Console Custom GUI](images/custom_gui.png)
36 changes: 22 additions & 14 deletions decisioncenter/guicustomization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,42 @@ To use the sample in Decision Center, you need to build a JAR.

1. Retrieve ODM libraries:

Navigate to the source directory of the GUI Customization sample :
Navigate to the source directory of the GUI Customization sample:

```
cd decisioncenter/guicustomization/guicustomization-source
```
Install the ODM for Developer docker image :
```
docker-compose -f compose-odm-dev.yml up odm
```
ODM libraries are required to compile the JAR.
To get the ODM libraries, you need an access to a running Decision Center instance.
Download the **decision-center-client-api.zip** file :

```
wget http://localhost:9060/decisioncenter/assets/decision-center-client-api.zip
wget https://DC_HOST:DC_PORT/decisioncenter/assets/decision-center-client-api.zip --no-check-certificate
```

Unzip decision-center-client-api.zip on the **lib** directory :
Then, unzip decision-center-client-api.zip on the **lib** directory :
```
unzip decision-center-client-api.zip -d "lib"
```

Uninstall the ODM for Developer instance to avoid a port usage conflict if you continue this tutorial on [Docker](README-DOCKER.md) :
```
docker-compose -f compose-odm-dev.yml down
```
> [!NOTE]
> If you don't have a running Decision Center, install it using the ODM for Developer public docker image, by running :
> ```
> docker-compose -f compose-odm-dev.yml up odm
> ```
> Then download the **decision-center-client-api.zip** file :
> ```
> wget http://localhost:9060/decisioncenter/assets/decision-center-client-api.zip
> ```
> Uninstall the ODM for Developer instance to avoid a port usage conflict if you continue this tutorial on [Docker](README-DOCKER.md) :
> ```
> docker-compose -f compose-odm-dev.yml up down
> ```
2. Build the JAR

The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 17.
The instructions below enable to build the JAR using a Docker container featuring Maven and a JDK version 17. For ODM 8.12, you must use `maven:3.8.1-openjdk-11` instead and `maven:3.8-adoptopenjdk-8` for earlier releases.

Run the command below in the **decisioncenter/guicustomization/guicustomization-source** directory:

Expand All @@ -57,7 +65,7 @@ To use the sample in Decision Center, you need to build a JAR.
mvn clean install
```

The **guicustomization-1.0.jar** file is generated in the **target** directory.
The JAR is generated in the **target** directory and is named **guicustomization-1.0.jar**.

### 3) Instructions to use the sample in Decision Center

Expand Down
4 changes: 2 additions & 2 deletions decisioncenter/guicustomization/compose-odm-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
odm:
image: icr.io/cpopen/odm-k8s/odm:9.0.0
image: icr.io/cpopen/odm-k8s/odm
mem_limit: 4G
memswap_limit: 4G
user: "1001:0"
Expand All @@ -12,7 +12,7 @@ services:
- 9453:9453

odm-with-gui-customization:
image: icr.io/cpopen/odm-k8s/odm:9.0.0
image: icr.io/cpopen/odm-k8s/odm
mem_limit: 4G
memswap_limit: 4G
user: "1001:0"
Expand Down
Loading

0 comments on commit ecad7ff

Please sign in to comment.