Class ModelCalculationAction<T extends Help>
Object
Action
ModelCalculationAction<T>
- All Implemented Interfaces:
Help
public final class ModelCalculationAction<T extends Help>
extends Action
This action calculates a Model Object: a range of its steps, or one of the actions declared in its Model Class.
Obtain it with
CalculationFlowActionBuilder.addModelCalculationAction(String), which takes the unique name
of the model. It starts the calculation only when the logic calls setCalculate(true).
If nothing is specified, all the steps of the model will be calculated.
If both action and steps are specified, then only the action will be executed.
The calculation runs with the access rights of the user who created the model. If no model has this unique name, no calculation starts and the Calculation Flow does not report an error. If the calculation cannot start, for example because a running calculation locks the model or because the model was submitted or approved, the Calculation Flow reports an error.
- See Also:
-
Field Summary
Fields inherited from class Action
jobs -
Constructor Summary
ConstructorsConstructorDescriptionModelCalculationAction(T backLink, Invocations<MethodInvocationRecord> invocations, String modelUniqueName) Not intended for public use. -
Method Summary
Modifier and TypeMethodDescriptionExecute one of the actions declared in theModelObject'sModelClass.allSteps()Sets the calculation range of the model to all steps (setsfromStepandtoStepto null).back()Returns the builder that added this action, so that the logic can add the next action in the same chain.Sets the calculation range of steps of the specified model, beginning with the first step (included).Sets the calculation range of steps of the specified model, beginning with the specified step (included).Gets the action set withaction(String).booleanGets whether this action starts the calculation of the model.Gets the step that the calculation range starts with.Gets the unique name of the model that this action calculates.Not intended for public use.Gets the step that the calculation range ends with.Calculates the step of the model.setCalculate(Boolean calculate) Whether the action is valid and should be triggered or not.Sets the calculation range of steps of the specified model, ending with the last step (included).Sets the calculation range of steps of the specified model, ending with the specified step (included).toString()Returns a text representation of this action for debugging.
-
Constructor Details
-
ModelCalculationAction
public ModelCalculationAction(T backLink, Invocations<MethodInvocationRecord> invocations, String modelUniqueName) Not intended for public use. An action created with this constructor is not added to the Calculation Flow, so it never runs. UseactionBuilder.addModelCalculationAction()instead.- See Also:
-
-
Method Details
-
action
Execute one of the actions declared in theModelObject'sModelClass. This clears the step range set by the other methods.Example:
actionBuilder.addModelCalculationAction('modelUniqueName') .action('anActionDeclaredInTheModel') .setCalculate(true)- Parameters:
actionName- the name of the action as declared in the Model Class- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.3 Bee's Knees
- See Also:
-
allSteps
Sets the calculation range of the model to all steps (setsfromStepandtoStepto null).Example:
actionBuilder.addModelCalculationAction("modelUniqueName") .allSteps() .setCalculate(true) return- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.1 - Bee's Knees
- See Also:
-
oneStep
Calculates the step of the model.Example:
actionBuilder.addModelCalculationAction("modelUniqueName") .oneStep("stepName") .setCalculate(true) return- Parameters:
step- the step to be calculated- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.1 - Bee's Knees
- See Also:
-
fromFirstStep
Sets the calculation range of steps of the specified model, beginning with the first step (included). SetsfromStepto null. Used together withtoStep(String).Example:
actionBuilder.addModelCalculationAction("modelUniqueName") .fromFirstStep() .toStep("StepName3") .setCalculate(true) return- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.1 - Bee's Knees
- See Also:
-
fromStep
Sets the calculation range of steps of the specified model, beginning with the specified step (included). Used together withtoStep(String)ortoLastStep().Example:
actionBuilder.addModelCalculationAction("modelUniqueName") .fromStep("StepName2") .toStep("StepName3") .setCalculate(true) return- Parameters:
step- the name of the step to start the calculation with- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.1 - Bee's Knees
- See Also:
-
toLastStep
Sets the calculation range of steps of the specified model, ending with the last step (included). SetstoStepto null. Used together withfromStep(String).Example:
actionBuilder.addModelCalculationAction("modelUniqueName") .fromStep("StepName2") .toLastStep() .setCalculate(true) return- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.1 - Bee's Knees
- See Also:
-
toStep
Sets the calculation range of steps of the specified model, ending with the specified step (included). Used together withfromStep(String)orfromFirstStep().Example:
actionBuilder.addModelCalculationAction("modelUniqueName") .fromStep("StepName2") .toStep("StepName3") .setCalculate(true) return- Parameters:
step- the name of the step to end the calculation with- Returns:
- the instance of
ModelCalculationAction - Since:
- 10.1 - Bee's Knees
- See Also:
-
setCalculate
Whether the action is valid and should be triggered or not.- Parameters:
calculate-- true - calculation of the model is started as background process
- false - calculation of the model is NOT started at all
- Returns:
- this action, for further configuration
-
back
Returns the builder that added this action, so that the logic can add the next action in the same chain.- Returns:
- the
actionBuilderthat added this action - See Also:
-
getObjectName
Not intended for public use.- Returns:
- the name of the builder that added this action, followed by
".ModelCalculationAction"
-
getModelUniqueName
Gets the unique name of the model that this action calculates.- Returns:
- the unique name passed to
CalculationFlowActionBuilder.addModelCalculationAction(String)
-
getCalculate
public boolean getCalculate()Gets whether this action starts the calculation of the model.- Returns:
trueaftersetCalculate(true), otherwisefalse- See Also:
-
getFromStep
Gets the step that the calculation range starts with.- Returns:
- the step, or an empty
Optionalwhen the range starts at the first step
-
getToStep
Gets the step that the calculation range ends with.- Returns:
- the step, or an empty
Optionalwhen the range ends at the last step
-
getAction
Gets the action set withaction(String).- Returns:
- the name of the action, or
nullwhen the action calculates steps
-
toString
Returns a text representation of this action for debugging.
-