Class AfterTaskTriggerFactory

java.lang.Object
com.inet.taskplanner.server.api.common.AbstractFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>
com.inet.taskplanner.server.api.common.SeriesIndependentFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>
com.inet.taskplanner.server.api.trigger.TriggerFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger>
com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTriggerFactory
All Implemented Interfaces:
com.inet.plugin.NamedExtension

public class AfterTaskTriggerFactory extends TriggerFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger>
Factory for AfterTaskTrigger.
Since:
taskplanner 26.4
  • Field Details

    • EXTENSION_NAME

      public static final String EXTENSION_NAME
      Extension name of this trigger.
      See Also:
    • PROPERTY_SOURCE_TASK_ID

      public static final String PROPERTY_SOURCE_TASK_ID
      Property key for the selected source task ID.
      See Also:
    • PROPERTY_COMPLETION_MODE

      public static final String PROPERTY_COMPLETION_MODE
      Property key for the completion mode.
      See Also:
    • VALUE_COMPLETION_ALWAYS

      public static final String VALUE_COMPLETION_ALWAYS
      Trigger should execute after each finished execution.
      See Also:
    • VALUE_COMPLETION_SUCCESS

      public static final String VALUE_COMPLETION_SUCCESS
      Trigger should execute only after successful executions.
      See Also:
    • VALUE_COMPLETION_FAILURE

      public static final String VALUE_COMPLETION_FAILURE
      Trigger should execute only after failed executions.
      See Also:
  • Constructor Details

  • Method Details

    • createInstanceFrom

      protected @Nonnull com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger createInstanceFrom(@Nonnull TriggerDefinition definition, @Nullable com.inet.id.GUID taskID)
      Construct a component (PRODUCT) from the given definition.
      Overrides:
      createInstanceFrom in class AbstractFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>
      Parameters:
      definition - the definition holding information for the PRODUCT
      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:
      a new PRODUCT
    • getInformation

      public @Nonnull TriggerInfo getInformation(@Nullable com.inet.id.GUID taskID)
      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 taskPlanner GUI. This are display-infos or available options to configure. The returned information contains fields which describes the values a user can specify in the WEB GUI. The field is also responsible to replace any placeholders for the corresponding property in a serial task. That means properties without a field definition will not get any series placeholder replaced.

      If you implement a factory for a component only to be used by API, only then you can return null here.

      Specified by:
      getInformation in class AbstractFactory<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:
      validate in class SeriesIndependentFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>
      Parameters:
      definition - the definition to validate
      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.
      Throws:
      ValidationException - if the component has some errors
    • getSummary

      public @Nonnull SummaryInfo getSummary(@Nonnull TriggerDefinition definition)
      Construct Summary infos for the component represented by given definition.

      The summary info is used when the webgui displays the component.

      When implementing a factory for a component only to be used per API, only then you can return null here.

      Specified by:
      getSummary in class AbstractFactory<com.inet.taskplanner.server.api.trigger.aftertask.AfterTaskTrigger, TriggerDefinition, TriggerInfo, SummaryInfo>
      Parameters:
      definition - the definition with the settings made by a user
      Returns:
      summary infos containing text lines to be displayed in the webgui 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

      protected @Nonnull List<com.inet.id.GUID> getAvailableTaskIDs(@Nullable com.inet.id.GUID ownerId)
      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

      protected @Nullable TaskDefinition getTaskDefinition(@Nonnull com.inet.id.GUID taskID)
      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 ID
      taskExecution - execution of the target task
      Returns:
      localized options for source-task selection
      Since:
      26.4