Class PreUndeployOperations


  • public class PreUndeployOperations
    extends Object
    Utility class to provide default functions to use on DeploymentService#undeploy(DeploymentUnit, Function)
    • Constructor Detail

      • PreUndeployOperations

        public PreUndeployOperations()
    • Method Detail

      • checkActiveProcessInstances

        public static Function<org.jbpm.services.api.model.DeploymentUnit,​Boolean> checkActiveProcessInstances​(org.jbpm.services.api.RuntimeDataService runtimeDataService)
        Returns a function that checks if a given DeploymentUnit has active process instances and prevents its undeployment. That's the default operation when no other is supplied.
        Parameters:
        runtimeDataService - a RuntimeDataService to query the process instances
      • abortUnitActiveProcessInstances

        public static Function<org.jbpm.services.api.model.DeploymentUnit,​Boolean> abortUnitActiveProcessInstances​(org.jbpm.services.api.RuntimeDataService runtimeDataService,
                                                                                                                         org.jbpm.services.api.DeploymentService deploymentService)
        Returns a function that checks if a given DeploymentUnit has active process instances instances, aborts them and, if nothing wrong happened, lets the undeployment operation continue.
        Parameters:
        runtimeDataService - a RuntimeDataService to query the process instances
        deploymentService - a DeploymentService to provide access to the deployed unit.
      • doNothing

        public static Function<org.jbpm.services.api.model.DeploymentUnit,​Boolean> doNothing()
        Returns a function that bypasses the check and always allows to undeploy.