Class CalculationFlowActionBuilder
- All Implemented Interfaces:
Help
def builder = actionBuilderNote 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 Summary
ConstructorsConstructorDescriptionCalculationFlowActionBuilder(Invocations<MethodInvocationRecord> invocations) Not intended for public use.CalculationFlowActionBuilder(Invocations<MethodInvocationRecord> invocations, CalculationFlowTimeUnit timeUnit, BigDecimal numberOfTimeUnits, String startingDate, Boolean periodic, CFTraitType traitType) Not intended for public use. -
Method Summary
Modifier and TypeMethodDescriptionaddCalculatedFieldSetAction(String cfsLabel) Adds a Calculated Field Set (CFS) action to the list of actions that should be executed.addDataLoadAction(String dataLoadLabel, String dataLoadType, String target) Adds the specified data load action to the list of actions to be executed.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')addLivePriceGridAction(String lpgLabel) Adds a Live Price Grid (LPG) action to the list of actions that should be executed.addManualPricelistAction(String manualPricelistUniqueName) Adds a Manual Price List action to the list of actions that should be executed.addModelCalculationAction(String modelUniqueName) Adds a model calculation action to the list of actions that should be executed.Adds object references action to the list of actions that should be executed.addPricelistAction(String pricelistName) Adds a Price List action to the list of actions that should be executed.addQuoteMassUpdateAction(String label) Adds a Quote Mass Update action to the list of actions that should be executed.addRebateRecordAction(String rrscLabel) Adds a Rebate Record action to the list of actions that should be executed.addSimulationAction(String simulationLabel) Adds a Simulation action to the list of actions that should be executed.List<Action> Not intended for public use.Not intended for public use.Gets the schedule of the Flow Item that runs this logic, as seen in the Calculation Flows configuration.
-
Constructor Details
-
CalculationFlowActionBuilder
public CalculationFlowActionBuilder(Invocations<MethodInvocationRecord> invocations, CalculationFlowTimeUnit timeUnit, BigDecimal numberOfTimeUnits, String startingDate, Boolean periodic, CFTraitType traitType) Not intended for public use. Use theactionBuilderbinding variable of the logic instead. -
CalculationFlowActionBuilder
public CalculationFlowActionBuilder(Invocations<MethodInvocationRecord> invocations) Not intended for public use. This constructor sets no schedule, sogetScheduleSettings()reports none. Use theactionBuilderbinding variable of the logic instead.
-
-
Method Details
-
addCalculatedFieldSetAction
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
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
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.
- Full recalculation:
-
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, andtargetuniquely identify any data load available in the system.Valid
dataLoadTypevalues are:AddTablePartitionsCalculationCalendarCustomersDistributedCalculationFlushImportIndexMaintenanceInternalCopyModelCalculationModelRecordCalculationProductsPublishDatamartRefreshSellersTruncate
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 UIdataLoadType- the type of the data load as seen in the data loads overview in the UItarget- 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 exampleDM.Transactionsfor 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 returnedModelCalculationActionfor 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
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.
-
Export flavour:
-
addSimulationAction
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
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
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
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
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
Not intended for public use.- Specified by:
getObjectNamein interfaceHelp- Returns:
"CalculationFlowActionBuilder"
-
getActions
Not intended for public use.- Returns:
- the actions added with the
addXxxAction()methods
-