Class DataLoadAction<T extends Help>

Object
Action
DataLoadAction<T>
All Implemented Interfaces:
Help

public class DataLoadAction<T extends Help> extends Action
This action starts calculation of selected data load. It's a programmatic version of the same action available in UI. As such it allows user to schedule the action in calculation flow formula.

Obtain it with CalculationFlowActionBuilder.addDataLoadAction(String, String, String). The label, the type and the target together identify the Data Load. The target is the type code and the unique name of the target table, for example DM.Transactions for a Datamart or DMDS.Products for a Data Source. The action runs the Data Load only when the logic calls setCalculate(true). If no Data Load matches, or the type is not valid, nothing runs and the Calculation Flow does not report an error.

Example:


 actionBuilder.addDataLoadAction('Refresh Transactions', 'Refresh', 'DM.Transactions')
     .setCalculate(true)
 
See Also:
  • Constructor Details

  • Method Details

    • setCalculate

      public DataLoadAction<T> setCalculate(Boolean calculate)
      Whether the action is valid and should be triggered or not.
      Parameters:
      calculate -
      • true - calculation of the data load is started as background process
      • false - calculation of the data load is NOT started at all
      Returns:
      this action, for further configuration
    • setNextJobs

      public DataLoadAction<T> setNextJobs(List<ChainedJobInfo> jobs)
      Defines subsequent follow-on jobs. A next job starts when the Data Load has finished. If the Data Load fails, a next job starts only when its executeOnError is true. Each next job can have next jobs of its own.

      Example, running another Data Load after this one:

      
       import net.pricefx.common.dto.ChainedJobInfo
      
       def nextJob = new ChainedJobInfo()
       nextJob.setTargetObject('286.DMDL')
       nextJob.setExecuteOnError(false)
      
       actionBuilder.addDataLoadAction('Refresh Transactions', 'Refresh', 'DM.Transactions')
           .setNextJobs([nextJob])
           .setCalculate(true)
       
      Parameters:
      jobs - List of ChainedJobInfo objects
      Returns:
      this action, for further configuration
      See Also:
    • back

      public T back()
      Returns the builder that added this action, so that the logic can add the next action in the same chain.
      Returns:
      the actionBuilder that added this action
      See Also:
    • getObjectName

      public String getObjectName()
      Not intended for public use.
      Returns:
      the name of the builder that added this action, followed by ".DataLoadAction"
    • getDataLoadLabel

      public String getDataLoadLabel()
      Gets the label of the Data Load that this action runs.
      Returns:
      the label passed to CalculationFlowActionBuilder.addDataLoadAction(String, String, String)
    • getDataLoadType

      public String getDataLoadType()
      Gets the type of the Data Load that this action runs.
      Returns:
      the type passed to CalculationFlowActionBuilder.addDataLoadAction(String, String, String), for example Refresh
    • getTarget

      public String getTarget()
      Gets the target of the Data Load that this action runs.
      Returns:
      the target passed to CalculationFlowActionBuilder.addDataLoadAction(String, String, String), for example DM.Transactions
    • getCalculate

      public Boolean getCalculate()
      Gets whether this action runs the Data Load.
      Returns:
      true after setCalculate(true), otherwise false
      See Also:
    • getNextJobs

      public List<ChainedJobInfo> getNextJobs()
      Gets the follow-on jobs set with setNextJobs(List).
      Returns:
      the follow-on jobs
    • toString

      public String toString()
      Returns a text representation of this action for debugging.
      Overrides:
      toString in class Object
      Returns:
      a text that contains the label, the type and the target of the Data Load and the calculate flag of this action