Class ExecutionAllowListChecker

java.lang.Object
org.cibseven.bpm.engine.impl.ExecutionAllowListChecker

public final class ExecutionAllowListChecker extends Object
Checks the built-in execution mechanisms a process definition uses against ProcessEngineConfigurationImpl.getExecutionAllowList(): the task types camunda:type="shell", "mail" and "external", and the script languages resolved by the ScriptingEngines.

An empty allow list means no check. Once it has entries, only the listed task types and script languages are allowed; ProcessEngineConfigurationImpl.getExpressionHardeningMode() decides what happens on a violation (off: no check, report: log only, enforce: block).

Entries are matched in full and ignoring case.

  • Field Details

  • Method Details

    • ensureTaskTypeAllowed

      public static void ensureTaskTypeAllowed(String taskType, String activityId)
      Blocks the task type at execution time, unless the allow list permits it or is not active.
      Parameters:
      taskType - the value of camunda:type, e.g. shell
      activityId - the activity that uses the task type, for the message
      Throws:
      ProcessEngineException - if the task type must be blocked
    • ensureScriptLanguageAllowed

      public static void ensureScriptLanguageAllowed(String language)
      Blocks the script language, unless the allow list permits it or is not active.
      Parameters:
      language - the name of the script language, e.g. groovy
      Throws:
      ProcessEngineException - if the script language must be blocked
    • getViolationMessage

      public static String getViolationMessage(String kind, String name, String activityId)
      Returns:
      the message of a blocked use, with the same code as the exception thrown at execution time
    • isBlocked

      public static boolean isBlocked(String kind, String name, String activityId)
      Returns:
      true if the use of name must be blocked. A violation in report mode is logged and returns false. A null name is not checked: there is nothing to execute, and the caller reports the missing name itself.