# Scenarios

**Scenario** is the **main setting** for Document Reader SDK. It controls all scanning process of [Core](https://regulaforensics.gitbook.io/android/5.3-4/core) framework. Depending on the selected scenario, Core works in different ways. The set of available scenarios is different for each Core type. The following part of code allows to get all available scenarios (should be used [**after initialization**](https://regulaforensics.gitbook.io/android/5.3-4/initialization) is completed):

{% tabs %}
{% tab title="Java" %}

```java
// getting current processing scenario
String currentScenario = DocumentReader.Instance().processParams().scenario;

// list of available scenarios
ArrayList<String> scenarios = new ArrayList<>();
for(DocumentReaderScenario scenario : DocumentReader.Instance().availableScenarios){
    scenarios.add(scenario.name);
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// getting current processing scenario
var currentScenario: String? = DocumentReader.Instance().processParams().scenario

// list of available scenarios
val scenarios = ArrayList<String>()
for (scenario in DocumentReader.Instance().availableScenarios) {
    scenarios.add(scenario.name)
}
```

{% endtab %}
{% endtabs %}

`DocumentReaderScenario` class contains two main properties:

* **name** - name of a scenario, use this value to set scenario for Document Reader SDK.
* **description** - brief description of the scenario functionality and usage.

[**After initialization**](https://regulaforensics.gitbook.io/android/5.3-4/initialization) is completed, the processing [scenario](https://regulaforensics.gitbook.io/android/5.3-4/scenarios) should be set, like so:

{% tabs %}
{% tab title="Java" %}

```java
// set the scenario value
DocumentReader.Instance().processParams().scenario = Scenario.SCENARIO_MRZ;
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// set the scenario value
DocumentReader.Instance().processParams().scenario = Scenario.SCENARIO_MRZ
```

{% endtab %}
{% endtabs %}

Comparison table of available scenarios vs results is below:

| Scenario name                   | Multiple pages processing | Document location | MRZ OCR | Barcode data | Document type | Visual zone OCR | Graphic fields | Credit card data | Free OCR |
| ------------------------------- | :-----------------------: | :---------------: | :-----: | :----------: | :-----------: | :-------------: | :------------: | :--------------: | :------: |
| **Locate**                      |             A             |         X         |         |              |               |                 |                |                  |          |
| **Mrz**                         |                           |                   |    X    |              |               |                 |                |                  |          |
| **MrzOrLocate**                 |                           |         O         |    O    |              |               |                 |                |                  |          |
| **MrzAndLocate**                |             A             |         X         |    X    |              |               |                 |                |                  |          |
| **Barcode**                     |                           |                   |         |       X      |               |                 |                |                  |          |
| **MrzOrBarcode**                |                           |                   |    O    |       O      |               |                 |                |                  |          |
| **MrzOrOcr**                    |             A             |         O         |    O    |              |       O       |        O        |        O       |                  |          |
| **MrzOrBarcodeOrOcr**           |                           |         O         |    O    |       O      |       O       |        O        |        O       |                  |          |
| **LocateVisual\_And\_MrzOrOcr** |             A             |         X         |    O    |              |       O       |        O        |        O       |                  |          |
| **DocType**                     |             A             |         O         |    O    |              |       X       |                 |        O       |                  |          |
| **Ocr**                         |             A             |         X         |    O    |              |       X       |        X        |        O       |                  |          |
| **FullProcess**                 |             A             |         X         |    O    |       O      |       X       |        O        |        X       |                  |          |
| **Id3Rus**                      |                           |         O         |    O    |              |       O       |        O        |        O       |                  |          |
| **Capture**                     |                           |                   |         |              |               |                 |        X       |                  |          |
| **CreditCard**                  |             A             |         X         |         |              |               |                 |                |         X        |          |
| **OcrFree**                     |                           |                   |         |              |               |                 |                |                  |     X    |
| **RusStamp**                    |                           |                   |         |              |               |        X        |                |                  |          |

**A** - the option is available for this scenario.

**Empty** - the result type is not included in processing list and won't be available

**O** - the result type is not mandatory to reach COMPLETED state. Might be available, when processing is finished.

**X** - the result type is mandatory to reach COMPLETED state and will always be available when processing is finished.

Comparison table of available scenarios vs Cores is below:

| Core name          | MrzOrBarcodeOrOcr | FullProcess | CreditCard | Mrz | Barcode | Locate | Ocr | DocType | MrzOrBarcode | MrzOrLocate | MrzAndLocate | MrzOrOcr | LocateVisual\_And\_MrzOrOcr | Id3Rus | OcrFree | RusStamp | Capture |
| ------------------ | :---------------: | :---------: | :--------: | :-: | :-----: | :----: | :-: | :-----: | :----------: | :---------: | :----------: | :------: | :-------------------------: | :----: | :-----: | :------: | :-----: |
| **bounds**         |                   |             |            |     |         |    X   |     |         |              |             |              |          |                             |        |         |          |    X    |
| **mrz**            |                   |             |            |  X  |         |    X   |     |         |              |      X      |       X      |          |                             |        |         |          |    X    |
| **mrzrfid**        |                   |             |            |  X  |         |    X   |     |         |              |      X      |       X      |          |                             |        |         |          |    X    |
| **barcode**        |                   |             |            |     |    X    |        |     |         |              |             |              |          |                             |        |         |          |    X    |
| **barcodemrz**     |                   |             |            |  X  |    X    |    X   |     |         |       X      |      X      |       X      |          |                             |        |         |          |    X    |
| **barcodemrzrfid** |                   |             |            |  X  |    X    |    X   |     |         |       X      |      X      |       X      |          |                             |        |         |          |    X    |
| **doctype**        |                   |             |            |  X  |         |    X   |     |    X    |              |      X      |       X      |          |                             |        |         |          |    X    |
| **ocrandmrz**      |                   |             |      X     |  X  |         |    X   |  X  |    X    |              |      X      |       X      |     X    |              X              |    X   |    X    |     X    |    X    |
| **ocrandmrzrfid**  |                   |             |      X     |  X  |         |    X   |  X  |    X    |              |      X      |       X      |     X    |              X              |    X   |    X    |     X    |    X    |
| **full**           |         X         |      X      |      X     |  X  |    X    |    X   |  X  |    X    |       X      |      X      |       X      |     X    |              X              |    X   |    X    |     X    |    X    |
| **fullrfid**       |         X         |      X      |      X     |  X  |    X    |    X   |  X  |    X    |       X      |      X      |       X      |     X    |              X              |    X   |    X    |     X    |    X    |

{% hint style="info" %}
The list of returned scenarios is also restricted by a license.
{% endhint %}
