Class FreeformRule

All Implemented Interfaces:
LocalId, ContentConstants, AppianTypeHolder, Serializable

public class FreeformRule extends Rule
Represents a freeform rule, which has a set of parameters and an expression which is run whenever the rule is called. The expression can contain the parameters as well as constants, process variables, activity class parameters, and activity return variables that are expected to exist in context when the expression is run.
See Also:
  • Field Details

  • Constructor Details

    • FreeformRule

      public FreeformRule()
      Constructs a new freeform rule object.
    • FreeformRule

      protected FreeformRule(int subtype)
  • Method Details

    • getParams

      public NamedTypedValue[] getParams()
      Gets the parameters to this freeform rule as an array of NamedTypedValue. This is not stored as a full-fledged field, but instead is stored as an attribute. This call delegates to {@link #getParameters())}.
      Returns:
      the parameters
      See Also:
    • setParams

      public void setParams(NamedTypedValue[] ntvs)
      Sets the parameters to this freeform rule. This call delegates to {@link #setParameters(TypedVariable[]).
      Parameters:
      ntvs - the parameters
      See Also:
      • getParams()
      • com.appiancorp.suiteapi.content.Content#setAttributes()
    • getParameters

      @Deprecated public TypedVariable[] getParameters()
      Deprecated.
      use getParams() instead
      Gets the parameters to this freeform rule. This is not stored as a full-fledged field, but instead is stored as an attribute.
      Returns:
      the parameters
      See Also:
    • setParameters

      @Deprecated public void setParameters(TypedVariable[] tvs)
      Deprecated.
      Sets the parameters to this freeform rule. This is not stored as a full-fledged field, but instead is stored as an attribute. This field can be updated in the database.
      Parameters:
      tvs - the parameters
      See Also:
    • getDefinition

      public String getDefinition()
      Gets the definition (the expression to run) using the format for retrieval.
      See Also:
      • TypeTransformation.TYPE_ID_TO_TYPE_NAMESPACE_CURRENT_IF_LATEST_VERSION_MODE_ON_FOR_RULES
    • getPreferredEditor

      public String getPreferredEditor()
    • getOfflineEnabled

      public Boolean getOfflineEnabled()
      Returns the offline attribute for an interface freeform rule. This attribute indicates whether the rule is enabled for offline mobile use. If the offline enabled atrribute has not been set, this method returns false.
      Returns:
      whether or not the rule is enabled for offline use.
      See Also:
    • setOfflineEnabled

      public void setOfflineEnabled(Boolean isOfflineEnabled)
      Sets the offline enabled attribute for an interface freeform rule. This attribute indicates whether the rule is enabled for offline mobile use.
      Parameters:
      isOfflineEnabled - the offline setting
      See Also:
    • isWhitelistedForK

      @Deprecated public Boolean isWhitelistedForK()
      Deprecated.
      This attribute is no longer used
      Gets the whitelistedForK attribute for a freeform rule. This attribute only applies to system rules.
    • setWhitelistedForK

      @Deprecated public void setWhitelistedForK(Boolean isWhitelistedForKExecution)
      Deprecated.
      This attribute is no longer used.
      Sets the whitelistedForK attribute for a freeform rule. This attribute only applies to system rules.
      Parameters:
      isWhitelistedForKExecution - does this system rule run in-engine?
    • getFunctionCategory

      @Nullable public String getFunctionCategory()
      Returns the function category under which the rule will appear in the expression editor. Only out-of-the-box system rules are assigned a category. Rules created by designers do not appear in function categories, but instead appear under their folder in the Rules tab of the expression editor.
    • getSuppressions

      @Nullable public String getSuppressions()
      Returns the suppressions keys added by developers on out-of-the-box system rules. Rules created by designers do not have suppressions. The suppressions keys are comma-separated. See SysRuleStandardsTestHelper for the list of valid keys.
    • setDefinition

      public void setDefinition(String definition)
      Sets the definition (the expression to run) using the format for storage.
      See Also:
      • TypeTransformation.TYPE_NAMESPACE_TO_TYPE_ID_FALLING_BACK_TO_LATEST_DEACTIVATED_VERSION
    • getIcon

      public String getIcon()
      Specified by:
      getIcon in class Rule
    • getOpaqueId

      @Transient public String getOpaqueId()