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 to JSONObject.
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, FcDeleteAttachmentHandler, FcDeleteFormRecordHandler, FcDoiInitHandler, FcDoiVerifiedHandler, FcEmailHandler, FcEncodeBase64Handler, FcExperimentHandler, FcExportToPersistenceHandler, FcExportToXmlHandler, FcFillPdfHandler, FcFillWordHandler, FcFormSubmitButtonHandler, FcHttpRequestHandler, FcImportFormValueFromXmlHandler, FcInvitationErrorHandler, FcInvitationSentHandler, FcLdapQueryHandler, FcLogEntryHandler, FcManualHandler, FcMoveFormRecordToInboxHandler, FcMultipleConditionHandler, FcProcessHistoryPdfHandler, FcProcessLogPdfHandler, FcProvideResourceHandler, FcQualifiedFormSubmitButtonHandler, FcQueueTaskHandler, FcRedirectHandler, FcRenewProcessIdHandler, FcReturnFileHandler, FcReturnHandler, FcSaveToFileSystemHandler, FcSaveToWebDavHandler, FcSetSavedFlagHandler, FcShowTemplateHandler, FcSqlStatementHandler, FcStateTimerHandler, FcSwitchCaseHandler, FcSwitchDefaultHandler, FcSwitchHandler, FcThrowExceptionHandler, FcTimePointHandler, FcWriteFormRecordAttrHandler

public interface IBeanValidatingElement<TData,TElement extends IWorkflowElementEntity> extends IElementHandler<TData,TElement>
Mixin that implements IElementHandler.validateLocal(IElementLocalValidationParams) by performing a bean validation on the IWorkflowElementWithDeserializedModel.getData(). Make sure not to use JSONObject 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 to EValidationSeverity.WARNING, use Severity.Warning as the Payload of the validation constraint.

Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • validateLocal

      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 API javax.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 interface IElementHandler<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 call build 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 to validateLocal(IElementLocalValidationParams).
      Returns:
      All validations groups for the bean validation.
      Throws:
      WorkflowValidationException - When the groups could not be determined.