Class FcTimePointHandler
- java.lang.Object
-
- de.xima.fc.workflow.designer.registry.triggers.FcTimePointHandler
-
- All Implemented Interfaces:
IResourceBundleLocator,IElementHandler<FcTimePointProps,WorkflowTrigger>,IRefinedTriggerDataDescriptor<FcTimePointProps>,ITriggerDataDescriptor,ICustomParametersUpdateable,IWorkflowElementTypeProviding,IBeanValidatingElement<FcTimePointProps,WorkflowTrigger>,IBeanValidatingTrigger<FcTimePointProps>,IKeyValueSummarizableElement<FcTimePointProps,WorkflowTrigger>,IKeyValueSummarizableTrigger<FcTimePointProps>,IOfficialHelpPageElement<FcTimePointProps,WorkflowTrigger>,IOfficialHelpPageTrigger<FcTimePointProps>,ISingleElementPrototype<FcTimePointProps,WorkflowTrigger>,ISingleTriggerPrototype<FcTimePointProps>,ISpecificTriggerListener<FcTimePointProps>,ITriggerHandler<FcTimePointProps>,IWorkflowTriggerTypeProviding,IListenerRegistrator,IOrderable,ISingleBaseBuiltinTriggerPrototype<FcTimePointProps>,ISingleBuiltinTriggerPrototype<FcTimePointProps>,IBuiltinResourcesHandler<FcTimePointProps,WorkflowTrigger>,IBaseTrigger<FcTimePointProps>,IBuiltinTriggerType<FcTimePointProps>,ISingleBaseTriggerPrototype<FcTimePointProps>,IFcTimePointDescriptors,Comparable<IOrderable>
@Immutable public final class FcTimePointHandler extends Object implements ITriggerHandler<FcTimePointProps>, IBaseTrigger<FcTimePointProps>, IBuiltinResourcesHandler<FcTimePointProps,WorkflowTrigger>, IBuiltinTriggerType<FcTimePointProps>, IFcTimePointDescriptors, IKeyValueSummarizableTrigger<FcTimePointProps>, ISingleBaseBuiltinTriggerPrototype<FcTimePointProps>, ISpecificTriggerListener<FcTimePointProps>
TheITriggerHandlerfor nodes of typeEWorkflowTriggerType.FC_TIME_POINT.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
CURRENT_HANDLER_VERSION
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)EWorkflowTriggerTypegetBuiltinType()Class<FcTimePointProps>getDataModelClass()Returns the class of the custom properties used by the elements handled by this element logic handler.ISummaryKeyValueModelgetElementSummaryKeyValueModel(IGetElementSummaryParams<FcTimePointProps> params)static FcTimePointHandlergetInstance()IElementCategorygetMainCategory(IGetElementPrototypesParams params)Class<? extends ITriggerPropertiesBean<FcTimePointProps>>getPropertiesBeanClass()Returns the class of the bean that should be used when editing the properties of a workflow element.URLgetPropertiesViewXhtml()This method must return the path to the XHTML page for the custom user interface.FcTimePointPropsgetPrototypeModelData(String label, IGuiIcon icon, IGetElementPrototypesParams params)This default implementation returns a new instance of theTDataproperties model, pre-filled with the label and icon (BaseActionProps.getName()andBaseActionProps.getIcon()).IElementCategorygetSubCategory(IGetElementPrototypesParams params)Optional sub category.inthashCode()booleanisPreconditionSatisfied(ITriggerPreconditionSatisfiedParams<FcTimePointProps> params)Called once the task of a trigger is about to be executed.voidregister()Invoked by the system and may perform whatever setup logic is required.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IBeanValidatingElement
getValidationGroups, validateLocal
-
Methods inherited from interface de.xima.fc.workflow.designer.registry.IBuiltinResourcesHandler
getCascadingStyleSheet, getJavaScript
-
Methods inherited from interface de.xima.fc.workflow.mixin.IBuiltinTriggerType
getOfficialHelpPagePath, getType, isAvailable
-
Methods inherited from interface de.xima.fc.interfaces.workflow.ICustomParametersUpdateable
updateCustomParams
-
Methods inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
extractDescription, extractName, extractSearchTerms, getCascadingStyleSheet, getDisplayLabel, getFastJsonConverter, getFilterCriteriaForEntities, getJavaScript, getResourceBundle, getVersion, isHasUserVisibleName, readEntityReferences, readPlaceholders, validateGlobal, writeEntityReferences, writePlaceholders
-
Methods inherited from interface de.xima.fc.workflow.retval.trigger.IFcTimePointDescriptors
getTriggerDataDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IKeyValueSummarizableElement
getElementSummaryModel, getElementSummaryXhtml
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.IOfficialHelpPageElement
getHelpPageLocation
-
Methods inherited from interface de.xima.fc.listener.IOrderable
compareTo, shouldBeAfter
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IRefinedTriggerDataDescriptor
getTriggerDataDescriptor, getTriggerFilesDescriptor
-
Methods inherited from interface de.xima.fc.workflow.mixin.ISingleBaseTriggerPrototype
getThemeColor
-
Methods inherited from interface de.xima.fc.workflow.designer.mixin.ISingleBuiltinTriggerPrototype
getPrototypeIcon, getPrototypeLabel, getPrototypeSearchText, getPrototypeSortKey, getPrototypeSubLabel, getPrototypeTitle
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISingleElementPrototype
getPrototypeTags
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISingleTriggerPrototype
getPrototypeElement, getTriggerPrototypes
-
Methods inherited from interface de.xima.fc.interfaces.workflow.mixin.ISpecificTriggerListener
getFilterCriteriaForEvent, getRequiredEventDataType
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.ITriggerDataDescriptor
getTriggerFilesDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.triggers.ITriggerHandler
getLocalizedTypeName, isAppliesToEvent, onTaskBegin, onTaskFinish
-
-
-
-
Method Detail
-
getBuiltinType
public EWorkflowTriggerType getBuiltinType()
- Specified by:
getBuiltinTypein interfaceIBuiltinTriggerType<FcTimePointProps>- Returns:
- The built-in trigger type.
-
getDataModelClass
public Class<FcTimePointProps> getDataModelClass()
Description copied from interface:IElementHandlerReturns the class of the custom properties used by the elements handled by this element logic handler.The custom properties of a workflow element are internally stored as JSON. To ease the development work, you can specify a model class, and the JSON is automatically converted to an instance of that model class. Please note that the model class must be compatible with serialization mechanism used by
JSON.See
IElementHandler.getVersion()for how custom properties are updated.If you need more control over serialization and deserialization, specify
JSONObjectas the type parameter and returnJSONObject.class. You will then receive the raw JSON data and may perform the serialization in whatever way you like.- Specified by:
getDataModelClassin interfaceIElementHandler<FcTimePointProps,WorkflowTrigger>- Returns:
- The class corresponding to the type parameter
TData.
-
getElementSummaryKeyValueModel
public ISummaryKeyValueModel getElementSummaryKeyValueModel(IGetElementSummaryParams<FcTimePointProps> params)
- Specified by:
getElementSummaryKeyValueModelin interfaceIKeyValueSummarizableElement<FcTimePointProps,WorkflowTrigger>- Parameters:
params- The custom properties of the node or trigger.- Returns:
- A list of key value pairs to display in a table in the overview panel.
-
getMainCategory
public IElementCategory getMainCategory(IGetElementPrototypesParams params)
- Specified by:
getMainCategoryin interfaceISingleElementPrototype<FcTimePointProps,WorkflowTrigger>- Parameters:
params- Parameters with the current client, locale, entity context etc.- Returns:
IElementCategoryelement's main category, which is used for grouping the elements.
-
getPropertiesBeanClass
public Class<? extends ITriggerPropertiesBean<FcTimePointProps>> getPropertiesBeanClass()
Description copied from interface:IElementHandlerReturns the class of the bean that should be used when editing the properties of a workflow element. May benullif you do not require any bean or custom logic. When you only wish to access the properties of yourIElementHandler.getDataModelClass(), you do have to use a custom bean - the model is available via the expression language variablemodel. SeeIElementHandler.getPropertiesViewXhtml()for further details.The default returns
null, which uses no extra bean. An extra bean may not be required for simple UIs if you only need to access the properties model of the workflow element - seeIElementHandler.getPropertiesViewXhtml().- Specified by:
getPropertiesBeanClassin interfaceIElementHandler<FcTimePointProps,WorkflowTrigger>- Specified by:
getPropertiesBeanClassin interfaceITriggerHandler<FcTimePointProps>- Returns:
- The class of the bean to use for editing a workflow node's properties.
- See Also:
IElementHandler.getPropertiesViewXhtml()
-
getPropertiesViewXhtml
public URL getPropertiesViewXhtml() throws MalformedURLException
Description copied from interface:IElementHandlerThis method must return the path to the XHTML page for the custom user interface. Usually the XHTML file is part of the JAR resources of the module or plugin. In this case, you should return an URL to a JAR file resource (jar:file:/...) like so:@Override public URL getXhtmlView() { return getClass().getResource("/path/to/view.xhtml"); }The contents of this XHTML page is included in the properties panel, without a fieldset or container around it, but already inside a form (i.e. do not use a
h:formas that would result in an error). You should wrap your custom UI in a naming container to ensure unique IDs that do not clash with other plugins or actions. The following is a recommended template on which you may base your UI:<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:o="http://omnifaces.org/ui" xmlns:p="http://primefaces.org/ui" xmlns:xi="http://www.xima.de/taglib/xfc"> <!-- Enable bean validation (when #validateLocal is implemented via the bean validator)--> <o:validateBean value="#{model}" showMessageFor="@violating" method="validateActual" /> <xi:namingContainer id="myAwesomeWorkflowElement"> <!--Base info with name and description (when TData extends BaseActionProps) --> <xi:newWorkflowActionBase id="base" value="#{model}" legend="#{msg['wf.node.myawesomelememnt']}" /> <!-- Remove when TData does not have aISingleFileProvidingfield --> <xi:singleFile id="resource" value="#{model.singleFile}" required="true" /> <!-- Remove when TData does not have aIMultiFileProvidingfield --> <xi:multiFile id="resource" value="#{model.multiFile}" required="true" /> <!-- Remove when TData does not implement IProviding --> <xi:fileProvision id="providing" value="#{model.fileProvision}" /> <!-- Custom section with editors specific to your workflow element --> <p:fieldset legend="#{msg['MyAwesomeWorkflowElementProps.fieldset.base']}" styleClass="fc-fieldset"> <!-- A simple input field bound to the mail property of your properties model --> <xi:inputText id="mail" label="#{msg['MyAwesomeWorkflowElementProps.mail']}" formPlaceholder="true" value="#{model.mail}" forceIndicateRequired="true" > <p:ajax event="change" partialSubmit="true" listener="#{elementPropertiesBean.storeCurrent}" process="@this" update=":flowchartForm:flowchart" global="false" /> </xi:inputText> </p:fieldset> </xi:namingContainer> </ui:composition>The XHTML page may access the following expression language variables:
- model: The deserialized custom properties of the workflow element, of the type
TData. - provider: An object that implements
IWorkflowProvider, for accessing various data, such as a list of all users or text templates. - msg: The localized messages as returned by
IElementHandler.getResourceBundle(Locale). Empty when that method returnsnull. For example, if the resource bundle contains the keymail.label, you can access the localized message via the EL expression['mail.label']
To access the values of an enum or the constants defined by a class, consider using
<xi:importConstants type="my.fully.classified.path.MyEnum" var="MyEnum" loader="#{model}"/>Theloaderargument is only required for plugins and ensures that the correct class loader is used that knows about the plugin class. Without the loader attribute, the above is equivalent to the PrimeFaces tag handler<p:importConstants />.- Specified by:
getPropertiesViewXhtmlin interfaceIElementHandler<FcTimePointProps,WorkflowTrigger>- Returns:
- Path to the XHTML view. If the action can be configured, this must not return
null. If you do returnnull, it will be treated as an error and an appropriate message is displayed to the user informing them that the properties panel could not be loaded. If the action cannot be configured (i.e. when the action is not selectable), this should returnnull. - Throws:
MalformedURLException- This exception is declared for convenience - normally you would usenew URL(String)with a constant URL string that should not throw. In case an exception is thrown, it is treated the same as if this returnednull.
- model: The deserialized custom properties of the workflow element, of the type
-
getPrototypeModelData
public FcTimePointProps getPrototypeModelData(String label, IGuiIcon icon, IGetElementPrototypesParams params)
Description copied from interface:ISingleBaseTriggerPrototypeThis default implementation returns a new instance of theTDataproperties model, pre-filled with the label and icon (BaseActionProps.getName()andBaseActionProps.getIcon()). All other fields remain at their default values.This method assumes that the
TDatatype possesses a public no-arg constructor. If it does not, you will need to override this method and create the instance yourself. Otherwise, you can also override this method, callsuper, and add additional defaults - but make sure JSON deserialization can still create an instance as well, such as viaJSONCreator.- Specified by:
getPrototypeModelDatain interfaceISingleBaseTriggerPrototype<FcTimePointProps>- Specified by:
getPrototypeModelDatain interfaceISingleElementPrototype<FcTimePointProps,WorkflowTrigger>- Parameters:
label- Label of the prototype, as returned byISingleElementPrototype.getPrototypeLabel(IGetElementPrototypesParams). Can be used to prefill the properties model with the label.icon- Icon of the prototype, as returned byISingleElementPrototype.getPrototypeIcon(IGetElementPrototypesParams). Can be used to prefill the properties model with the icon.params- Parameters with the current client, locale, entity context etc.- Returns:
- The properties model for the element prototype. This is the initial configuration when the user adds the prototype to the flowchart (via drag & drop).
- See Also:
ISingleElementPrototype.getPrototypeModelData(String, IGuiIcon, IGetElementPrototypesParams)
-
getSubCategory
public IElementCategory getSubCategory(IGetElementPrototypesParams params)
Description copied from interface:ISingleElementPrototypeOptional sub category. When not set or this returnsnull, the element is shown under the categorymiscellaneous.- Specified by:
getSubCategoryin interfaceISingleElementPrototype<FcTimePointProps,WorkflowTrigger>- Parameters:
params- Parameters with the current client, locale, entity context etc.- Returns:
IElementCategoryelement's sub category, which is used for grouping the element within the given main group.
-
isPreconditionSatisfied
public boolean isPreconditionSatisfied(ITriggerPreconditionSatisfiedParams<FcTimePointProps> params)
Description copied from interface:ITriggerHandlerCalled once the task of a trigger is about to be executed. This method may returnfalseto prevent the task from being executed. When an event triggers multiple tasks, the execution of one task may invalidate the preconditions for a later task, so this method can be used to check whether the precondition is still satisfied.See the class level documentation
ITriggerHandlerfor more details.- Specified by:
isPreconditionSatisfiedin interfaceISpecificTriggerListener<FcTimePointProps>- Specified by:
isPreconditionSatisfiedin interfaceITriggerHandler<FcTimePointProps>- Parameters:
params- The parameters with the task about to be executed.- Returns:
trueto proceed with the task's execution,falseto skip the task's execution.
-
register
public void register()
Description copied from interface:IListenerRegistratorInvoked by the system and may perform whatever setup logic is required.- Specified by:
registerin interfaceIBuiltinTriggerType<FcTimePointProps>- Specified by:
registerin interfaceIListenerRegistrator
-
getInstance
public static FcTimePointHandler getInstance()
- Returns:
- The immutable (stateless) instance of this handler.
-
-