Class ResultActionFactory<T extends ResultAction>

  • Type Parameters:
    T - the concrete type of the Job implementation
    All Implemented Interfaces:
    com.inet.plugin.NamedExtension
    Direct Known Subclasses:
    EmailResultActionFactory

    public abstract class ResultActionFactory<T extends ResultAction>
    extends SeriesDependentFactory<T,​ResultActionDefinition,​ResultActionInfo,​SummaryInfo>
    Base class for factories producing ResultAction components.

               ResultActionDefinition ----> ResultActionFactory ----> ResultAction
     

    See documentation of AbstractFactory for more information about the life cycle.

    When a factory is implemented, use ServerPluginManager.register(Class, Object) with ResultActionFactory.class as first argument:

    spm.register(ResultActionFactory.class, new RabbitActionFactory());

    Implementations sample: because the extensionName must be unique and must be used when a ResultActionDefinition is created by API, it is recommended to set up a public constant with the extensionName:

    
     public class RabbitActionFactory extends RabbitActionFactory<RabbitAction> {
          public static final String EXTENSION_NAME = "resultAction.rabbit";
    
          public RabbitActionFactory(){
              super(EXTENSION_NAME);
          }
    
    
          @Override
          protected RabbitAction createInstanceFrom( ResultActionDefinition definition, GUID taskID ) {
              RabbitAction action = new RabbitAction();
              //put values from definition to RabbitAction impl
              ...
    
              return action;
          }
    
          ...
          //somewhere using public API
          ResultActionDefinition rabbitAction = new ResultActionDefinition(RabbitActionFactory.EXTENSION_NAME);
          //configure it
          ...
    
     
    Since:
    taskplanner 3.0
    • Constructor Detail

      • ResultActionFactory

        public ResultActionFactory​(java.lang.String extensionName)
        Creates a new ResultActionFactory instance.
        Parameters:
        extensionName - the unique name of the ResultAction this factory can produce. ResultActionDefinitions for this kind of action must have the same extensionName.
        Since:
        taskplanner 3.0
    • Method Detail

      • getSupportedFlavors

        public abstract java.util.List<ResultFlavor> getSupportedFlavors​(ResultActionDefinition definition)
        Returns the list of flavors, supported by this action for the given definition.
        Parameters:
        definition - the current definition settings
        Returns:
        the list of result flalvors that are currently supported according to the given definition.
        Since:
        taskplanner 3.0
      • isAutoResolvePlaceholders

        public boolean isAutoResolvePlaceholders()
        Defines whether placeholders will be automatically replaced before the handle method is called. The default implementation returns true.
        The automatic replacement will ask all fields, defined by the factory, to resolve all placeholders that match a field key and supports placeholders.

        For manual replacement, the PlaceholderResolver can be used.
        Returns:
        true if the placeholders shall be resolve automatically, false if the implementation needs to manage this by themself.
        Since:
        taskplanner 3.0
      • hasPlaceholderSet

        public boolean hasPlaceholderSet​(java.lang.String value,
                                         com.inet.id.GUID taskID)
        Returns whether the given value contains at least one of the available placeholders of the task.
        Parameters:
        value - the value to be checked for placeholders
        taskID - the unique ID of the task containing the current action
        Returns:
        true if the value contains at least one placeholder, false otherwise
        Since:
        taskplanner 3.0