Skip to main content
Next, you need to create steps for the CaptureData activity.
  1. On the Steps tab, create a new step and for this step: in the Method field, select Obj-Open-By-Handle; in the Step page field, select Case; and in the InstanceHandle field, type Param.CaseId.
    Screenshot of the first step in Pega configured with the Obj-Open-By-Handle method, the Case step page, and an InstanceHandle of Param.CaseId.
  2. Create a second step and for this step: in the Method field, select Call RemoveFromPageList; in the PageListProperty field, type LineItems; in the Index field, type 1 (i.e. the index of an empty string that Pega creates by default); and in the FinishingActivity field, type "" (i.e. an empty string).
    Screenshot of the second step in Pega configured with the Call RemoveFromPageList method, a PageListProperty of LineItems, an Index of 1, and a FinishingActivity set to an empty string.
  3. Create a third step and for this step: in the Method field, select Property-Set; in the PropertiesName field, select Local.Index; and in the PropertiesValue field, type 0.
    Screenshot of the third step in Pega configured with the Property-Set method, a PropertiesName of Local.Index, and a PropertiesValue of 0.
  4. Create a fourth step that will get file identifiers and information about files. For this step, select Property-Set in the Method field and create the following parameters: Local.LinkedRefTo and Local.Id.
Screenshot of step 4 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.
  1. Add the following loop to step 4: For each element in value list – Case.pyAttachments.
    Screenshot of the Loop dialog in Pega for step 4, with Repeat set to For each element in value list and the Value List Property set to Case.pyAttachments.
  2. Add a When condition to step 4 and set this condition to Local.Index==0. This will cause the activity to process only the first attachment.
Screenshot of the When conditions dialog in Pega for step 4, with the condition Local.Index==0 set to Continue Whens if true and Skip Step if false.
  1. Create six substeps related to step 4 (to create a substep, create a new step and drag into step 4).
    • For the first substep: in the Method field, select Obj-Open-By-Handle; in the Step page field, select Attachment; and in the InstanceHandle field, type Local.LinkedRefTo.
      Screenshot of the first substep in Pega configured with the Obj-Open-By-Handle method, the Attachment step page, and an InstanceHandle of Local.LinkedRefTo.
  • For the second substep: in the Method field, select Obj-Open-By-Handle; in the Step page field, select AttachmentInfo; and in the InstanceHandle field, type Local.Id.
    Screenshot of the second substep in Pega configured with the Obj-Open-By-Handle method, the AttachmentInfo step page, and an InstanceHandle of Local.Id.
  • For the third substep, select Property-Set in the Method field and create the following parameter for this method: Param.jsonData – @FlexiCaptureLlibrary.CaptureData(AttachmentInfo.pyMemo, Attachment.pyAttachStream) (after the ”@” character, specify the name of the library described in the Installation section; after the dot, specify the name of the function). Additionally, create a parameter named Param.executionMode – DESERIALIZE.
    Screenshot of the third substep in Pega configured with the Property-Set method, a Param.jsonData parameter set to @FlexiCaptureLibrary.CaptureData(AttachmentInfo.pyMemo, Attachment.pyAttachStream), and a Param.executionMode parameter set to DESERIALIZE.
Next, click the Jump button and add a StepStatusFail parameter for error handling.
Screenshot of the Jump conditions for the third substep in Pega, with a StepStatusFail condition that jumps to later step ERR if true and OK if false, and an on-exception label of ERR.
Click Submit.
  • For the fourth substep, select Page-Set-Messages in the Method field and specify the following parameter for this method: Message – @getWorstMessageName(tools). Mark this substep as ERR. Next, you need to prevent the activity from performing any subsequent steps if an error occurs. To do this, click the Jump button and add the following parameters:
Screenshot of the Jump conditions for the fourth substep in Pega, with a When value of true that jumps to later step INC for both the if true and if false branches.
  • For the fifth substep select Apply-DataTransform in the Method field and specify the following parameter for this method: DataTransform – JsonToInvoiceFields. Mark this substep as OK and select the PassParameterPage option.
    Screenshot of the fifth substep in Pega configured with the Apply-DataTransform method, the JsonToInvoiceFields data transform, the PassParameterPage option enabled, and labeled OK.
  • For the sixth substep, select Property-Set in the Method field, create a Local.Index parameter for this method, and set this parameter to Local.Index+ 1. Mark this substep as INC.
Screenshot of the sixth substep in Pega configured with the Property-Set method, a Local.Index parameter set to Local.Index+ 1, and labeled INC.
At this point, your list of steps and substeps should look as follows:
Screenshot of the Steps tab in Pega showing the completed CaptureData activity: four top-level steps (Obj-Open-By-Handle, Call RemoveFromPageList, Property-Set, Property-Set) with six substeps under step 4 labeled ERR, OK, and INC.
  1. Click Save.
  2. Open the properties of the Utility item, select CaptureData in the Rule field, and set the CaseId parameter to .pzInsKey.
    Screenshot of the Utility item properties in Pega, with CaptureData selected in the Rule field and the CaseId parameter set to .pzInsKey.
  3. Save your changes.