Class CalculationFlowActionBuilder

Object
CalculationFlowActionBuilder
All Implemented Interfaces:
Help

public class CalculationFlowActionBuilder extends Object implements Help
CalculationFlowActionBuilder is the starting point of an interface that allows you to define actions within calculation flow logic. The calculation flow action builder is available in calculation flow by this call:
def builder = actionBuilder
Note that you will find full code snippets in the "Command Templates/Calculation Flow Examples" inside calculation flow formulas UI.

Logics of the calculationFlow and parameterizedCalculationFlow natures get this builder as the actionBuilder binding variable. A logic does not create it.

Each addXxxAction() method adds one action and returns it. Set the options on the returned action, then call back() to return to this builder and add the next action. An action that has a setCalculate() method starts its job only when the logic calls setCalculate(true).

To start a job only after another job has finished, describe it with a ChainedJobInfo and pass it to setNextJobs() of the first action.

Example:


 actionBuilder.addPricelistAction('Price List 1')
     .setCalculate(true)
     .back()
     .addCalculatedFieldSetAction('CFS 1')
     .setPriority(5)
     .setCalculate(true)
 
See Also:
  • Constructor Details

    • CalculationFlowActionBuilder

      public CalculationFlowActionBuilder(Invocations<MethodInvocationRecord> invocations, CalculationFlowTimeUnit timeUnit, BigDecimal numberOfTimeUnits, String startingDate, Boolean periodic, CFTraitType traitType)
      Not intended for public use. Use the actionBuilder binding variable of the logic instead.
    • CalculationFlowActionBuilder

      public CalculationFlowActionBuilder(Invocations<MethodInvocationRecord> invocations)
      Not intended for public use. This constructor sets no schedule, so getScheduleSettings() reports none. Use the actionBuilder binding variable of the logic instead.
  • Method Details

    • addCalculatedFieldSetAction

      public CFSAction<CalculationFlowActionBuilder> addCalculatedFieldSetAction(String cfsLabel)
      Adds a Calculated Field Set (CFS) action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addCalculatedFieldSetAction('cfsLabel').setCalculate(true)
      Parameters:
      cfsLabel - label of the CFS as seen in the CFS header level overview in the UI.
      Returns:
      CFS action object with further configuration options.
    • addPricelistAction

      public PricelistAction<CalculationFlowActionBuilder> addPricelistAction(String pricelistName)
      Adds a Price List action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addPricelistAction('pricelistLabel').setCalculate(true)
      Parameters:
      pricelistName - label of the Price List as seen in the Price Lists header level overview in the UI.
      Returns:
      Price List action object with further configuration options.
    • addManualPricelistAction

      public ManualPricelistAction<CalculationFlowActionBuilder> addManualPricelistAction(String manualPricelistUniqueName)
      Adds a Manual Price List action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addManualPricelistAction('manualPricelistUniqueName').setCalculate(true)
      Parameters:
      manualPricelistUniqueName - unique name of the Manual Price List, not its label.
      Returns:
      Manual Price List action object with further configuration options.
    • addLivePriceGridAction

      public LivePriceGridAction<CalculationFlowActionBuilder> addLivePriceGridAction(String lpgLabel)
      Adds a Live Price Grid (LPG) action to the list of actions that should be executed.

      Snippet:
      • Full recalculation: actionBuilder.addLivePriceGridAction('livePriceGridLabel').setCalculate(true)
      • Partial recalculation: actionBuilder.addLivePriceGridAction('livePriceGridLabel').restrictToSkus(['sku1', 'sku2', 'sku3']).withFormulaParameters([amount: 42, city: 'New York']).setCalculate(true)
      Parameters:
      lpgLabel - label of LPG as seen in the LPG header level overview in the UI.
      Returns:
      LPG action object with further configuration options.
    • addDataLoadAction

      public DataLoadAction<CalculationFlowActionBuilder> addDataLoadAction(String dataLoadLabel, String dataLoadType, String target)
      Adds the specified data load action to the list of actions to be executed.

      Example:

      
       actionBuilder.addDataLoadAction('dataLoadLabel', 'dataLoadType', 'target')
                    .setCalculate(true)
       

      Note that dataLoadLabel, dataLoadType, and target uniquely identify any data load available in the system.

      Valid dataLoadType values are:

      • AddTablePartitions
      • Calculation
      • Calendar
      • Customers
      • DistributedCalculation
      • Flush
      • Import
      • IndexMaintenance
      • InternalCopy
      • ModelCalculation
      • ModelRecordCalculation
      • Products
      • PublishDatamart
      • Refresh
      • Sellers
      • Truncate

      The values are case-sensitive. With any other value, the action starts no data load and the Calculation Flow does not report an error.

      Parameters:
      dataLoadLabel - the label of the data load as seen in the data loads overview in the UI
      dataLoadType - the type of the data load as seen in the data loads overview in the UI
      target - the target of the data load as seen in the data loads overview in the UI: the type code and the unique name of the target table, for example DM.Transactions for a Datamart
      Returns:
      a data load action object with further configuration options.
    • addModelCalculationAction

      public ModelCalculationAction<CalculationFlowActionBuilder> addModelCalculationAction(String modelUniqueName)
      Adds a model calculation action to the list of actions that should be executed. See returned ModelCalculationAction for further configuration.

      Sample code:

      
           actionBuilder.addModelCalculationAction('myModelName')
               .fromStep('aStepOfTheModel')
               .toLastStep()
               .setCalculate(true)
       

      or:

      
           actionBuilder.addModelCalculationAction('myModelName')
               .action('anActionDeclaredInTheModel')
               .setCalculate(true)
       
      Parameters:
      modelUniqueName - unique name of the Model Object in the partition
      Returns:
      action object with further configuration options to specify which steps to calculate
      Since:
      10.1 Bee's Knees
    • addExportAction

      public ExportAction<CalculationFlowActionBuilder> addExportAction(String jobName)
      Adds export/archive action to the list of actions that should be executed.

      Snippet:
      • Export flavour: actionBuilder.addExportAction('jobName').doExport('templateName')
      • Archive flavour: actionBuilder.addExportAction('jobName').doArchive('templateName')
      Parameters:
      jobName - name of the job as seen in "Admin/Import-Export-Archiving" UI. The action creates a new job with this label.
      Returns:
      export action object with further configuration options.
    • addSimulationAction

      public SimulationAction<CalculationFlowActionBuilder> addSimulationAction(String simulationLabel)
      Adds a Simulation action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addSimulationAction('simulationLabel').setCalculate(true)
      Parameters:
      simulationLabel - label of the Simulation as seen in the Simulations header level overview in the UI.
      Returns:
      Simulation action object with further configuration options.
    • addRebateRecordAction

      public RebateRecordAction<CalculationFlowActionBuilder> addRebateRecordAction(String rrscLabel)
      Adds a Rebate Record action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addRebateRecordAction('rrscLabel').setCalculate(true)
      Parameters:
      rrscLabel - label of the Rebate Calculation as seen on the Rebate Calculations page. It is not the label of the Rebate Record Set.
      Returns:
      rebate record action object with further configuration options.
    • addQuoteMassUpdateAction

      public QuoteMassUpdateAction<CalculationFlowActionBuilder> addQuoteMassUpdateAction(String label)
      Adds a Quote Mass Update action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addQuoteMassUpdateAction('label').setCalculate(true)
      Parameters:
      label - label of the Quote Mass Update
      Returns:
      Quote Mass Update action object with further configuration options.
    • addObjRefAction

      public ObjRefAction<CalculationFlowActionBuilder> addObjRefAction()
      Adds object references action to the list of actions that should be executed.

      Snippet:
      actionBuilder.addObjRefAction().setFilter(filter).setPartition(partition).setTypeCode('typeCode')
      Returns:
      obj ref action object with further configuration options.
    • getScheduleSettings

      public ScheduleSettings<CalculationFlowActionBuilder> getScheduleSettings()
      Gets the schedule of the Flow Item that runs this logic, as seen in the Calculation Flows configuration. Use it to read the schedule, or to change the start date and the interval of the following runs.
      Returns:
      schedule settings with further configuration options
      See Also:
    • getObjectName

      public String getObjectName()
      Not intended for public use.
      Specified by:
      getObjectName in interface Help
      Returns:
      "CalculationFlowActionBuilder"
    • getActions

      public List<Action> getActions()
      Not intended for public use.
      Returns:
      the actions added with the addXxxAction() methods