# Order Intake - Forms

The Order Intake value stream with forms automates purchase orders submitted through PDF documents. The process extracts order intent and order details from submitted inputs, validates the extracted data against predefined business rules, and creates only validated orders. It routes orders with missing or inconsistent data to users, providing full context for correction. When items are invalid or unavailable, the system uses AI capabilities to suggest alternatives.

This template uses approval forms as part of the decision flow.

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-ef92778b2defc51b29093cb300194dd566d1e3bf%2Forder_intake_forms.png?alt=media" alt="Process loop with validation of customer, product and price data"><figcaption><p>Process loop with validation of customer, product and price data</p></figcaption></figure>

## Process template flow

The process starts when order data is received by email and transformed into a normalized structure. The system validates customer, product, and pricing data in sequence, then branches based on the validation results. If all required conditions are met, an approval form is generated and sent to designated users. After approval, the order is created in Emporix and synchronized with downstream ERP systems - the setup for this is always project specific.

Each step in the flow has explicit events, conditions, and outcomes so that the process can run automatically for standard cases and route only exceptions for manual action.

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-eb7c13997d6cef074a4fbce849841e611235851e%2Forder_intake_loop.png?alt=media" alt="Order Intake value stream with forms approval"><figcaption><p>Order Intake value stream with forms approval</p></figcaption></figure>

## Process trigger

The process starts when a `New Order Data` event is received, this comes from an incoming email with a Purchase Order attachment. The attachment should contain sufficient company and customer data, and the payload should be transformable to the target order model. As a result, the process produces a normalized order payload and passes it to the validation loop.

## Retrieving approvers

In this example, the process retrieves users from the CE Manager group to identify order approval recipients, required later during the process.

This step requires that the CE Manager group exists and that at least one user is available to receive notifications. When these conditions are met, the process prepares the approval recipient list for the later form-based approval step.

## Validation loop

The validation loop checks customer, product, and pricing data, and raises completion events after each stage. It then evaluates predefined conditions to determine the next actions required to complete the order.

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-9d709df28832412d6530688f93ca8d696e792e44%2Forder_intake_loop_step.png?alt=media" alt="Order Intake loop"><figcaption><p>Order Intake loop</p></figcaption></figure>

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-eb7c13997d6cef074a4fbce849841e611235851e%2Forder_intake_loop.png?alt=media" alt="Order Intake loop - expanded"><figcaption><p>Order Intake loop - expanded</p></figcaption></figure>

### Customer, product and price validations

When the order is placed, it should include customer, shipping and billing addresses, product and price data for all the ordered items.

First, the process validates the customer using the identifiers available in the payload. If no customer data is present, validation cannot continue and the customer remains unvalidated. If a customer ID is provided, validation runs by the ID first, and if the ID check fails, the process retries validation by email.

Then, the process validates each ordered product and checks availability. For each line item, the process checks whether the product exists in the catalog and whether it is available for ordering. Based on this evaluation, the items are grouped into products that are available, not found, or out of stock. If products are identified but are out of stock, the process searches for alternative products and generates suggestions. The document can then be reviewed and updated in the Order Intake Form.

The next step is the validation of price availability for each product. This check requires a valid price for each product in scope. If a price is missing for any item, the process still completes the step but marks the product-level pricing status accordingly.

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-746597bc8f71b55d306627a2380ae0050441a028%2Forder_intake_validation_loop.png?alt=media" alt="Process loop with validation of customer, product and price data"><figcaption><p>Process loop with validation of customer, product and price data</p></figcaption></figure>

### Conditional routing within the loop

Within the processing loop, conditional logic is applied to evaluate extracted data and determine the appropriate execution path. Based on predefined conditions, the process follows one of several outcomes to ensure that all required information is available and aligned with system requirements.

Customer-related conditions are evaluated first. If a matching customer is identified, the corresponding master data is loaded and the appropriate legal entity is assigned. If no match is found, the process attempts to create a new customer record using the available data. When sufficient customer information (such as address details) is provided, the creation is performed automatically; otherwise, the process requires manual input to complete the customer setup.

Product-related conditions are handled in a similar way. If products are successfully identified, relevant product data is prepared for further processing. If no matching products are found, alternative products can be suggested.

These conditional steps ensure that incomplete or unmatched data is handled appropriately while allowing valid cases to proceed without interruption.

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-fe33465de3e03858c9e2dfb309f7d6a6e0ccc60a%2Forder_intake_conditions.png?alt=media" alt="Conditional step in the loop with five paths"><figcaption><p>Conditional step in the loop with five paths</p></figcaption></figure>

The available paths are defined through configurable conditions based on variables, operators, and values, allowing the process behavior to be adapted to specific business requirements.

<figure><img src="https://1024162941-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrSc4haeKWrTrOPHzdrMO%2Fuploads%2Fgit-blob-f7abced65b732a2616ee290c00b8cb52527441b6%2Forder_intake_conditions_paths.png?alt=media" alt="Conditional step paths variables"><figcaption><p>Conditional step paths variables</p></figcaption></figure>

{% hint style="info" %}
For step filters, conditional steps, and looping in value streams, see [Conditions](https://developer.emporix.io/value-stream-modeller/value-stream-designer/process-components/conditions).
{% endhint %}

### Order confirmation and approval loop

Once all required validation conditions are met, the process proceeds with price confirmation. A successful evaluation across customer, product, and pricing conditions results in a price match for the order.

The next step is the generation of an order form for review and approval. The form includes a consolidated summary of the extracted and validated data, such as customer details, identified products, and quantities. For any products that could not be matched, the form also provides suggested alternatives. The form is created automatically, and a link to it is sent by email to the designated approval group.

After the form is sent, the process enters a waiting state. At this stage, a mid trigger event - Order Form Submitted - is used to pause execution until a response is received. The process resumes once the submitted form is returned.

The final step is the validation of the submitted form. Whenever the approval form is submitted or edited, the process validates the submitted content again. If all items are confirmed and validation succeeds, the order is approved and processing continues. If validation still finds missing, inconsistent, or incorrect data, the process re-enters the loop to resolve outstanding issues and repeat the validation and approval steps.

## Order creation in Emporix

Once all validation and approval steps within the loop are completed, the process proceeds with order creation in Emporix.

This step requires a received approval and complete customer, product, and pricing data. When these conditions are met, a cart is created in the background and converted into an order using the finalized payload.

## Order intake upsert

Upserting order intake means creating a new order-intake record when none exists, or updating an existing record when a matching identifier is found.

This ensures that the latest order information is consistently stored and synchronized without creating duplicate entries. The process checks for an existing order reference and applies the appropriate action (insert or update) accordingly.

## SAP order integration

After the order is created in Emporix, the data can be synchronized with the SAP ERP system. Depending on the integration setup, the process either creates a corresponding order in SAP. This ensures consistency between systems and allows the order to be managed and processed within the ERP system.

{% hint style="info" %}
Order Intake implementations must be tailored to each project, with the goal of reducing manual effort, accelerating processing, and ensuring that incoming order data remains consistent and reliable.
{% endhint %}
