Use case: Process inbound file attachments for storage in a repository
You are running an insurance claim case for a car insurance company. You send a
payment request of $1,500 in a PDF file to the insurance carrier of the driver who hit the
car that belongs to your client. The insurance carrier adds a revised payment amount and
returns the PDF file renamed: InsurancePaymentRequest-Disputed.pdf
.
Your company stores payment disputes in a PaymentRecords repository in a folder named Disputes.
The following sections describes the components of the configuration that your application needs to process the incoming PDF file and store it in the PaymentRecords repository.
REST service
The REST service passes parameter values to the service activity. In this case, the REST service passes the repository name (PaymentRecords) and the folder name (Disputes) to the ProcessPaymentDisputes service activity.For more information, see Service REST rules.
ProcessPaymentDisputes service activity
The ProcessPaymentDisputes service activity explains how to
process the InsurancePaymentRequest-Disputed.pdf
file and write
it to the PaymentRecords repository. In the first step of this
service activity, use the
@PageExists("pyRequestAttachmentPage") utility function in
a step precondition to check that the pyRequestAttachmentPage
appears on the clipboard.
After you confirm that the pyRequestAttachmentPage exists, you call the WriteToRepository activity from the ProcessPaymentDisputes activity.
For more information, see Creating an activity.
WriteToRepository activity
When you call the WriteToRepository activity, it performs the following actions:
- Iterates over the values in the .pyAttachValues value
list property on the pyRequestAttachmentPage.
For more information, see Repeating steps in an activity.
- Composes the file path parameter value by retrieving the name of the
attachment,
InsurancePaymentRequest-Disputed.pdf
, and applying it to the folder name (Disputes). The folder name is passed into the activity as a parameter. See the following syntax as an example:- PropertiesName:
param.filePath
- PropertiesValue:
param.folderName+”/” + .pyAttachNames(<CURRENT>)
- PropertiesName:
- Copies the contents of the
InsurancePaymentRequest-Disputed.pdf
file to theD_pxNewFile data page by using the following syntax:- PropertiesName:
D_pxNewFile.pyContents
- PropertiesValue:
.pyAttachValues(<CURRENT>)
- PropertiesName:
D_pxNewFile
The D_pxNewFile data page writes the file content from the
InsurancePaymentRequest-Disputed.pdf
file to the
PaymentRecords repository by passing in the following
parameters: repositoryName and
filePath.
Use the Save-DataPage method to save the file to the repository.
For more information, see Get file API.
Previous: This use case is a continuation of the outbound use case. For more information, see Use case: Send file attachments from a repository |
Previous topic Use case: Send file attachments from a repository Next topic Creating a SOAP integration