Class ProcessUpgrade
java.lang.Object
com.appiancorp.suiteapi.process.upgrade.ProcessUpgrade
- All Implemented Interfaces:
Comparable<ProcessUpgrade>
The outcome of an attempted upgrade of a process.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the outcome of an attempted upgrade of a process. -
Constructor Summary
ConstructorDescriptionCreates a blank instance.ProcessUpgrade
(Long processId, ProcessUpgrade.Outcome outcome) Creates an instance with the specified process id and result code. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares the specified object with this UpgradeProcessResult for order.boolean
Compares the specified object with this one for equality.Gets the result code indicating the outcome of the attempted upgrade.static ProcessUpgrade.Outcome[]
getOutcomes
(ProcessUpgrade[] upgrades) Extracts the outcomes from the specified ProcessUpgrade objects.Gets the id of the process.static Long[]
getProcessIds
(ProcessUpgrade[] upgrades) Extracts the process ids from the specified ProcessUpgrade objects.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.int
hashCode()
Returns a hash code for the object.boolean
Gets whether the process is inactive after the upgrade.void
setOutcome
(ProcessUpgrade.Outcome outcome) Sets the result code indicating the outcome of the attempted upgrade.void
setProcessId
(Long processId) Sets the id of the process.void
setProcessInactive
(boolean isProcessInactive) Sets whether the process is inactive after the upgrade.
-
Constructor Details
-
ProcessUpgrade
public ProcessUpgrade()Creates a blank instance. -
ProcessUpgrade
Creates an instance with the specified process id and result code.- Parameters:
processId
- the id of the processoutcome
- the code indicating the outcome of the attempted upgrade
-
-
Method Details
-
setProcessId
Sets the id of the process.- Parameters:
processId
- the id of the process
-
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 fromProcessExecutionService.upgradeProcesses(Long, String, Long[])
andProcessExecutionService.upgradeProcesses(Long, String, Long, String[])
for all outcomes other thanProcessUpgrade.Outcome.SUCCESS
. The processes may indeed be inactive for other outcomes, but this will not be checked.- Returns:
- whether the process is inactive
-
setOutcome
Sets the result code indicating the outcome of the attempted upgrade.- Parameters:
outcome
- the outcome
-
getOutcome
Gets the result code indicating the outcome of the attempted upgrade. -
getOutcomes
Extracts the outcomes from the specified ProcessUpgrade objects.- Parameters:
results
- the ProcessUpgrade objects from which to extract the outcomes- Returns:
- the extracted outcomes
-
getProcessIds
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 idsoutcomes
- the outcomes to filter for- Returns:
- the extracted process ids
-
compareTo
Compares the specified object with this UpgradeProcessResult for order. Order is determined by comparing their process ids.- Specified by:
compareTo
in interfaceComparable<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
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. -
hashCode
public int hashCode()Returns a hash code for the object.
-