Class AfterTaskTriggerFactory
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
AfterTaskTrigger.- Since:
- taskplanner 26.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringExtension name of this trigger.static final StringProperty key for the completion mode.static final StringProperty key for the selected source task ID.static final StringTrigger should execute after each finished execution.static final StringTrigger should execute only after failed executions.static final StringTrigger should execute only after successful executions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nonnull com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTriggercreateInstanceFrom(@Nonnull TriggerDefinition definition, @Nullable com.inet.id.GUID taskID) Constructs a component (PRODUCT) from the given definition.protected @Nonnull List<com.inet.id.GUID> getAvailableTaskIDs(@Nullable com.inet.id.GUID ownerId) Resolve available tasks for the source-task selection.@Nonnull TriggerInfogetInformation(@Nullable com.inet.id.GUID taskID) Returns an information object about components which can be produced with this factory.protected @Nonnull List<com.inet.config.structure.model.LocalizedKey> getSelectableTaskNames(@Nullable com.inet.id.GUID taskID, @Nullable TaskExecution taskExecution) Build the selectable source-task names for the settings UI.@Nonnull SummaryInfogetSummary(@Nonnull TriggerDefinition definition) Constructs summary information for the component represented by the given definition.protected @Nullable TaskDefinitiongetTaskDefinition(@Nonnull com.inet.id.GUID taskID) Resolve a task definition by ID.protected @Nullable TaskExecutiongetTaskExecution(@Nullable com.inet.id.GUID taskID) Resolve current task execution for task-specific filtering.protected @Nullable com.inet.id.GUIDparseTaskID(@Nullable String taskID) Parse task ID from a persisted value.voidvalidate(@Nonnull TriggerDefinition definition, @Nullable com.inet.id.GUID taskID) Validate the given definition.protected voidvalidateNoAfterTaskLoop(@Nullable com.inet.id.GUID currentTaskID, @Nonnull com.inet.id.GUID selectedSourceTaskID, @Nonnull List<com.inet.id.GUID> availableTaskIDs) Validate that choosing the source task does not create a cycle in after-task dependencies.protected booleanwouldCreateDependencyLoop(@Nonnull com.inet.id.GUID currentTaskID, @Nonnull com.inet.id.GUID selectedSourceTaskID, @Nonnull List<com.inet.id.GUID> availableTaskIDs) Check whether choosing the selected source task for the current task forms a cycle in the combined graph of AfterTask triggers and NextTask actions.Methods inherited from class TriggerFactory
getNextExecutionTimesMethods inherited from class SeriesIndependentFactory
createFrom, updateValuesMethods inherited from class AbstractFactory
checkDefinitionArgument, createInstanceFrom, getExtensionName, getInformation, getKeywords, isAvailable, isSupportedForSystemTasks
-
Field Details
-
EXTENSION_NAME
-
PROPERTY_SOURCE_TASK_ID
Property key for the selected source task ID.- See Also:
-
PROPERTY_COMPLETION_MODE
-
VALUE_COMPLETION_ALWAYS
Trigger should execute after each finished execution.- See Also:
-
VALUE_COMPLETION_SUCCESS
Trigger should execute only after successful executions.- See Also:
-
VALUE_COMPLETION_FAILURE
Trigger should execute only after failed executions.- See Also:
-
-
Constructor Details
-
AfterTaskTriggerFactory
-
-
Method Details
-
createInstanceFrom
protected @Nonnull com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger createInstanceFrom(@Nonnull TriggerDefinition definition, @Nullable com.inet.id.GUID taskID) Constructs a component (PRODUCT) from the given definition.- Overrides:
createInstanceFromin classAbstractFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
definition- the definition holding information for the PRODUCTtaskID- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Returns:
- a new PRODUCT
-
getInformation
Returns an information object about components which can be produced with this factory.The returned info contains information about how such a component is to be presented in the Task Planner web GUI. This includes display information and available configuration options. The returned information contains
fieldsthat describe the values a user can specify in the web GUI. The fields are also responsible for replacing placeholders for the corresponding property in aserialtask. That means properties without a field definition will not get any series placeholder replaced.If you implement a factory for a component used only through the API, you can return null here.
- Specified by:
getInformationin classAbstractFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
taskID- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Returns:
- an information object for components this factory can produce
-
validate
public void validate(@Nonnull TriggerDefinition definition, @Nullable com.inet.id.GUID taskID) throws ValidationException Validate the given definition.The given definition is guaranteed to belong to this factory
- Specified by:
validatein classSeriesIndependentFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
definition- the definition to validatetaskID- the ID of the task the definition belongs or will belong to, for optional use. Can be null if the operation is done for a non-saved task.- Throws:
ValidationException- if the component has some errors
-
getSummary
Constructs summary information for the component represented by the given definition.The summary information is used when the web GUI displays the component.
When implementing a factory for a component to be used only through the API, you can return null here.
- Specified by:
getSummaryin classAbstractFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
definition- the definition with the settings made by a user- Returns:
- summary information containing text lines to be displayed in the web GUI for this component.
-
getTaskExecution
protected @Nullable TaskExecution getTaskExecution(@Nullable com.inet.id.GUID taskID) throws com.inet.permissions.AccessDeniedException Resolve current task execution for task-specific filtering.- Parameters:
taskID- the configured target task ID- Returns:
- execution of the configured task, or null if no task is given
- Throws:
com.inet.permissions.AccessDeniedException- if current user cannot read the task- Since:
- 26.4
-
getAvailableTaskIDs
Resolve available tasks for the source-task selection.- Parameters:
ownerId- owner of the configured target task, null for system tasks- Returns:
- IDs of selectable source tasks
- Since:
- 26.4
-
getTaskDefinition
Resolve a task definition by ID.- Parameters:
taskID- ID of the task- Returns:
- task definition, or null if the task no longer exists
- Since:
- 26.4
-
getSelectableTaskNames
protected @Nonnull List<com.inet.config.structure.model.LocalizedKey> getSelectableTaskNames(@Nullable com.inet.id.GUID taskID, @Nullable TaskExecution taskExecution) Build the selectable source-task names for the settings UI.- Parameters:
taskID- current target task IDtaskExecution- execution of the target task- Returns:
- localized options for source-task selection
- Since:
- 26.4
-
validateNoAfterTaskLoop
protected void validateNoAfterTaskLoop(@Nullable com.inet.id.GUID currentTaskID, @Nonnull com.inet.id.GUID selectedSourceTaskID, @Nonnull List<com.inet.id.GUID> availableTaskIDs) throws ValidationException Validate that choosing the source task does not create a cycle in after-task dependencies.- Parameters:
currentTaskID- ID of the task currently configuredselectedSourceTaskID- source task chosen in the trigger settingsavailableTaskIDs- visible/selectable tasks for the current owner context- Throws:
ValidationException- if the selected source introduces a dependency loop- Since:
- 26.4
-
wouldCreateDependencyLoop
protected boolean wouldCreateDependencyLoop(@Nonnull com.inet.id.GUID currentTaskID, @Nonnull com.inet.id.GUID selectedSourceTaskID, @Nonnull List<com.inet.id.GUID> availableTaskIDs) Check whether choosing the selected source task for the current task forms a cycle in the combined graph of AfterTask triggers and NextTask actions.- Parameters:
currentTaskID- ID of the task currently configuredselectedSourceTaskID- source task chosen in the trigger settingsavailableTaskIDs- visible/selectable tasks for the current owner context- Returns:
- true if a loop would be created
- Since:
- 26.4
-
parseTaskID
Parse task ID from a persisted value.- Parameters:
taskID- task ID as string- Returns:
- parsed GUID or null if input is null/invalid
- Since:
- 26.4
-