Class ProcessUpgrade

java.lang.Object
com.appiancorp.suiteapi.process.upgrade.ProcessUpgrade
All Implemented Interfaces:
Comparable<ProcessUpgrade>

public class ProcessUpgrade extends Object implements Comparable<ProcessUpgrade>
The outcome of an attempted upgrade of a process.
  • Constructor Details

    • ProcessUpgrade

      public ProcessUpgrade()
      Creates a blank instance.
    • ProcessUpgrade

      public ProcessUpgrade(Long processId, ProcessUpgrade.Outcome outcome)
      Creates an instance with the specified process id and result code.
      Parameters:
      processId - the id of the process
      outcome - the code indicating the outcome of the attempted upgrade
  • Method Details

    • setProcessId

      public void setProcessId(Long processId)
      Sets the id of the process.
      Parameters:
      processId - the id of the process
    • getProcessId

      public Long getProcessId()
      Gets the id of the process.
      Returns:
      the id of the process
    • setProcessInactive

      public void setProcessInactive(boolean isProcessInactive)
      Sets whether the process is inactive after the upgrade. A process can become inactive during an upgrade if the only active tasks before the upgrade were instances of nodes that are not present in the target process model, since these tasks would be canceled during the upgrade.
      Parameters:
      isProcessInactive - whether the process is inactive
    • isProcessInactive

      public boolean isProcessInactive()
      Gets whether the process is inactive after the upgrade. A process can become inactive during an upgrade if the only active tasks before the upgrade were instances of nodes that are not present in the target process model, since these tasks would be canceled during the upgrade. Note that this method will return false for ProcessUpgrade objects returned from ProcessExecutionService.upgradeProcesses(Long, String, Long[]) and ProcessExecutionService.upgradeProcesses(Long, String, Long, String[]) for all outcomes other than ProcessUpgrade.Outcome.SUCCESS. The processes may indeed be inactive for other outcomes, but this will not be checked.
      Returns:
      whether the process is inactive
    • setOutcome

      public void setOutcome(ProcessUpgrade.Outcome outcome)
      Sets the result code indicating the outcome of the attempted upgrade.
      Parameters:
      outcome - the outcome
    • getOutcome

      public ProcessUpgrade.Outcome getOutcome()
      Gets the result code indicating the outcome of the attempted upgrade.
    • getOutcomes

      public static ProcessUpgrade.Outcome[] getOutcomes(ProcessUpgrade[] upgrades)
      Extracts the outcomes from the specified ProcessUpgrade objects.
      Parameters:
      results - the ProcessUpgrade objects from which to extract the outcomes
      Returns:
      the extracted outcomes
    • getProcessIds

      public static Long[] getProcessIds(ProcessUpgrade[] upgrades)
      Extracts the process ids from the specified ProcessUpgrade objects.
      Parameters:
      upgrades - the ProcessUpgrade objects from which to extract the process ids
      Returns:
      the extracted process ids
    • getProcessIdsWithOutcome

      public static Long[] getProcessIdsWithOutcome(ProcessUpgrade[] upgrades, ProcessUpgrade.Outcome... outcomes)
      Extracts process ids from the specified ProcessUpgrade objects, filtering for those processes whose upgrade had one of the specified outcomes.
      Parameters:
      upgrades - the ProcessUpgrade objects from which to extract the process ids
      outcomes - the outcomes to filter for
      Returns:
      the extracted process ids
    • compareTo

      public int compareTo(ProcessUpgrade o)
      Compares the specified object with this UpgradeProcessResult for order. Order is determined by comparing their process ids.
      Specified by:
      compareTo in interface Comparable<ProcessUpgrade>
      Parameters:
      o - the object to compare with this one
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
    • equals

      public boolean equals(Object o)
      Compares the specified object with this one for equality. Returns true if and only if the specified object is also an UpgradeProcessResult and both have the same process id.
      Overrides:
      equals in class Object
      Parameters:
      o - the object to be compared for equality with this UpgradeProcessResult
      Returns:
      true if the specified object is equal to this UpgradeProcessResult
    • hashCode

      public int hashCode()
      Returns a hash code for the object.
      Overrides:
      hashCode in class Object