> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SendForProcessing

> Configurer l’activité Pega SendForProcessing pour un dossier multidocument : créer un lot, ajouter chaque pièce jointe, lancer le traitement et enregistrer le BatchId.

Pour plus d’informations sur la création d’activités, consultez [Création d’une activité Pega](/fr/flexi-capture/connectors/pega/pega-activity-create).

<div id="pages-classes">
  ## Pages et classes
</div>

| **Nom de page** | **Classe**           |
| --------------- | -------------------- |
| dossier         | Work-                |
| Attachment      | Data-WorkAttach-File |
| AttachmentInfo  | Data-WorkAttach-File |

<div id="parameters">
  ## Paramètres
</div>

| **Nom** | **Type de données** | **Obligatoire** |
| ------- | ------------------- | --------------- |
| CaseId  | String              | Oui             |

<div id="local-variables">
  ## Variables locales
</div>

| **Nom**     | **Type de données** |
| ----------- | ------------------- |
| LinkedRefTo | String              |
| Id          | String              |
| BatchId     | String              |

<div id="steps">
  ## Étapes
</div>

Étape 1 :

**Méthode** : Obj-Open-By-Handle.

**Page d’étape** : Dossier.

**InstanceHandle** : Param.CaseId.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega129.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=264503b5f2e968c537e056eb862a4b3d" alt="Capture d’écran de l’étape 1 dans Pega configurée avec la méthode Obj-Open-By-Handle, la Page d’étape Case et un InstanceHandle de Param.CaseId." width="1112" height="330" data-path="images/flexi-capture/connectors/Pega129.png" />
</Frame>

Étape 2 :

**Method**: Page-Set-Messages

**Message** : "Veuillez ajouter des fichiers au dossier avant de continuer."

**When** :

| **When**          | **si la condition est vraie** | **paramètre si vrai** | **si faux**     | **paramètre si faux** |
| ----------------- | ----------------------------- | --------------------- | --------------- | --------------------- |
| AttachmentsIsNull | Conditions de poursuite       |                       | Ignorer l’étape |                       |

<Note>
  Pour créer une condition, spécifiez *AttachmentsIsNull* dans le champ **When**, puis cliquez sur le bouton de configuration. Si une telle condition n’existe pas encore, une fenêtre s’ouvrira dans laquelle vous pourrez créer une nouvelle condition. Assurez-vous que le nom complet du dossier est indiqué dans le champ **Apply to**, puis cliquez sur **Create and open**. Dans l’onglet **Conditions**, créez la condition suivante : *length of .pyAttachments is Equal To 0*. Pour ajouter la condition, cliquez sur **Configure advanced conditions here…** et sélectionnez *length of \[a pagelist property] Is \[comparison operator] \[value]* comme type de condition.
</Note>

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega206.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=832bc4ad8667169ff7d0a47d18a09233" alt="Capture d’écran de la boîte de dialogue Condition dans Pega définissant la condition AttachmentsIsNull comme length of .pyAttachments Is Equal To 0." width="590" height="205" data-path="images/flexi-capture/connectors/Pega206.png" />
</Frame>

**Aller à** :

| **When** | **si la condition est vraie** | **paramètre si vrai** | **si la condition est fausse** | **paramètre si faux** |
| -------- | ----------------------------- | --------------------- | ------------------------------ | --------------------- |
| vrai     | Quitter l’activité            |                       |                                |                       |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega131.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=f6dac5fa332eca91b0d87004b1766f09" alt="Capture d’écran de l’étape 2 dans Pega utilisant la méthode Page-Set-Messages, avec le Message défini sur le texte invitant l’utilisateur à ajouter des fichiers au dossier avant de continuer." width="1124" height="246" data-path="images/flexi-capture/connectors/Pega131.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega132.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=301dc06d8ee79e25f99a08e5ac606abc" alt="Capture d’écran de la boîte de dialogue des conditions When dans Pega pour l’étape 2, avec la condition AttachmentsIsNull définie sur Continue Whens si vrai et Skip Step si faux." width="991" height="229" data-path="images/flexi-capture/connectors/Pega132.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega133.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=05101cb84668bb92da9eef7fb6b16015" alt="Capture d’écran des conditions Jump pour l’étape 2 dans Pega, avec une valeur When de true qui quitte l’activité." width="991" height="282" data-path="images/flexi-capture/connectors/Pega133.png" />
</Frame>

Étape 3 :

**Méthode** : Call-Function

| **Fonction**            | **Valeur de retour** |
| ----------------------- | -------------------- |
| @ABBYY.CreateNewBatch() | Local.BatchId        |

Pour plus d'informations, voir [CreateNewBatch](/fr/flexi-capture/connectors/pega/pega-func-multiple-docs#createnewbatch).

**Aller à** :

| **When**       | **si vrai**                 | **paramètre si vrai** | **si la condition est fausse** | **paramètre si faux** |
| -------------- | --------------------------- | --------------------- | ------------------------------ | --------------------- |
| StepStatusFail | passer à l’étape ultérieure | ERR                   |                                |                       |

**En cas d'exception, passer à l'étiquette d'étape suivante** : ERR.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega134.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=4ff42d9611966705f28822c6b6d83dae" alt="Capture d’écran de l’étape 3 dans Pega utilisant la méthode Call-Function, avec la fonction @ABBYY.CreateNewBatch() et une valeur de retour de Local.BatchId." width="1106" height="242" data-path="images/flexi-capture/connectors/Pega134.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega135.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=4637c13bb148f6c95a76168be96679a0" alt="Capture d’écran des conditions Jump pour l’étape 3 dans Pega, avec une condition StepStatusFail qui passe à l’étape ultérieure ERR si vrai et une étiquette en cas d’exception ERR." width="989" height="279" data-path="images/flexi-capture/connectors/Pega135.png" />
</Frame>

Étape 4 :

**Method**: Property-Set

| **PropertiesName** | **PropertiesValue**                          |
| ------------------ | -------------------------------------------- |
| Local.LinkedRefTo  | Case.pyAttachments(\<CURRENT>).pxLinkedRefTo |
| Local.Id           | Case.pyAttachments(\<CURRENT>).pzInsKey      |

**Boucle** :

| **Répéter**                                | **Propriété de la liste de valeurs** |
| ------------------------------------------ | ------------------------------------ |
| Pour chaque élément de la liste de valeurs | Case.pyAttachments                   |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega136.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=f4a8ca8d62742c7f376f38700cc11698" alt="Capture d’écran de l’étape 4 dans Pega avec la méthode Property-Set, où Local.LinkedRefTo est défini sur le pxLinkedRefTo de l’élément Case.pyAttachments actuel et Local.Id sur son pzInsKey." width="1092" height="236" data-path="images/flexi-capture/connectors/Pega136.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega137.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=e85f94b87589d370222f6a4886ee19a0" alt="Capture d’écran de la boîte de dialogue Loop dans Pega pour l’étape 4, avec Repeat défini sur For each element in value list et la propriété Value List Property définie sur Case.pyAttachments." width="453" height="150" data-path="images/flexi-capture/connectors/Pega137.png" />
</Frame>

Sous-étape 1 :

**Méthode**: Obj-Open-By-Handle.

**Page d’étape**: Attachment.

**InstanceHandle**: Local.LinkedRefTo.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega138.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=3b89f21720558e2ce48925a0bebaf9d1" alt="Capture d’écran de la sous-étape 1 dans Pega, configurée avec la méthode Obj-Open-By-Handle, la page d’étape Attachment et InstanceHandle défini sur Local.LinkedRefTo." width="1066" height="301" data-path="images/flexi-capture/connectors/Pega138.png" />
</Frame>

Sous-étape 2 :

**Méthode**: Obj-Open-By-Handle.

**Page d’étape**: AttachmentInfo.

**InstanceHandle**: Local.Id.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega139.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=95b2eaaf9b38142afbeb68af34949462" alt="Capture d’écran de la sous-étape 2 dans Pega, configurée avec la méthode Obj-Open-By-Handle, la page d’étape AttachmentInfo et InstanceHandle défini sur Local.Id." width="1069" height="299" data-path="images/flexi-capture/connectors/Pega139.png" />
</Frame>

Sous-étape 3 :

**Méthode**: Call-Function

| **Fonction**                                                                               | **Valeur de retour** |
| ------------------------------------------------------------------------------------------ | -------------------- |
| @ABBYY.AddDocumentToBatch(Local.BatchId, AttachmentInfo.pyMemo, Attachment.pyAttachStream) |                      |

Pour plus d’informations, voir [AddDocumentToBatch](/fr/flexi-capture/connectors/pega/pega-func-multiple-docs#adddocumenttobatch).

**Saut**:

| **When**       | **si vrai**                 | **paramètre vrai** | **si faux** | **paramètre faux** |
| -------------- | --------------------------- | ------------------ | ----------- | ------------------ |
| StepStatusFail | passer à l’étape ultérieure | ERR                |             |                    |

**En cas d’exception, passer au libellé d’étape ultérieure**: ERR.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega140.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=72a3fbb25ece8278700433b0732c39fa" alt="Capture d’écran de la sous-étape 3 dans Pega avec la méthode Call-Function, la fonction @ABBYY.AddDocumentToBatch(Local.BatchId, AttachmentInfo.pyMemo, Attachment.pyAttachStream) et aucune valeur de retour." width="1067" height="201" data-path="images/flexi-capture/connectors/Pega140.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega141.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=43fad5c2f66fe2391b73bd83dc5668f9" alt="Capture d’écran des conditions de saut de la sous-étape 3 dans Pega, avec une condition StepStatusFail qui passe à l’étape ultérieure ERR si elle est vraie, et un libellé en cas d’exception défini sur ERR." width="990" height="279" data-path="images/flexi-capture/connectors/Pega141.png" />
</Frame>

Étape 5 :

**Méthode**: Call-Function

| **Fonction**                             | **Valeur de retour** |
| ---------------------------------------- | -------------------- |
| @ABBYY.RunBatchProcessing(Local.BatchId) |                      |

Pour plus d’informations, voir [RunBatchProcessing](/fr/flexi-capture/connectors/pega/pega-func-multiple-docs#runbatchprocessing).

**Saut**:

| **When**       | **si vrai**                 | **paramètre vrai** | **si faux** | **paramètre faux** |
| -------------- | --------------------------- | ------------------ | ----------- | ------------------ |
| StepStatusFail | passer à l’étape ultérieure | ERR                |             |                    |

**En cas d’exception, passer au libellé d’étape ultérieure**: ERR.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega142.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=bfe753784aa3f6d2b6a8f565163a6730" alt="Capture d’écran de l’étape 5 dans Pega avec la méthode Call-Function, la fonction @ABBYY.RunBatchProcessing(Local.BatchId) et aucune valeur de retour." width="1095" height="202" data-path="images/flexi-capture/connectors/Pega142.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega143.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=8f2888d8319a6d80fae266b87a054b60" alt="Capture d’écran des conditions de saut de l’étape 5 dans Pega, avec une condition StepStatusFail qui passe à l’étape ultérieure ERR si elle est vraie, et un libellé en cas d’exception défini sur ERR." width="986" height="276" data-path="images/flexi-capture/connectors/Pega143.png" />
</Frame>

Étape 6 :

**Méthode**: Call-Function

| **Fonction**                                                              | **Valeur de retour** |
| ------------------------------------------------------------------------- | -------------------- |
| @ABBYY.WaitFirstVerificationOrProcessedForMultiFileInvoice(Local.BatchId) | .VerificationUrl     |

Pour plus d’informations, voir [WaitFirstVerificationOrProcessedForMultiFileInvoice](/fr/flexi-capture/connectors/pega/pega-func-multiple-docs#waitfirstverificationorprocessedformultifileinvoice).

**Saut**:

| **When**       | **si vrai**                 | **paramètre true** | **si faux**                 | **paramètre false** |
| -------------- | --------------------------- | ------------------ | --------------------------- | ------------------- |
| StepStatusFail | passer à l’étape ultérieure | ERR                | passer à l’étape ultérieure | OK                  |

**En cas d’exception, passer au libellé de l’étape ultérieure** : ERR.

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega144.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=00819c28fc617143f6ac143019f94d8c" alt="Capture d’écran de l’étape 6 dans Pega utilisant la méthode Call-Function, avec la fonction @ABBYY.WaitFirstVerificationOrProcessedForMultiFileInvoice(Local.BatchId) et une valeur de retour .VerificationUrl." width="1084" height="196" data-path="images/flexi-capture/connectors/Pega144.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega145.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=fcf586e2ab1e6107c3b2888bddc71b36" alt="Capture d’écran des conditions de saut pour l’étape 6 dans Pega, avec une condition StepStatusFail qui passe à l’étape ultérieure ERR si elle est vraie, et à OK si elle est fausse, ainsi qu’un libellé ERR en cas d’exception." width="987" height="276" data-path="images/flexi-capture/connectors/Pega145.png" />
</Frame>

Étape 7 :

**Libellé** : ERR.

**Méthode** : Page-Set-Messages.

**Message** : @unescapeHTML(@getWorstMessageName(tools)).

Pour plus d’informations, voir [unescapeHTML](/fr/flexi-capture/connectors/pega/pega-func-other).

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega146.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=2e3b7ca6205295f551b268fb129a88bf" alt="Capture d’écran de l’étape 7 dans Pega, libellée ERR, utilisant la méthode Page-Set-Messages avec Message défini comme @unescapeHTML(@getWorstMessageName(tools))." width="876" height="187" data-path="images/flexi-capture/connectors/Pega146.png" />
</Frame>

Étape 8 :

**Libellé** : OK.

**Méthode** : Property-Set.

| **PropertiesName** | **PropertiesValue** |
| ------------------ | ------------------- |
| .BatchId           | Local.BatchId       |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega147.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=c7d066f827fc0257c0100de2c2946d1f" alt="Capture d’écran de l’étape 8 dans Pega, libellée OK, utilisant la méthode Property-Set avec PropertiesName défini sur .BatchId et PropertiesValue sur Local.BatchId." width="1101" height="190" data-path="images/flexi-capture/connectors/Pega147.png" />
</Frame>
