Class FcQualifiedFormSubmitButtonHandler
- java.lang.Object
-
- de.xima.fc.workflow.designer.registry.triggers.FcQualifiedFormSubmitButtonHandler
-
- All Implemented Interfaces:
IResourceBundleLocator
,IElementHandler<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
,IRefinedTriggerDataDescriptor<FcQualifiedFormSubmitButtonProps>
,ITriggerDataDescriptor
,ICustomParametersUpdateable
,IWorkflowElementTypeProviding
,IBeanValidatingElement<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
,IBeanValidatingTrigger<FcQualifiedFormSubmitButtonProps>
,IKeyValueSummarizableElement<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
,IKeyValueSummarizableTrigger<FcQualifiedFormSubmitButtonProps>
,IOfficialHelpPageElement<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
,IOfficialHelpPageTrigger<FcQualifiedFormSubmitButtonProps>
,ITriggerHandler<FcQualifiedFormSubmitButtonProps>
,IWorkflowTriggerTypeProviding
,IListenerRegistrator
,IOrderable
,IBuiltinResourcesHandler<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
,IBaseTrigger<FcQualifiedFormSubmitButtonProps>
,IBuiltinTriggerType<FcQualifiedFormSubmitButtonProps>
,IFcQualifiedFormSubmitButtonDescriptors
,Comparable<IOrderable>
@Immutable public final class FcQualifiedFormSubmitButtonHandler extends Object implements ITriggerHandler<FcQualifiedFormSubmitButtonProps>, IBaseTrigger<FcQualifiedFormSubmitButtonProps>, IBuiltinResourcesHandler<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>, IBuiltinTriggerType<FcQualifiedFormSubmitButtonProps>, IFcQualifiedFormSubmitButtonDescriptors, IKeyValueSummarizableTrigger<FcQualifiedFormSubmitButtonProps>
TheITriggerHandler
for nodes of typeEWorkflowTriggerType.FC_QUALIFIED_FORM_SUBMIT_BUTTON
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
CURRENT_HANDLER_VERSION
-
Fields inherited from interface de.xima.fc.workflow.retval.trigger.IFcQualifiedFormSubmitButtonDescriptors
ATTR_BUTTON_NAME, ATTR_BUTTON_QUALIFIER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
extractName(FcQualifiedFormSubmitButtonProps data)
Retrieves the name that will be stored asAWorkflowElement.getName()
.Map<String,List<String>>
extractSearchTerms(IExtractSearchTermsParams<FcQualifiedFormSubmitButtonProps> params)
Each workflow element may have one or more search terms that are used in database queries to filter the applicable elements.This methods lets you define custom search terms based on the properties of the workflow element.EWorkflowTriggerType
getBuiltinType()
Class<FcQualifiedFormSubmitButtonProps>
getDataModelClass()
Returns the class of the custom properties used by the elements handled by this element logic handler.ISummaryKeyValueModel
getElementSummaryKeyValueModel(IGetElementSummaryParams<FcQualifiedFormSubmitButtonProps> params)
de.xima.cmn.criteria.FilterCriterion
getFilterCriteriaForEvent(ITriggerFilterCriteriaForEventParams params)
Called once with the event data when an event is fired.static FcQualifiedFormSubmitButtonHandler
getInstance()
URL
getPropertiesViewXhtml()
This method must return the path to the XHTML page for the custom user interface.List<ITriggerPrototypeDescriptor<FcQualifiedFormSubmitButtonProps>>
getTriggerPrototypes(IGetTriggerPrototypesParams params)
Returns a list of all trigger prototypes for this node type.int
hashCode()
boolean
isPreconditionSatisfied(ITriggerPreconditionSatisfiedParams<FcQualifiedFormSubmitButtonProps> params)
Called once the task of a trigger is about to be executed.IOnTaskBeginRetVal
onTaskBegin(ITriggerOnTaskBeginParams<FcQualifiedFormSubmitButtonProps> params)
Callback that is invoked just before a task that has a trigger of this type is executed.-
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, register
-
Methods inherited from interface de.xima.fc.interfaces.workflow.ICustomParametersUpdateable
updateCustomParams
-
Methods inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
extractDescription, getCascadingStyleSheet, getDisplayLabel, getFastJsonConverter, getFilterCriteriaForEntities, getJavaScript, getResourceBundle, getVersion, isHasUserVisibleName, readEntityReferences, readPlaceholders, validateGlobal, writeEntityReferences, writePlaceholders
-
Methods inherited from interface de.xima.fc.workflow.retval.trigger.IFcQualifiedFormSubmitButtonDescriptors
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.interfaces.workflow.execution.ITriggerDataDescriptor
getTriggerFilesDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.triggers.ITriggerHandler
getLocalizedTypeName, getPropertiesBeanClass, isAppliesToEvent, onTaskFinish
-
-
-
-
Method Detail
-
extractName
public String extractName(FcQualifiedFormSubmitButtonProps data)
Description copied from interface:IElementHandler
Retrieves the name that will be stored asAWorkflowElement.getName()
. For example, actions may let the user enter the name of the action, which would be returned by this method. A condition node may use a summary of the test condition as the name. A button trigger event may use the name of the button.The default implementation checks whether the
IElementHandler.getDataModelClass()
implementsINameProviding
and if it does, returnsINameProviding.getName()
.- Specified by:
extractName
in interfaceIElementHandler<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
- Parameters:
data
- The data of the workflow element for which to retrieve the name.- Returns:
- The name of the workflow element with the given data.
-
extractSearchTerms
public Map<String,List<String>> extractSearchTerms(IExtractSearchTermsParams<FcQualifiedFormSubmitButtonProps> params)
Description copied from interface:IElementHandler
Each workflow element may have one or more search terms that are used in database queries to filter the applicable elements.This methods lets you define custom search terms based on the properties of the workflow element. These search terms are saved asIElementSearchTermsProviding.getSearchTerms()
and may be used in a database query.The default implementation scans for entity references via
IElementHandler.readEntityReferences(IReadEntityRefsParams)
and adds a search terms for each entity reference that was found with a default search term name obtained fromISearchTermHandler.entitySearchTerm(de.xima.fc.interfaces.workflow.reference.IEntityReference)
. When you override this method, you may also need to overrideIElementHandler.getFilterCriteriaForEntities(IGetFilterCriteriaForEntitiesParams)
.- Specified by:
extractSearchTerms
in interfaceIElementHandler<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
- Parameters:
params
- Parameters with the data of the trigger for which to retrieve the search terms and some helper methods for querying the default search term names for entity references. When these names are used,IElementHandler.getFilterCriteriaForEntities(IGetFilterCriteriaForEntitiesParams)
does not need to be overridden.- Returns:
- The search terms for the given trigger data. This map should not be modified by callers, unless the caller is a subclass implementation of this method.
-
getBuiltinType
public EWorkflowTriggerType getBuiltinType()
- Specified by:
getBuiltinType
in interfaceIBuiltinTriggerType<FcQualifiedFormSubmitButtonProps>
- Returns:
- The built-in trigger type.
-
getDataModelClass
public Class<FcQualifiedFormSubmitButtonProps> getDataModelClass()
Description copied from interface:IElementHandler
Returns 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
JSONObject
as 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:
getDataModelClass
in interfaceIElementHandler<FcQualifiedFormSubmitButtonProps,WorkflowTrigger>
- Returns:
- The class corresponding to the type parameter
TData
.
-
getElementSummaryKeyValueModel
public ISummaryKeyValueModel getElementSummaryKeyValueModel(IGetElementSummaryParams<FcQualifiedFormSubmitButtonProps> params)
- Specified by:
getElementSummaryKeyValueModel
in interfaceIKeyValueSummarizableElement<FcQualifiedFormSubmitButtonProps,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.
-
getFilterCriteriaForEvent
public de.xima.cmn.criteria.FilterCriterion getFilterCriteriaForEvent(ITriggerFilterCriteriaForEventParams params)
Description copied from interface:ITriggerHandler
Called once with the event data when an event is fired. Each handler may add filter criteria to locate the triggers that match the event data.This method must return a non-null value to indicate that the event applies to this type of trigger at all. When this returns
null
, no triggers of this handler type are considered. The filter criterion returned by this method is used for a query forWorkflowTrigger
entities, i.e. all attribute names must be relative to that entity.For example, to limit the result to triggers which have a search term with the key
customKey
set tovalueForCustomKey
, use:return params.searchTermExists("customKey", valueForCustomKey);
To create a complex filter, useor
/and
etc. If you cannot use a database filter to check whether a trigger applies, usealways
to fetch all triggers for this handler type, and implementisAppliesToEvent
to filter the applicable triggers via Java code.Basic restrictions such as the
trigger type
, the form record and project are applied automatically by the system and do not need to be included in the returned filter.See the class level documentation
ITriggerHandler
for more details.- Specified by:
getFilterCriteriaForEvent
in interfaceITriggerHandler<FcQualifiedFormSubmitButtonProps>
- Parameters:
params
- Parameters with the event data of the event that occurred.- Returns:
- A filter criterion to restrict the list of matching triggers for this handler type. When
null
is returned, no triggers of this handler type are considered.
-
getPropertiesViewXhtml
public URL getPropertiesViewXhtml() throws MalformedURLException
Description copied from interface:IElementHandler
This 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:form
as 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 a
ISingleFileProviding
field --> <xi:singleFile id="resource" value="#{model.singleFile}" required="true" /> <!-- Remove when TData does not have aIMultiFileProviding
field --> <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}"/>
Theloader
argument 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:
getPropertiesViewXhtml
in interfaceIElementHandler<FcQualifiedFormSubmitButtonProps,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
-
getTriggerPrototypes
public List<ITriggerPrototypeDescriptor<FcQualifiedFormSubmitButtonProps>> getTriggerPrototypes(IGetTriggerPrototypesParams params)
Description copied from interface:ITriggerHandler
Returns a list of all trigger prototypes for this node type. Each prototype appears in the drawer panel of the workflow designer. The user can move a trigger prototype via drag & drop into the design area in the center to add the trigger to the current flowchart.You should always return all prototypes, irrespective of whether they are allowed to the current user.
IElementHandler.isAvailable(IIsAvailableParams)
is checked by the engine, and unavailable trigger types are removed automatically.- Specified by:
getTriggerPrototypes
in interfaceITriggerHandler<FcQualifiedFormSubmitButtonProps>
- Parameters:
params
- Parameters for this method, such as the current locale for localizing the display name of the prototypes.- Returns:
- A list of all available prototypes.
null
is treated as an empty list.
-
isPreconditionSatisfied
public boolean isPreconditionSatisfied(ITriggerPreconditionSatisfiedParams<FcQualifiedFormSubmitButtonProps> params)
Description copied from interface:ITriggerHandler
Called once the task of a trigger is about to be executed. This method may returnfalse
to 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
ITriggerHandler
for more details.- Specified by:
isPreconditionSatisfied
in interfaceITriggerHandler<FcQualifiedFormSubmitButtonProps>
- Parameters:
params
- The parameters with the task about to be executed.- Returns:
true
to proceed with the task's execution,false
to skip the task's execution.
-
onTaskBegin
public IOnTaskBeginRetVal onTaskBegin(ITriggerOnTaskBeginParams<FcQualifiedFormSubmitButtonProps> params)
Description copied from interface:ITriggerHandler
Callback that is invoked just before a task that has a trigger of this type is executed. You may use this callback method to set up the execution context.This method should return the data that should be made available via
IWorkflowVariableHandler.getTriggerData(String)
. This data is also available via a placeholder.- Specified by:
onTaskBegin
in interfaceITriggerHandler<FcQualifiedFormSubmitButtonProps>
- Parameters:
params
- Parameters passed to the callback that contain the trigger data and the execution context.- Returns:
- Result of the begin callback, see
IOnTaskBeginRetVal
.
-
getInstance
public static FcQualifiedFormSubmitButtonHandler getInstance()
- Returns:
- The immutable, stateless instance of this handler.
-
-