Skip to main content
The SendForProcessing activity opens the case, sends the first attachment to ABBYY FlexiCapture, and stores the batch identifier and the verification URL that FlexiCapture returns. For the general procedure, see Create a Pega activity.

Pages and classes

Parameters

Local variables

Activity steps

1

Open the case

Screenshot of step 1 in Pega configured with the Obj-Open-By-Handle method, the Case step page, and an InstanceHandle of Param.CaseId.
2

Reset the attachment counter

Set Method to Property-Set and the property as follows:
Screenshot of step 2 in Pega configured with the Property-Set method, a PropertiesName of Local.Index, and a PropertiesValue of 0.
3

Loop over the case attachments

Set Method to Property-Set and the properties as follows:
Screenshot of step 3 in Pega using the Property-Set method, with Local.LinkedRefTo set to the pxLinkedRefTo of the current Case.pyAttachments element and Local.Id set to its pzInsKey.
Set the Loop properties as follows:
Screenshot of the Loop dialog in Pega for step 3, with Repeat set to For each element in value list and the Value List Property set to Case.pyAttachments.
Add the following When condition, so that only the first attachment is sent:
Screenshot of the When conditions dialog in Pega for step 3, with the condition Local.Index==0 set to Continue Whens if true and Skip Step if false.
Add the following substeps to this step, so that the loop repeats them for each attachment:
  1. Open the attachment
    Screenshot of substep 1 in Pega configured with the Obj-Open-By-Handle method, the Attachment step page, and an InstanceHandle of Local.LinkedRefTo.
  2. Open the attachment information
    Screenshot of substep 2 in Pega configured with the Obj-Open-By-Handle method, the AttachmentInfo step page, and an InstanceHandle of Local.Id.
  3. Send the document to ABBYY FlexiCapture Set Method to Call-Function and the function as follows: For more information, see SendForProcessing. Add the following Jump condition, and set On exception, jump to later step label to ERR:
    Screenshot of substep 3 in Pega using the Call-Function method, with the function @ABBYY.SendForProcessing(AttachmentInfo.pyMemo, Attachment.pyAttachStream) and a return value of .BatchId.
    Screenshot of the Jump conditions for substep 3 in Pega, with a StepStatusFail condition that jumps to later step ERR if true and an on-exception label of ERR.
  4. Wait for the verification URL Set Method to Call-Function and the function as follows: For more information, see WaitFirstVerificationOrProcessed. Add the following Jump condition, and set On exception, jump to later step label to ERR:
    Screenshot of substep 4 in Pega using the Call-Function method, with the function @ABBYY.WaitFirstVerificationOrProcessed(.BatchId) and a return value of .VerificationUrl.
    Screenshot of the Jump conditions for substep 4 in Pega, with a StepStatusFail condition that jumps to later step ERR if true and INC if false, and an on-exception label of ERR.
  5. Post the error message For more information, see unescapeHTML. Add the following Jump condition:
    Screenshot of substep 5 in Pega labeled ERR, using the Page-Set-Messages method with the Message set to @unescapeHTML(@getWorstMessageName(tools)).
    Screenshot of the Jump conditions for substep 5 in Pega, with a When value of true that exits the activity.
  6. Increment the attachment counter Set Label to INC, set Method to Property-Set, and set the property as follows:
    Screenshot of substep 6 in Pega labeled INC, using the Property-Set method with a PropertiesName of Local.Index and a PropertiesValue that increments Local.Index by one.