Genpact Cora Knowledge Center

Support

APFlow Adaptor Configuration

Overview

The apflow.yaml configuration file maps and translates the data from the system JSON file to the external XML file.

Template

kind: document 
metadata: 
  name: extraction/v1/documents/apflow-mapping 
spec: 
  rootType: "SomeFineRootNode" 
  types: 
    - name: "SomeFineRootNode" 
      fields: 
        - source: "Case_Id" 
          target: "Case_Id" 
 
        - source: "Creation_Date" 
          target: "Date" 
          format: "MM/dd/yyyy HH:mm:ss" 

        - source: "TotalTax" 
          target: "OCR_Tax_Amount" 
          format: "F2" 

        - source: "otherCharges"
          target: "OCR_Other_charges"
          format: "F2"
          
        - source: "InvoiceLineItem" 
          target: "OCR_Line_Items" 
          typeName: "OCR_Line_Item" 

    - name: "OCR_Line_Item" 
      fields: 
        
        - source: "Amount" 
          target: "OCR_Amount_Ext_Vc_Amt" 

        - source: "ProductCode" 
          target: "OCR_Product_Serv_No" 
Parameter Description
Source The field in the JSON which will be mapped to the external XML.
The source field should be equal to the definition in the extraction-model.yaml.
Target The field in the external XML where value is mapped from the JSON. You can change the target name per your choice.
Format The format of the field.
For example:
  • For a date field, the format is MM/dd/yyyy HH:mm:ss.
  • For a currency field, the format is F2.
typeName The fields for line items.

In the above template:

- source: "Creation_Date
  target: "Date"
  format: "MM/dd/yyyy HH:mm:ss"

The Creation_Date in the source parameter is the field from the JSON that will be mapped, the Date field in the target parameter is the XML field. The format of the field will be MM/dd/yyyy HH:mm:ss. 

The user can choose any name for the target XML field.
For example, if we change the target parameter to New_CreationDate:

- source: "Creation_Date" 
  target: "New_CreationDate" 
  format: "MM/dd/yyyy HH:mm:ss"

then the field will appear as New_CreationDate in the XML.