Class TimeTriggerFactory
- All Implemented Interfaces:
com.inet.plugin.NamedExtension
Since version 22.4, this also handles TimeTriggerForCustomSettings.
- Since:
- taskplanner 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringExtension name of the time trigger to use intriggerDefinitions.static final StringKey for the repeat-interval of this trigger.static final StringKey for the start day, which specifies the earliest day for execution.static final StringKey for the start time, which specifies the hour and minute of the day when this trigger fires.static final StringKey for the Monthly day setting, which determines on which day of the month this trigger fires. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidFOR INTERNAL USE ONLY.protected TriggercreateInstanceFrom(TriggerDefinition definition, com.inet.id.GUID taskID) Constructs a component (PRODUCT) from the given definition.getInformation(com.inet.id.GUID taskID) Returns an information object about components which can be produced with this factory.getNextExecutionTimes(TriggerDefinition definition) Returns the calculated times of the next executions.getSummary(TriggerDefinition definition) Constructs summary information for the component represented by the given definition.updateValues(TriggerDefinition definition, com.inet.id.GUID taskID) Updates values according to the given definition.voidvalidate(TriggerDefinition triggerDefinition, com.inet.id.GUID taskID) Validate the given definition.Methods inherited from class SeriesIndependentFactory
createFromMethods inherited from class AbstractFactory
checkDefinitionArgument, createInstanceFrom, getExtensionName, getInformation, getKeywords, isAvailable, isSupportedForSystemTasks
-
Field Details
-
EXTENSION_NAME
Extension name of the time trigger to use intriggerDefinitions.- See Also:
-
PROP_START_DAY
Key for the start day, which specifies the earliest day for execution. The value must be a number containing the milliseconds since 1 January 1970 GMT.- See Also:
-
PROP_START_TIME
Key for the start time, which specifies the hour and minute of the day when this trigger fires. The value must be a number containing the milliseconds since 1 January 1970 GMT. Only the hour and minute are used.- See Also:
-
PROP_REPEAT_SELECT
Key for the repeat-interval of this trigger. Value must be a String representation of theRepeatIntervalenum or null.- See Also:
-
PROP_WHICH_SELECT
Key for the Monthly day setting, which determines on which day of the month this trigger fires. The value must be a string representation of theMonthlyDayenum.- See Also:
-
-
Constructor Details
-
TimeTriggerFactory
public TimeTriggerFactory()Creates a new TimeTriggerFactory instance.- Since:
- taskplanner 3.0
-
-
Method Details
-
createInstanceFrom
Constructs a component (PRODUCT) from the given definition.- Overrides:
createInstanceFromin classAbstractFactory<Trigger, 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<Trigger, 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
-
addTimeZoneDifferenceHintIfRequired
-
updateValues
Updates values according to the given definition.The given definition is guaranteed to belong to this factory.
- Overrides:
updateValuesin classSeriesIndependentFactory<Trigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
definition- the definition with the current propertiestaskID- the ID of the task the definition belongs or will belong to, for optional use- Returns:
- a map of property keys and their changed values
-
validate
public void validate(TriggerDefinition triggerDefinition, 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<Trigger, TriggerDefinition, TriggerInfo, SummaryInfo>- Parameters:
triggerDefinition- 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<Trigger, 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.
-
getNextExecutionTimes
Returns the calculated times of the next executions. If the trigger is, for example, event-based and does not provide a time,nullis returned. If a time-based trigger is configured incorrectly or has no future executions, an empty list is returned.- Overrides:
getNextExecutionTimesin classTriggerFactory<Trigger>- Parameters:
definition- the current definition where to get the next executions for- Returns:
- the calculated times of the next executions. Normally three future executions are returned, or fewer if there are not three more from now.
-