Enable Data Sources in Agents

Available from version 16.0

This guide shows how to enable the Data Source (DMDS) or other sources to be used as a selectable Source in the Pricefx Agents (specifically Datamart Watchers) when explicitly enabled via Groovy, without changing behavior for the Analytics charts or other accelerators. By default, the Data Source is not available as a Source in the Pricefx Agents.

Procedure

info For version 16.0+ (Standard).

  1. Log in to the Pricefx application.

  2. Go to Administration > Logics > Groovy Library.

  3. Select the ActIn_Library.

  4. Select the ScopeDataUtils element.

  5. In the Code Editor, locate the logic responsible for building the Data Scope input.

    Groovy
         return api.inputBuilderFactory()
                .createDmQueryBuilder(scopeDataDefinitionManager.SCOPE_DATA_ENTRY_NAME)
                .setNoRefresh(true)
                .setValue(scopeDataDefinitionManager.getScopeData())
                .buildContextParameter()
    
  6. Add the .withSeriesSourceTypes() method into existing code.

    Groovy
     return api.inputBuilderFactory()
                .createDmQueryBuilder(scopeDataDefinitionManager.SCOPE_DATA_ENTRY_NAME)
                .setNoRefresh(true)
                .setValue(scopeDataDefinitionManager.getScopeData())
                .withSeriesSourceTypes('DMDS','DM','DMM','DMR','DMT','MO')
                .buildContextParameter()
    
  7. Click Save and Close.

  8. To verify the change, navigate to Pricefx Agents > Agents and select an agent. In the Definition step, under the Data Scope section, you can now select a Data Source from the dropdown menu.

Method Options

  • DM – Datamart

  • DMM – DM Model (legacy Price Optimizer)

  • DMDS – Data Source

  • DMR – Rollup

  • DMT – Model Object Table

  • MO – Model Object

After implementing this code change the Data Source will be available to you as a selectable Source in the Definition Step of your Agent.

If this method is not used, the following sources are available by default:

  • DM – Datamart

  • DMM – DM Model (legacy Price Optimizer)

  • DMR – Rollup

  • DMT – Model Object Table

  • MO – Model Object

Backward Compatible Procedure

info For version 16.0+ (Backward Compatible). Use the setConfigParameter method to ensure the logic does not break when running on Pricefx versions older than 16.0.

  1. Log in to the Pricefx application.

  2. Go to Administration > Logics > Groovy Library.

  3. Select the ActIn_Library.

  4. Select the ScopeDataUtils element.

  5. In the Code Editor, locate the logic responsible for building the Data Scope input.

  6. Define the allowed sources using one of the following methods based on your version requirements:

    Groovy
    def cp = api.inputBuilderFactory()
      .createDmQueryBuilder('queryInput').buildContextParameter()
      cp.setConfigParameter("allowedSeriesSources", ["DM", "DMDS", "DMR", "DMT"])
    return cp
    

    Alternatively, using the input builder:

    Groovy
    def inputBuilder = api.inputBuilderFactory().createDmQueryBuilder('queryInput')
    inputBuilder.cp.setConfigParameter("allowedSeriesSources", ["DM", "DMDS", "DMR", "DMT"])
    return inputBuilder.buildContextParameter()
    
  7. Click Save and Close.

  8. To verify the change, navigate to Pricefx Agents > Agents and select an agent. In the Definition step, under the Data Scope section, you can now select a Data Source from the dropdown menu.

See Also