# Decision Table - Customer Discount

The Decision Table - Customer Discount project illustrates the appRules Evaluate Decision Table activity.

## Product & Hosting Options

#### Platform Product Availability

The workflow activities and other modules used in this sample project are available in the following appRules Platform products:

<table><thead><tr><th width="374"> Platform Product</th><th>Availability</th></tr></thead><tbody><tr><td>appRules Data Migration Engine</td><td><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FgAU2hgGMadkzCFDpHYAx%2Fimage.png?alt=media&#x26;token=3b69a86b-8d0c-40b8-a2bf-a2548e6dcea8" alt=""></td></tr><tr><td>appRules Integration &#x26; Automation Engine</td><td><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FY4AJ11rTrohTQdopBTk8%2Fimage.png?alt=media&#x26;token=222dccea-a6c4-42d9-a573-220fee5275e2" alt=""></td></tr><tr><td>appRules Enterprise 360</td><td><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FbYAbg5056fkAJrta4voJ%2Fimage.png?alt=media&#x26;token=121aa2c3-4a84-4748-b370-cc73ff6e8f07" alt=""></td></tr></tbody></table>

#### Hosting & Execution Environment&#x20;

If you are running the On-Premise, Azure Marketplace or AWS Marketplace editions, the following hosting options supported by appRules are recommended for running this sample project:

| Hosting Option        | Recommended for Project                                                                                                                                                                                             |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IIS                   | ![](https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FQGuJStnndRXh9p477KCi%2Fimage.png?alt=media\&token=9e62c85b-8107-4880-8911-60a7f11985f8) |
| appRules Host Service | ![](https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2Fg7FiSjSFDMM4rb9C79m9%2Fimage.png?alt=media\&token=688d46b8-261f-4de0-9db7-0a0fbc5e8016) |
| appRules Desktop      | ![](https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FwTC2SCA3rCAir6iDKmSs%2Fimage.png?alt=media\&token=41a6319f-25da-4373-b45e-9f5418a67fd4) |

{% hint style="info" %}
Since the appRules Host Service is automatically installed and ready to go, it is recommended that you use it for evaluating this sample project.  Just point your browser to the appRules URL
{% endhint %}

&#x20;

{% hint style="info" %}
The completed project is available in the appRules **Samples** project database. Click the "Open" toolbar button on the appRules home page to select the "Decision Table - Customer Discount" project.
{% endhint %}

EvaluateDecisionTable is the only workflow activity required for configuring a decision table in appRules.  It can be accessed from the **Business Rules** module in the toolbox.

For simplicity, we have used a single activity in this sample project.  In an actual project, the EvaluateDecisionTable activity is used in conjunction with other activities.

Also, in this sample, the values to be evaluated are passed to the EvaluateDecisionTable activity from the arguments used to run the project.   In an actual project, the values passed to the activity typically come from record values in data sources such as CRM, ERP, Databases, etc.  The project can also be called via the appRules WebAPI.

{% hint style="info" %}
Note that the **View Execution Results** box of the EvaluateDecisionTable activity is checked to display the result when the activity is executed.  This is the practice for debugging appRules activities.  At deployment, the View Execution Results box is automatically deactivated if the project is not run in interactive mode.
{% endhint %}

You can experiment with this project by making changes and running the project to view results. No external data sources are required.

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FSw6SDOvdDyNj0Q479qkg%2Fimage.png?alt=media&#x26;token=c977814d-5378-4f43-b849-f2f71f0d17be" alt=""><figcaption></figcaption></figure>

Define Conditions to be used in the decision table:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FqHY72rQYR60rrOvtYGNP%2Fimage.png?alt=media&#x26;token=827fb687-4641-4ef2-8e58-0ae392db4f8d" alt=""><figcaption></figcaption></figure>

Define Actions to be used in the decision table:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FYB9OOisuOKouIJ1kyZgP%2Fimage.png?alt=media&#x26;token=0b3f3cce-219b-44a9-9069-bcea56127383" alt=""><figcaption></figcaption></figure>

Set up Conditions and Actions:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2F7pnHMfwBoh54Atr6x9e7%2Fimage.png?alt=media&#x26;token=564187db-31cc-4a5c-b73a-dc14c999b2b9" alt=""><figcaption></figcaption></figure>

Define Decision Conditions Items:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2F0YTs6i1RbEz6Rkx9GRDO%2Fimage.png?alt=media&#x26;token=09701db9-f596-45fa-900b-c72ae169c8c4" alt=""><figcaption></figcaption></figure>

Define Decision Action Items:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FpAHgEmv0vARD1BXmFMht%2Fimage.png?alt=media&#x26;token=747b8975-ca43-4480-b7a2-989e0e3bfc26" alt=""><figcaption></figcaption></figure>

Configure Condition and Action combinations:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2Fjy95slLc3j3gb8YuOPfI%2Fimage.png?alt=media&#x26;token=1889d364-6e3d-4b03-9c20-a6904def4ef3" alt=""><figcaption></figcaption></figure>

Run the project directly and pass arguments to be used for evaluating the decision table:

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2Fi0rgrntMtNIIohbjA2RC%2Fimage.png?alt=media&#x26;token=1ce5be16-689c-4373-b898-7e7f0f767d8f" alt=""><figcaption></figcaption></figure>

View the Execution Results and notice that row 3 in the result table below meets the criteria as defined by the arguments passed to the project.

<figure><img src="https://1923141441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFjmFrZ8sef1J7qkr6H%2Fuploads%2FdyzYrRcaixStZu1OsYTq%2Fimage.png?alt=media&#x26;token=73196114-4adc-44fa-99de-6133bc3a8c54" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The project can also be called via the appRules WebAPI.
{% endhint %}
