Interface IBeanValidatingElement<TData,TElement extends IWorkflowElementEntity>
-
- Type Parameters:
TData
- Type of the properties model of the node. It is an error to use this mixin with the type parameter set toJSONObject
.TElement
- Type of the workflow element, i.e. a node or trigger.
- All Superinterfaces:
ICustomParametersUpdateable
,IElementHandler<TData,TElement>
,IResourceBundleLocator
,IWorkflowElementTypeProviding
- All Known Subinterfaces:
IBaseActionNode<TData>
,IBaseTrigger<TData>
,IBeanValidatingNode<TData>
,IBeanValidatingTrigger<TData>
,IPluginActionNodeHandler<TData>
,IPluginConditionNodeHandler<TData>
,IPluginTriggerHandler<TData>
- All Known Implementing Classes:
APluginActionNodeHandler
,APluginConditionNodeHandler
,APluginTriggerHandler
,FcCatchErrorHandler
,FcChangeFormAvailabilityHandler
,FcChangeFormValueHandler
,FcChangeStateHandler
,FcCompressAsZipHandler
,FcCopyFormRecordHandler
,FcCounterHandler
,FcCreateTextFileHandler
,FcDecodeBase64Handler
,FcDeleteFormRecordHandler
,FcDoiInitHandler
,FcDoiVerifiedHandler
,FcEmailHandler
,FcEncodeBase64Handler
,FcExperimentHandler
,FcExportToPersistenceHandler
,FcExportToXmlHandler
,FcFillPdfHandler
,FcFillWordHandler
,FcFormSubmitButtonHandler
,FcHttpRequestHandler
,FcImportFormValueFromXmlHandler
,FcInvitationErrorHandler
,FcInvitationSentHandler
,FcLdapQueryHandler
,FcLogEntryHandler
,FcManualHandler
,FcMoveFormRecordToInboxHandler
,FcMultipleConditionHandler
,FcProcessLogPdfHandler
,FcProvideResourceHandler
,FcQualifiedFormSubmitButtonHandler
,FcQueueTaskHandler
,FcRedirectHandler
,FcRenewProcessIdHandler
,FcReturnFileHandler
,FcReturnHandler
,FcSaveToFileSystemHandler
,FcSaveToWebDavHandler
,FcSetSavedFlagHandler
,FcShowTemplateHandler
,FcSqlStatementHandler
,FcStateTimerHandler
,FcSwitchCaseHandler
,FcSwitchDefaultHandler
,FcSwitchHandler
,FcThrowExceptionHandler
,FcTimePointHandler
,FcWriteFormRecordAttrHandler
,RedirectToClientInboxNodePlugin
,RedirectToFormRecordNodePlugin
public interface IBeanValidatingElement<TData,TElement extends IWorkflowElementEntity> extends IElementHandler<TData,TElement>
Mixin that implementsIElementHandler.validateLocal(IElementLocalValidationParams)
by performing a bean validation on theIWorkflowElementWithDeserializedModel.getData()
. Make sure not to useJSONObject
as the properties model, as no validation can be performed on raw JSON objects.To change the severity of a validation constraint from
EValidationSeverity.ERROR
toEValidationSeverity.WARNING
, useSeverity.Warning
as thePayload
of the validation constraint.- 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 Instance Methods Default Methods Modifier and Type Method Description default Class<?>[]
getValidationGroups(IElementLocalValidationParams<TData,TElement> params)
Finds the validation groups that should be used for the bean validation.default IWorkflowElementValidationResult
validateLocal(IElementLocalValidationParams<TData,TElement> params)
Performs a local validation of the given workflow workflow element properties.-
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, getCascadingStyleSheet, getDataModelClass, getDisplayLabel, getElementSummaryModel, getElementSummaryXhtml, getFastJsonConverter, getFilterCriteriaForEntities, getHelpPageLocation, getJavaScript, getJavaScript, getLocalizedTypeName, getPropertiesBeanClass, getPropertiesViewXhtml, getResourceBundle, getVersion, isAvailable, readEntityReferences, readPlaceholders, validateGlobal, writeEntityReferences, writePlaceholders
-
Methods inherited from interface de.xima.fc.interfaces.workflow.IWorkflowElementTypeProviding
getType
-
-
-
-
Method Detail
-
validateLocal
default IWorkflowElementValidationResult validateLocal(IElementLocalValidationParams<TData,TElement> params) throws WorkflowValidationException
Description copied from interface:IElementHandler
Performs a local validation of the given workflow workflow element properties. This method should only validate the properties of the given workflow element, without respect to any other workflow elements.This method allows you to implement custom validation logic. Consider using
IBeanValidatingElement
and annotating your properties model class with the annotation from the bean annotation APIjavax.validation
. This also offers the advantage that it can be integrated into JSF, allowing you to use the same validations for the UI view as well.- Specified by:
validateLocal
in interfaceIElementHandler<TData,TElement extends IWorkflowElementEntity>
- Parameters:
params
- The properties to validate. Also provides access to the project, client etc.- Returns:
- The result of the validation, i.e. whether the workflow element is valid, and a list of messages to display
to the user. If this returns, this is treated as if a valid result without messages had been returned. You may use
use params.
getValidationContext()
.resultBuilder()
to create the result, or implement the interface yourself. To indicate that the validation was performed, but no validation constraints were violated, simply callbuild
on the result builder and return that, without adding any messages. - Throws:
WorkflowValidationException
- When the validation could not be performed. Please note that this is meant for unexpected errors only - you should not throw an exception if a workflow element is simply just invalid.
-
getValidationGroups
default Class<?>[] getValidationGroups(IElementLocalValidationParams<TData,TElement> params) throws WorkflowValidationException
Finds the validation groups that should be used for the bean validation. The default implementation simply returns all validation groups defined by the bean that is about to be validated.- Parameters:
params
- Parameters as passed tovalidateLocal(IElementLocalValidationParams)
.- Returns:
- All validations groups for the bean validation.
- Throws:
WorkflowValidationException
- When the groups could not be determined.
-
-