# 10.5 Create a business event journey

Login to Adobe Journey Optimizer by going to [Adobe Experience Cloud](https://experience.adobe.com). Click **Journey Optimizer**.

![ACOP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8daf9419deef804f9e816efc694a6fe4c6bef3fa%2Facophome.png?alt=media)

You'll be redirected to the **Home** view in Journey Optimizer. First, make sure you're using the correct sandbox. The sandbox to use is called `--aepSandboxId--`. To change from one sandbox to another, click on **PRODUCTION Prod (VA7)** and select the sandbox from the list. In this example, the sandbox is named **AEP Enablement FY22**. You'll then be in the **Home** view of your sandbox `--aepSandboxId--`.

![ACOP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-df76386e3eebdceeccee0f3853f02cdec4b997f1%2Facoptriglp.png?alt=media)

## 10.5.1 Create a business event

In the left menu, click **Configurations**. Click on the **Manage** button inside the **Events** card.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d5683ec620659ae78516d5a0cddb9491523f84a7%2Fbe1.png?alt=media)

Business events are a new type of event you can create inside Journey Optimizer. Unlike the **Unitary** events that you have created in previous modules, the business events are not triggered by the customer but by the organization. You'll now create your business event.

Click **Create Event**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-a951bee116242d11486893b80371a46fe1b4f2c0%2Fbe2.png?alt=media)

Enter the following values in the Event creation form:

* **Name**: `--demoProfileLdap--ItemBackInStock`. For instance: **vangeluwItemBackInStock**
* **Description**: This event is triggered when a product is back in stock
* **Type**: select **Business** in the drop down

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-20fee61a5400ab0b4e67cc9441e0e613c80c0953%2Fevde.png?alt=media)

For the Schema, select **Demo System - Event Schema for JO Business Events (Global v1.1) v.1**. You now need to select the fields in the schema that you require for our use case.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-33c07a7f83054f52a7e85cbc8b81d5fe99b7761e%2Fevdes.png?alt=media)

Follow these steps:

Click the **pencil** icon on the field where it says **1 field selected**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ec8d769b699da9614c9b36cb8f7d428daaa3a36e%2F23.8-4.png?alt=media)

Select all available fields in the schema, then click **OK**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fef254e3c24b49c75155af94fb3b5ba4e3e609a3%2F23.8-5.png?alt=media)

For the condition: you need to specify which records in this schema will be triggering the business event.

Follow these steps:

Click the **pencil** icon on the field where it says **Add a condition**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-18adb35951ecc6ff7879b7ca593af4ec416aacc6%2F23.8-6.png?alt=media)

On the left-hand side, expand the `--aepTenantId--` object, expand the object **joBusinessEvents** and drag and drop the field **eventName** onto the canvas.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-21ec0daa737c19a6d8b5477732d27b35546121df%2F23.8-7.png?alt=media)

For the field **eventName**, enter the following value: `--demoProfileLdap--ItemBackInStock`. For instance: vangeluwItemBackInStock. Click **OK**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-cf684e97eb1e6d403176254c081f3ab61ed764a3%2F23.8-8.png?alt=media)

Click **OK**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-200b63866bdd6ab9dad09db51a319e990d2ea2ad%2F23.8-9.png?alt=media)

Finally your event creation form should look like this. Click **Save** to save your business event.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-4f3e2c654b0a4ecf4678bf74ba1347a83ef4d9ff%2F23.8-10.png?alt=media)

## 10.5.2 Create a business event journey

You can now leverage this business event and the message inside a journey. Go to **Journeys**. Click **Create Journey**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fc0d7ae756b74298034b84a28c4fff736bb9a7e1%2Fbej10.png?alt=media)

On the right-hand side you will see a form where you need to specify the journey name and description. Enter the following values:

* **Name**: `--demoProfileLdap-- - Item back in stock journey`. For instance: vangeluw - Item back in stock journey
* **Description**: This journey sends an SMS when an item is back in stock to visitor who have shown an interest.

Click **OK**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-52c165b2c4531cc0cd84bdbace1738527e6265ff%2Fbej11.png?alt=media)

In the left menu, under **Events**, search for your ldap. You'll find the previously created business event `--demoProfileLdap--ItemBackInStock`. Drag and drop this event onto the canvas as this will be the starting point of the journey.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-20ee2e7fd65587016894a34a9841575be7f6695d%2Fbej12.png?alt=media)

As you can see, a **Read Segment** activity has automatically been added to the canvas. This is because the business events only send a trigger for the journey to read a specific segment, which will then retrieve the list of profiles for that journey.

Click the **Read Segment** activity. The **Read Segment** configuration expects you to select the segment that you want to notify of the business event that just happened. Click the **Select a segment** field.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-003772a70e3be91a3527f38c3c586df67d1e409e%2Fbej13.png?alt=media)

In the **Choose a segment** popup, search for your ldap and select the segment you created in [Module 6 - Real-time CDP - Build a segment and take action](https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module6) named `--demoProfileLdap-- - Interest in PROTEUS FITNESS JACKSHIRT`. for example: vangeluw - Interest in PROTEUS FITNESS JACKSHIRT. Click **Save**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8ecbcce0b4b606dbf2c1cf52e638f6704679d172%2Fbej14.png?alt=media)

Next, click **Ok**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ac33556aae19794f63abd24e4da60bb71ffada0a%2Fbej15.png?alt=media)

The next step is to drag and drop the action that we want to perform in this journey. Select the action **SMS**, then drag and drop it after the condition you just added.

![Demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-89b6a0703c2f6f3b9ca3e977ad04ca0a11deeace%2Fjop9.png?alt=media)

Set the **Category** to **Marketing** and select a sms surface that enables you to send sms. In this case, the email surface to select is **SMS**.

![ACOP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0d795482bbb832b13530fe21ca738a020f4288cc%2Fjourneyactions1x.png?alt=media)

The next step is to create your message. To do that, click **Edit content**.

![ACOP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-adab88d839392f8e6a52cbf0884330cf853a9d5a%2Fjourneyactions2x.png?alt=media)

You'll now see the message dashboard, where you can configure the text of your SMS. Click the **Compose message** area to create your message.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5ab720221f76bd8d9687443548370163fb4158fc%2Fsms3.png?alt=media)

Enter the following text: `Hi {{profile.person.name.firstName}}, the Proteus Fitness Jackshirt is back in stock at Luma.`. Click **Save**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-aa812aba8e59e41af19ba2d27984e29bde93993b%2Fsms4.png?alt=media)

Go back to the message dashboard by clicking the **arrow** next to the subject line text in the top-left corner.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-eda8b641d61585cb709ceeab9671d9ff1e5ecd17%2Foc79xx.png?alt=media)

You'll now see your completed SMS action. Click **Ok**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-67c445540b592905295e3051e7aca04e430c1002%2Foc79xxy.png?alt=media)

Your journey is now ready to be published. Click **Publish**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-29129d48d6440b373c218a9a03458f7a1973ce40%2Fjop13.png?alt=media)

Click **Publish** again.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-49bf6f524141a604f262c1412673418f6ee2ddd1%2Fjop14.png?alt=media)

Your journey is now published, you can now test it!

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f9534d2e57721bc19022964f58bc235e7f5b9b1b%2Fjop15.png?alt=media)

## 10.5.3 Test your business event journey

You'll now simulate the re-stock of a product by ingesting a new event against the **Demo System - Event Schema for JO Business Events (Global v1.1) v.1** using Postman.

In the left menu, click **Sources** and then click on the **Accounts** tab.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b8f0c8b17c6ee5ca8c8fda52ea758c0efc876c9a%2Fs1.png?alt=media)

On the **Accounts** tab, you'll find the account named **Journey Optimizer Business Events**. Click it to open it.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-aab5954b90c1b214ff8e616ae5c0d22c411564d4%2Fs2.png?alt=media)

This account only has one dataflow, click on the dataflow name to select it.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b665ed2e2db96e63ea68ac4ca840e8cd27b049ec%2Fs3.png?alt=media)

Click **Copy schema payload** in the right menu. This option copies the entire **curl** command to insert a record against the **Demo System - Event Schema for JO Business Events (Global v1.1) v.1** to your clipboard.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6145bb18642f0276bd302ec63fee80a278aa64dc%2Fs4.png?alt=media)

Paste the Curl command inside a text editor

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-57f8e7f575a8058629d73375f58f10a98aeb0a8f%2Fs5.png?alt=media)

Let's have a closer look to this request,

* The POST request is sent to the DCS Inlet ID
* The request references the schema, the dataset and the Organization ID.
* Finally it contains the xdmEntity node which represents the data that we want to create inside the dataset.

You now need to replace the following `xdmEntity` line...

```json
"xdmEntity": {
  "_experienceplatform": {
    "joBusinessEvents": {
      "eventDescription": "string",
      "eventName": "string",
      "stockEventId": "string"
    }
  },
  "_id": "/uri-reference",
  "eventType": "advertising.completes",
  "timestamp": "2018-11-12T20:20:39+00:00"
}
```

...by this line, make sure to verify the field eventName as it should say `--demoProfileLdap--ItemBackInStock`, which represents the condition you have specified in your business event to trigger your journey.

```json
"xdmEntity": {
  "_experienceplatform": {
    "joBusinessEvents": {
      "eventDescription": "Product Proteus Fitness Jackshirt is back in stock",
      "eventName": "--demoProfileLdap--ItemBackInStock",
      "stockEventId": "1"
    }
  },
  "_id": "/uri-reference",
  "eventType": "productBackInStock",
  "timestamp": "2021-04-19T15:25:39+00:00"
}
```

The updated **curl** command should look like this:

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5ec15e4c12cb031bf15f73f2ec41547e9093d618%2Fs6.png?alt=media)

Select all of it and copy it to your clipboard.

Open Postman. On the left-hand side of Postman, click **Import**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-4c59cf78330ff07eefa4260519b3b5730d58ed81%2F23.8-46.png?alt=media)

Select the **Raw text** tab and paste the command previously copied here. Click **Continue**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-2383b0778691a8c13890326e8e0b8a885337bd12%2Fs7.png?alt=media)

Click **Import**.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-09ea791d1aab5e668fbdc27e369e3e511db8d86a%2F23.8-50.png?alt=media)

Postman has automatically converted the **curl** command into a REST command ready to be triggered, simply press the **Send** button to request the creation of that record inside the dataset.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5dd2a24c81003ac77498d44028aea7b03f710136%2F23.8-51.png?alt=media)

Verify that your request has been successfully received. Look for a **200 OK** status in postman.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-021a35e6f2b1d2c6ec22898f59dd2e916af1e5b4%2Fs8.png?alt=media)

The SMS may take a couple of minutes to arrive on your mobile phone. If it does not, your **Interest in Proteus Fitness Jackshirt** segment may not contain a profile with a correct mobile phone. If so, go on the Luma website, visit the **Proteus Fitness Jackshirt** product and register while making sure you provide the correct mobile phone number.

![Journey Optimizer](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-914983914fc085ab380323f5e1b7e5e696c1bdf6%2Fs9.png?alt=media)

You have now finished this exercise.
