# Digital Processes Example

## Introduction

The **Shift High Stock Product** digital process was created for demonstration purposes. In this example, Orchestration Engine uses the Emporix Commerce Engine API to perform some of the actions, but it can work with any other systems. There's no dependency between Emporix OE and Emporix CE platforms.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-024e49725dc9bb73dafeb8a3c6695215723f1e8c%2Fdp_gif.gif?alt=media" alt=""><figcaption></figcaption></figure>

The digital process is an example designed to meet the demand for maintaining optimal stock levels. It is prepared to identify and prioritize products with a high stock level, ensuring their successful promotion and preventing any issues with overstock.

The digital process consists of a trigger and subsequent process steps that end in promoting a product and sending a post action feedback to Celonis.

## Trigger

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-72b979100195cb0bcccb786a3d50b2422521ca44%2Fet_ex_trigger.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

High Stock Trigger is a mandatory part of the digital process as it sets off the rest of the steps. The trigger is based on an event that checks availability of a product and a condition related to its stock number. In this case, if the stock number exceeds 100, a new orchestration starts.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-47353fce2bb19230a1090c50c211214a45278131%2Fet_ex1.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

## Process steps

The digital process has seven process steps that work one after another to increase selling of a product that is overstocked. Each process step is a separate Make scenario that has its own trigger, actions and a completion event.

### Boost my Product

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-7f5d033eaebc847b3515f36119de0f186187e8fc%2Fet_ex_step1.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This step is designed to boost the product in the Search Engine's search ranking so that it appears at the top of the list. It's a Make scenario that begins with a trigger — an event received from the digital process's trigger, indicating that the orchestration should start. The modules initially gather information about a product, such as its product ID, name, and description — all the details entered into the system for that specific product. Following this, a variable is set to boost the product's popularity. An API call is then made to the Search Engine, and a completion event is sent, indicating that the operation has finished successfully, and the scenario is completed. This ends with a `product_boosted` event type.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-daa9393a0a39d075974ca0ba0d2217b98f1810ae%2Fboost_product.png?alt=media" alt=""><figcaption></figcaption></figure>

### Assign to Discount Group

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-00b3e58770e5b82b64f269b9370087d5a738de40%2Fet_ex_step2.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This step assigns the product to a Discount category in the Commerce or Pricing Engine. It starts with a trigger after the previous step is completed, searches for a category with a **Discount** name, gets the details of the product and assigns it to the Discount category. This ends with a `product_assigned_discount_category` event, that shows the scenario has finished successfully.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-2415a7227b53b691b937afefe79ed499fbc7a9a2%2Fassign_discount.png?alt=media" alt=""><figcaption></figcaption></figure>

### Add Discount Pricelist for Overstock Product

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-8f0bd24b7150d24a343ac73b3f9e5094c7ba3c4a%2Fet_ex_step3.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This step shows the possibilities of complex B2B pricing updates, in this case adding a discount price of the product to a price list. It uses the Pricing Engine, includes a discount variable, which is used for the price mapping. When the scenario is triggered, it searches for a product and its price. It then adds the discount price to the price list and either ends directly with the `discount_pricelist_created` event, or makes an update of the price in the price list and then ends with the `discount_pricelist_created` event.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-62a334db61c249cbeea7cf3417d42e8fc52f81f1%2Fassign_pricelist.png?alt=media" alt=""><figcaption></figcaption></figure>

### Create Coupon for Preferred Customers

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-eccb65fcfed7b45184a3333c1780fdba9847f575%2Fet_ex_step4.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This step creates a coupon for selected customers. The scenario looks for a Discount category and an order with the specific product ID. The order details include information about the product and the customer who created the order. When the data about the product, customer and order is gathered, the coupon is created. The scenario can end with two possibilities, depending if the coupon had been created in the past or not, it's designed to run multiple times. This scenario example ends either with the `customer_coupon_created` event when a new coupon is created, or `customer_coupon_exists` event when it was checked that the coupon already exists and is valid for the customer.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-2cbff65d31648260471404c2e4d2706252a3c827%2Fcreate_coupon.png?alt=media" alt=""><figcaption></figcaption></figure>

### Create Quote for Customers

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-5605468b383ffa88fc4629d1cb42e1617f98514c%2Fet_ex_step5.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This scenario creates a quote for customers, it first gets the order details and searches for existing quotes based on `productId`, `customerId` and `siteCode`. If there's no existing quote, the scenario creates the quote checking the eligibility of the product. It then changes the quote's status to `open`, which means the quote is ready for the user to approve. The scenario aggregates the data to JSON and the scenario finishes with the `customers_quoted` event.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-54a418518e9f9792400d38179ab9a071da0e97ce%2Fcreate_quote.png?alt=media" alt=""><figcaption></figcaption></figure>

### Add Promotional Image to Product

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-b767b8e4df7560d3724e6fb7058686f1cf701714%2Fet_ex_step6.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This scenario uses the CE Assets API to create a new image of the product with a promotion label. It makes it the primary image of the product.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-046f784b49bd233276aa09b4a39ec9995cf0b4b3%2Fadd_image.png?alt=media" alt=""><figcaption></figcaption></figure>

### Publish the Customized Promotional Banner

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-40c32f5164db24adb534ee94bf1102c21a2d9fe8%2Fet_ex_step7.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

This step is a scenario created for publishing a promotional banner related to the product. When it's triggered, it uses an asset from Contentful that had been designed for promotions for Emporix. If the asset has been already published, then the publishing is ignored. But if the asset has not been published yet, the scenario generates the banner and ends with the `promotional_banners_generated` event.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-ea9e00b31512a542f372c5e90089733d20fc5c4b%2Fadd_banner.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Update Celonis case

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-4bafea15593a6326aa3b7aa2953cbab6e4eb0c0f%2Fet_ex_feedback.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Update Celonis case is the last step of the digital process. It sends process context data to Celonis for further processing. In this example it gets the `productId`, `startStockLevel` and `quotes`.

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-f8cc25b9720bb923cb111ba5f5a14ee99ffa4175%2Ffeedback_module.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1593395737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQHHnOQFqJkmze1kPDN3S%2Fuploads%2Fgit-blob-df6921635dbd3e3d3cb812d7ed946cb131896010%2Flast_step.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
To learn more about the feedback step, see the [Sending Data from OE to Celonis](https://developer.emporix.io/oe/oe-celonis/digital-processes/oe-celonis-data-flow/sending-data-from-oe-to-celonis-celonis) and [Process Context](https://developer.emporix.io/oe/oe-celonis/digital-processes/process-context) documentation.
{% endhint %}
