Skip to main content
For more information about creating activities, see Cretaing a Pega activity.

Pages & Classes

Page nameClass
CaseWork-
AttachmentData-WorkAttach-File
AttachmentInfoData-WorkAttach-File

Parameters

NameData typeRequired
CaseIdStringYes

Local variables

NameData type
LinkedRefToString
IdString
BatchIdString

Steps

Step 1: Method: Obj-Open-By-Handle. Step page: Case. InstanceHandle: Param.CaseId. Step 2: Method: Page-Set-Messages Message: “Please add files to case before proceeding.” When:
Whenif truetrue paramif falsefalse param
AttachmentsIsNullContinue WhensSkip Step
In order to create a condition, specify AttachmentsIsNull in the When field and click the configuration button. If such a condition does not already exist, window will open where you will be able to create a new condition. Make sure that the full name of the case is specified in the Apply to field and click Create and open. On the Conditions tab, create the following condition: length of .pyAttachments is Equal To 0. To add the condition, click Configure advanced conditions here… and select the length of [a pagelist property] Is [comparison operator] [value] for the condition type.
Jump:
Whenif truetrue paramif falsefalse param
trueExit Activity
Step 3: Method: Call-Function
FunctionReturn value
@ABBYY.CreateNewBatch()Local.BatchId
For more information, see CreateNewBatch. Jump:
Whenif truetrue paramif falsefalse param
StepStatusFailJump to Later StepERR
On exception, jump to later step label: ERR. Step 4: Method: Property-Set
PropertiesNamePropertiesValue
Local.LinkedRefToCase.pyAttachments(<CURRENT>).pxLinkedRefTo
Local.IdCase.pyAttachments(<CURRENT>).pzInsKey
Loop:
RepeatValue List Property
For each element in value listCase.pyAttachments
Substep 1: Method: Obj-Open-By-Handle. Step page: Attachment. InstanceHandle: Local.LinkedRefTo. Substep 2: Method: Obj-Open-By-Handle. Step page: AttachmentInfo. InstanceHandle: Local.Id. Substep 3: Method: Call-Function
FunctionReturn value
@ABBYY.AddDocumentToBatch(Local.BatchId, AttachmentInfo.pyMemo, Attachment.pyAttachStream)
For more information, see AddDocumentToBatch. Jump:
Whenif truetrue paramif falsefalse param
StepStatusFailJump to Later StepERR
On exception, jump to later step label: ERR. Step 5: Method: Call-Function
FunctionReturn value
@ABBYY.RunBatchProcessing(Local.BatchId)
For more information, see RunBatchProcessing. Jump:
Whenif truetrue paramif falsefalse param
StepStatusFailJump to Later StepERR
On exception, jump to later step label: ERR. Step 6: Method: Call-Function
FunctionReturn value
@ABBYY.WaitFirstVerificationOrProcessedForMultiFileInvoice(Local.BatchId).VerificationUrl
For more information, see WaitFirstVerificationOrProcessedForMultiFileInvoice. Jump:
Whenif truetrue paramif falsefalse param
StepStatusFailJump to Later StepERRJump to Later StepOK
On exception, jump to later step label: ERR. Step 7: Label: ERR. Method: Page-Set-Messages. Message: @unescapeHTML(@getWorstMessageName(tools)). For more information, see unescapeHTML. Step 8: Label: OK. Method: Property-Set.
PropertiesNamePropertiesValue
.BatchIdLocal.BatchId