Class AttributeRecalculationManager

java.lang.Object
io.jmix.dynattrflowui.impl.AttributeRecalculationManager

@Component("dynat_AttributeRecalculationManager") public class AttributeRecalculationManager extends Object
  • Field Details

    • scriptEvaluator

      protected final org.springframework.scripting.ScriptEvaluator scriptEvaluator
    • attributeDependencies

      protected final AttributeDependencies attributeDependencies
    • dynAttrUiProperties

      protected final DynAttrUiProperties dynAttrUiProperties
  • Constructor Details

    • AttributeRecalculationManager

      public AttributeRecalculationManager(org.springframework.scripting.ScriptEvaluator scriptEvaluator, AttributeDependencies attributeDependencies, DynAttrUiProperties dynAttrUiProperties)
  • Method Details

    • recalculateByAttribute

      public void recalculateByAttribute(Object entity, AttributeDefinition attribute)
      Performs recalculation for all dependent dynamic attributes. Recalculation is performed hierarchically.

      Recalculation level limited by cuba.dynamicAttributes.maxRecalculationLevel application property. If this property is not defined then the default value is used (default value is 10).

      Parameters:
      entity - entity with loaded dynamic attributes.
      attribute - an attribute from which the recalculation begins. Value for this attribute won't be changed, it is assumed that this attribute was updated before
    • evaluateNewValue

      protected Object evaluateNewValue(Object entity, String script)