org.jbpm.kie.services.impl.utils

## Class PreUndeployOperations

- java.lang.Object
- - org.jbpm.kie.services.impl.utils.PreUndeployOperations

-     public class PreUndeployOperations
      extends Object

  Utility class to provide default functions to use on `DeploymentService#undeploy(DeploymentUnit, Function)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreUndeployOperations()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Function<DeploymentUnit,Boolean>` | `abortUnitActiveProcessInstances(RuntimeDataService runtimeDataService, 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.
    `static Function<DeploymentUnit,Boolean>` | `checkActiveProcessInstances(RuntimeDataService runtimeDataService)` Returns a function that checks if a given `DeploymentUnit` has active process instances and prevents its undeployment.
    `static Function<DeploymentUnit,Boolean>` | `doNothing()` Returns a function that bypasses the check and always allows to undeploy.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PreUndeployOperations

          public PreUndeployOperations()

  - ### Method Detail

    - #### checkActiveProcessInstances

          public static Function<DeploymentUnit,Boolean> checkActiveProcessInstances(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<DeploymentUnit,Boolean> abortUnitActiveProcessInstances(RuntimeDataService runtimeDataService,
                                                                                         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<DeploymentUnit,Boolean> doNothing()

      Returns a function that bypasses the check and always allows to undeploy.

Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.