public interface Task extends ExecutableObject
Title: Service Event Fabric Core
Description: Defines a Task.
Copyright: Copyright (c) 2019
Company: StreamScape Technologies
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
START_TASK_NAME |
static java.util.UUID |
START_TASK_OID |
Modifier and Type | Method and Description |
---|---|
void |
disableResumptionOn(TaskState state)
Deselects the specified state as a 'resuming' state, disallowing to start execution of a next task
if the current task was not completed properly and moved to this 'bad' state.
|
void |
disableResumptionTotally()
Deselects any supported task state as a 'resuming' state, disallowing to start execution of a next task
if the current task was not completed properly and moved to this 'bad' state.
|
void |
enableResumptionOn(TaskState state)
Marks the specified state as a 'resuming' state, allowing to start execution of a next task
even if the current task was not completed properly and moved to this 'bad' state.
|
void |
enableResumptionTotally()
Marks each supported task state as a 'resuming' state, allowing to start execution of a next task
even if the current task was not completed properly and moved to this 'bad' state.
|
java.lang.String |
getAfterTaskName()
Returns a name of the task the current task will be executed after.
|
java.util.UUID |
getAfterTaskOID()
Returns a unique identifier of the task the current task will be executed after.
|
Task |
getConsequent()
Returns a task executed after the current task.
|
ExceptionTask |
getExceptionTask()
Returns the Exception Task associated with this task.
|
TaskExecution |
getExecution()
Returns an object containing information about the current execution of the task.
|
static java.lang.String |
getFullName(java.lang.String listName,
java.lang.String taskName)
Returns a fully-qualified name of the task.
|
int |
getOrder()
Returns an order of the task in the execution chain of the task list (indexing starts with
1 ). |
java.lang.String |
getOwner()
Returns a name of the owner (user or group) of the task.
|
Task |
getPrecedent()
Returns a task after which the current task will be executed.
|
RuleSet |
getRuleSet()
Returned thr Rule Set assigned to this task.
|
TaskState |
getState()
Returns a state of the task.
|
TaskList |
getTaskList()
Returns the task list that holds this task.
|
java.lang.Long |
getTaskWindow()
Returns a time interval available for execution of the task.
|
java.util.concurrent.TimeUnit |
getTaskWindowUnit()
Returns a time unit for the
taskWindow parameter. |
TaskType |
getType()
Returns a type of the task.
|
double |
getWeight()
Returns a weight of the task.
|
boolean |
isAutoComplete()
Checks if the task is completed automatically and immediately starts execution of its script.
|
boolean |
isResumptionEnabledOn(TaskState state)
Checks if the specified state is marked as a 'resuming' state for this task.
|
boolean |
isResumptionEnabledTotally()
Checks if each supported task state is marked as a 'resuming' state.
|
java.util.List |
listEventIds()
Returns a list of all event ids that can be raised by the task.
|
java.util.List |
listResumptionStates()
Returns a list of states that are marked as 'resuming' states for this task.
|
void |
setAfterTask(java.lang.String taskName)
Sets a name of the task the current task will be executed after.
|
void |
setTaskWindow(long taskWindow)
Sets the specified task window.
|
void |
setTaskWindowUnit(java.util.concurrent.TimeUnit unit)
Sets the specified task window unit.
|
void |
setWeight(byte weight)
Sets the specified weight of the task.
|
void |
undo()
Resets the state of the current execution, forcing the task to retry its execution.
|
void |
undo(long delay)
Resets the state of the current execution, forcing the task to retry its execution after the specified delay (in seconds).
|
addTag, clearProperties, clearTags, existsProperty, existsTag, getEndTimeMsec, getExpirationDate, getMetadata, getProperties, getProperty, getPropertyList, getPropertyResolved, listTags, putProperty, removeProperty, removeTag, setMetadata
getAuthor, getCreationTime, getLastUpdateTime, getOID
getDescription, setDescription, setName
getName
static final java.lang.String START_TASK_NAME
static final java.util.UUID START_TASK_OID
static java.lang.String getFullName(java.lang.String listName, java.lang.String taskName)
java.lang.String getOwner()
This method MUST NOT be used if the task is deserialized from any format (for example, on the remote side).
Use AbstractSchedulerObject.getOwner()
instead.
getOwner
in interface SchedulerObject
TaskType getType()
TaskList getTaskList()
This method returns null
if the object is deserialized from any format (for example, on the remote side).
java.util.UUID getAfterTaskOID()
setAfterTask(String)
for further information.java.lang.String getAfterTaskName()
setAfterTask(String)
for further information.
This method MUST NOT be used if the task is deserialized from any format (for example, on the remote side).
Use getAfterTaskOID()
instead.
void setAfterTask(java.lang.String taskName) throws SchedulerException
taskName
is null
the existing State Transition is removed.
START_TASK_NAME
should be used to create a starting State Transition.taskName
- the name of the task the current task will be executed after.SchedulerException
- if the specified task does not exist or
if the State Transition being created is invalid.Task getPrecedent()
null
is returned.Task getConsequent()
null
is returned.RuleSet getRuleSet()
java.lang.Long getTaskWindow()
void setTaskWindow(long taskWindow)
getTaskWindow()
for further information.setTaskWindow
in interface ExecutableObject
taskWindow
- the value to be set.java.util.concurrent.TimeUnit getTaskWindowUnit()
taskWindow
parameter.
TimeUnit.SECONDS
.taskWindow
parameter.void setTaskWindowUnit(java.util.concurrent.TimeUnit unit) throws SchedulerException
getTaskWindowUnit()
for further information.setTaskWindowUnit
in interface ExecutableObject
unit
- the value to be set.SchedulerException
- if the unit is null
.boolean isResumptionEnabledOn(TaskState state)
enableResumptionOn(TaskState)
for further details.state
- the state to be checked.true
if the specified state is allowed for resumption of the chain, false
otherwise.boolean isResumptionEnabledTotally()
enableResumptionOn(TaskState)
for further details.true
if each supported task state is allowed for resumption of the chain, false
otherwise.java.util.List listResumptionStates()
enableResumptionOn(TaskState)
for further details.void enableResumptionOn(TaskState state) throws SchedulerException
enableResumptionOn
in interface ExecutableObject
state
- the state to be marked as a resuming state.SchedulerException
- if the specified state is not supported as a resuming state or
if the operation is not supported.void enableResumptionTotally() throws SchedulerException
enableResumptionOn(TaskState)
for further details.enableResumptionTotally
in interface ExecutableObject
SchedulerException
- if the operation is not supported.void disableResumptionOn(TaskState state) throws SchedulerException
enableResumptionOn(TaskState)
for further details.disableResumptionOn
in interface ExecutableObject
SchedulerException
- if the specified state is not supported as a resuming state or
if the operation is not supported.void disableResumptionTotally() throws SchedulerException
enableResumptionOn(TaskState)
for further details.disableResumptionTotally
in interface ExecutableObject
SchedulerException
- if the operation is not supported.double getWeight()
void setWeight(byte weight) throws SchedulerException
weight
- the weight to be set.SchedulerException
- if the specified weight has a wrong value or
if the operation is not supported.boolean isAutoComplete()
SchedulerCompletionEvent
to be completed or failed.
User must send this event manually (with failed
flag is set to false
or true
).true
if the task is autocomplete, false
otherwise.TaskState getState()
TaskExecution getExecution()
null
.null
if the task is not currently running.java.util.List listEventIds()
ExceptionTask getExceptionTask()
null
if the task is an Exception Task itself.int getOrder()
1
).
-1
if the task list is not enabled or is in UNORDERED
mode.
This method MUST NOT be used if the task is deserialized from any format (for example, on the remote side).
Use TaskList.getTaskOrder(String)
instead.
void undo() throws SchedulerException
This method is only applicable to Action Task.
This method is only applicable if the task is currently running.
SchedulerException
- if the operation is not supported.void undo(long delay) throws SchedulerException
This method is only applicable to Action Task.
This method is only applicable if the task is currently running.
delay
- the delay (in seconds) before retrying the task.SchedulerException
- if the specified delay is a negative number or
if the task is not currently running or
if the operation is not supported.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.