Skip to main content
The CaptureData activity needs four main steps on the Steps tab, plus six substeps that do the processing.

Create the main steps

1

Open the case

Create a new step and set the following fields:
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

Remove the default empty list entry

Create a second step and set the following fields:
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

Initialize the index

Create a third step and set the following fields:
Screenshot of the third step in Pega configured with the Property-Set method, a PropertiesName of Local.Index, and a PropertiesValue of 0.
4

Get the file identifiers and file information

Create a fourth step, select Property-Set in the Method field, and create the Local.LinkedRefTo and Local.Id parameters:
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.

Add a loop and a condition to the fourth step

Add a loop to the fourth step. Set Repeat to For each element in value list and the Value List Property to 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.
Then add a When condition to the same step so that the activity processes 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.

Create the six substeps

Create six substeps related to the fourth step. To create a substep, create a new step and drag it into the fourth step.
1

Open the attachment

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.
2

Open the attachment information

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.
3

Call the connector function

Select Property-Set in the Method field and create the following parameters:After the @ character, specify the name of the library, and after the dot, specify the name of the function. For both, see Create a Java function in Pega.
Screenshot of the third substep in Pega configured with the Property-Set method, a Param.jsonData parameter set to the FlexiCaptureLibrary CaptureData function, and a Param.executionMode parameter set to DESERIALIZE.
Then click Jump and add a StepStatusFail parameter for error handling:Click Submit.
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.
4

Handle the error messages

Select Page-Set-Messages in the Method field, set the Message parameter to @getWorstMessageName(tools), and mark this substep as ERR.To stop the activity performing any subsequent steps when an error occurs, click Jump 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.
5

Apply the Data Transform

Select Apply-DataTransform in the Method field and set the DataTransform parameter to 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.
6

Increment the index

Select Property-Set in the Method field, create a Local.Index parameter, and set it 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 plus 1, and labeled INC.
Your list of steps and substeps should now 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.

Finish the activity

1

Save the activity

Click Save.
2

Point the Utility item at the activity

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

Save your changes.