Interface DatamartContext.DataLoader

  • Enclosing interface:
    DatamartContext

    public static interface DatamartContext.DataLoader
    API for loading data into a DMDataFeed or DMTable from a formula context. Safe to use outside of a PA DataLoad context.

    Example:

         def ctx = api.getDatamartContext()
         def df = ctx.getDataFeed("Contract_Log")
         def loader = ctx.newDataLoader(df, "ApprovalDate", "ApprovalUser",...)
         loader.addRow(approvalDate, approvalUser, ...)
     
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addRow​(Object... values)
      Adds a row to the data buffer that will ultimately be loaded in the feed table.
      void addRow​(List<Object> rowAsList)
      Adds a row to the data buffer that will ultimately be loaded in the feed table.
      void addRow​(Map<String,​Object> rowAsMap)
      Adds a row to the data buffer that will ultimately be loaded in the feed table.
      void flush()
      Flushes the data to the DB.
      void setMapping​(Map<String,​String> mapping)
      When calling addRow(Map), maps the value for the given source fields to the corresponding target fields (the latter being the fields in the target FC being populated).
    • Method Detail

      • addRow

        void addRow​(Map<String,​Object> rowAsMap)
        Adds a row to the data buffer that will ultimately be loaded in the feed table.
        Parameters:
        rowAsMap - Row to add in a map of (field,value) pairs format.
      • addRow

        void addRow​(List<Object> rowAsList)
        Adds a row to the data buffer that will ultimately be loaded in the feed table.
        Parameters:
        rowAsList - Row to add as a list of values matching the header fields order.
      • addRow

        void addRow​(Object... values)
        Adds a row to the data buffer that will ultimately be loaded in the feed table.
        Parameters:
        values - Row to add as an array of values matching the header fields order.
      • flush

        void flush()
        Flushes the data to the DB. This is in addition to the implicit flush that occurs when the internal buffer fills up. The internal buffer size is determined by the datamart.dataLoad.maxRowsPerBatch Pricefx node instance parameter, with a default value of 20k rows.
      • setMapping

        void setMapping​(Map<String,​String> mapping)
        When calling addRow(Map), maps the value for the given source fields to the corresponding target fields (the latter being the fields in the target FC being populated).
        Parameters:
        mapping - [sourceField.name → targetField.name] map