@PublicApi
public interface EffectorProcessManager
Effector
preview, effect application, and undo background
processes.Modifier and Type | Method and Description |
---|---|
void |
acknowledgeFinished(long processId)
Sets the "acknowledged" flag for a finished process, so it is no longer
shown in the list of current processes.
|
void |
cancel(long processId)
Asks a process to stop.
|
void |
confirm(long processId)
Starts applying effects for an existing process with a calculated
preview.
|
void |
confirm(long processId,
Collection<Integer> effectIndices)
Deprecated.
|
void |
deleteCalculated(long processId)
Deletes a calculated process so that it is no longer shown in the list
of processes.
|
List<EffectorProcess> |
findProcesses(ApplicationUser user,
EffectorProcess.Status status,
Long structureId)
Finds effector processes by owner, status, or structure ID.
|
List<EffectRecord> |
getEffectRecords(long processId)
Retrieves the list of effect records that describe the changes made by
the given effector process or the errors that occurred while applying
effects.
|
EffectorProcess |
getProcess(long processId)
Retrieves the current state of the process.
|
List<EffectorProcess> |
getRunningProcessesForUser(ApplicationUser user)
Finds all effector processes for the given user, except finished
processes for which the "acknowledged" flag is set.
|
void |
resumeInterrupted(long processId)
Moves an interrupted process back to the apply queue to resume applying
previously calculated effects in its preview.
|
long |
startProcess(List<EffectorInstance> effectorInstances,
long structureId,
boolean requiresConfirmation)
Starts a new effector process for installed effector instances.
|
long |
startProcess(String moduleKey,
Map<String,Object> parameters,
ForestSpec forestSpec,
boolean requiresConfirmation)
Starts a one-off effector process.
|
long |
startUndoProcess(long processId,
Collection<Integer> recordIndexes)
Starts a new process which undoes the effects performed by an earlier
process.
|
void |
validateStartProcess(List<EffectorInstance> effectorInstances,
long structureId)
Checks whether an effector process can be started, as if by calling
startProcess(List, long, boolean) , without actually starting it. |
void |
validateStartProcess(String moduleKey,
Map<String,Object> parameters,
ForestSpec forestSpec)
Checks whether an effector process can be started, as if by calling
startProcess(String, Map, ForestSpec, boolean) , without actually starting it. |
void validateStartProcess(@NotNull List<EffectorInstance> effectorInstances, long structureId) throws StructureException
startProcess(List, long, boolean)
, without actually starting it.
Returns normally if such a process can be started, throws a
StructureException
otherwise.effectorInstances
- effector instances to run, the scope is defined by
the structure ID and positionstructureId
- ID of the structure for which effects are calculated.StructureException
- if the process cannot be started, e.g. due to
missing permissions or other problems.void validateStartProcess(@NotNull String moduleKey, @NotNull Map<String,Object> parameters, @NotNull ForestSpec forestSpec) throws StructureException
startProcess(String, Map, ForestSpec, boolean)
, without actually starting it.
Returns normally if such a process can be started, throws a
StructureException
otherwise.moduleKey
- complete module key of the effectorparameters
- effector parametersforestSpec
- forest spec, the scope will be the whole forestStructureException
- if the process cannot be started, e.g. due to
missing permissions or other problems.long startProcess(@NotNull List<EffectorInstance> effectorInstances, long structureId, boolean requiresConfirmation) throws StructureException
effectorInstances
- effector instances to run, the scope is defined by
the structure id and positionstructureId
- id of the structure for which effects are calculated.requiresConfirmation
- if false
, don't wait for confirmation, start applying
effects as soon as the preview is ready (if successful).StructureException
- if the process cannot be started, e.g. due to
missing permissions or other problems.long startProcess(@NotNull String moduleKey, @NotNull Map<String,Object> parameters, @NotNull ForestSpec forestSpec, boolean requiresConfirmation) throws StructureException
moduleKey
- complete module key of the effectorparameters
- effector parametersforestSpec
- forest spec, the scope will be the whole forestrequiresConfirmation
- if false
, don't wait for confirmation, start applying
effects as soon as the preview is ready (if successful).StructureException
- missing permissions, no such effector module,
missing or invalid parameters, invalid forest spec, other problemslong startUndoProcess(long processId, @Nullable Collection<Integer> recordIndexes) throws StructureException
Starts a new process which undoes the effects performed by an earlier
process. The process being undone must be in
COMPLETED
,
COMPLETED_WITH_ERRORS
,
APPLY_INTERRUPTED
,
or APPLY_STOPPED
status.
The current user will be the new process owner. This method will throw
a StructureException
if the current user is not the owner of the
process identified by processId
and not a Jira admin.
The new process proceeds to the apply queue immediately.
processId
- the process id whose effects are to be undonerecordIndexes
- the effect record indexes to be undone, or
null
for all process recordsStructureException
- no access to process, process doesn't exist or
is not finished, or its effect records cannot be found@NotNull EffectorProcess getProcess(long processId) throws StructureException
Retrieves the current state of the process.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process or process doesn't exist@NotNull List<EffectRecord> getEffectRecords(long processId) throws StructureException
Retrieves the list of effect records that describe the changes made by
the given effector process or the errors that occurred while applying
effects. Can be non-empty if the process is in one of the following
statuses: IN_PROGRESS
,
COMPLETED
,
COMPLETED_WITH_ERRORS
,
APPLY_INTERRUPTED
,
or APPLY_STOPPED
.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process or process doesn't existvoid confirm(long processId) throws StructureException
Starts applying effects for an existing process with a calculated
preview. The process must be in the CALCULATED
status.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process, or it doesn't exist, is not
in the CALCULATED
status@Deprecated void confirm(long processId, @Nullable Collection<Integer> effectIndices) throws StructureException
confirm(long)
instead.processId
- process IDeffectIndices
- used to filter effects from the preview.StructureException
- no access to process, or it doesn't exist, is not
in the CALCULATED
status, or no
effects can be found in the preview for the given indicesvoid cancel(long processId) throws StructureException
Asks a process to stop. The operation is asynchronous, so there is no guarantee that process will be stopped after this call.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process or process doesn't existvoid acknowledgeFinished(long processId) throws StructureException
Sets the "acknowledged" flag for a finished process, so it is no longer
shown in the list of current processes. The process must be in the
COMPLETED
,
COMPLETED_WITH_ERRORS
,
APPLY_INTERRUPTED
,
or APPLY_STOPPED
status.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process, or process doesn't exist,
or it is not in one of the "finished" statusesvoid deleteCalculated(long processId) throws StructureException
Deletes a calculated process so that it is no longer shown in the list
of processes. The process must be in the
CALCULATED
,
CALCULATION_STOPPED
,
or CALCULATION_FAILED
status.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process, or process doesn't exist,
or it is not in one of the "calculated" statusesvoid resumeInterrupted(long processId) throws StructureException
Moves an interrupted process back to the apply queue to resume applying
previously calculated effects in its preview. The process must be in the
APPLY_INTERRUPTED
status.
This method will throw a StructureException
if the current user
is not the process owner and not a Jira admin.
processId
- process IDStructureException
- no access to process, or process doesn't exist,
or it is not in the "interrupted" status@NotNull List<EffectorProcess> findProcesses(@Nullable ApplicationUser user, @Nullable EffectorProcess.Status status, @Nullable Long structureId)
Finds effector processes by owner, status, or structure ID. The three
criteria are combined by logical AND. Passing null
for any
parameter means no restriction.
This method does not check the current user's access to the returned processes.
user
- process owner, pass null
for all ownersstatus
- process status, pass null
for all statusesstructureId
- structure ID, pass null
for all structures@NotNull List<EffectorProcess> getRunningProcessesForUser(@NotNull ApplicationUser user)
Finds all effector processes for the given user, except finished processes for which the "acknowledged" flag is set.
This method does not check the current user's access to the returned processes.
user
- the userCopyright © 2024 Tempo Software. All Rights Reserved.