Class SingleAttachment

    • Constructor Detail

      • SingleAttachment

        public SingleAttachment()
    • Method Detail

      • setAttachment

        public void setAttachment​(@Nullable
                                  AttachmentItem attachment)
        Sets the attachment item for the selected attachment.
        Parameters:
        attachment - The selected attachment item.
      • setSearchFilenamePattern

        public void setSearchFilenamePattern​(String searchFilenamePattern)
        Sets the pattern for searching for an attachment, if an attachment item of type * SEARCH exists. null or empty when no such attachment item exists.
        Parameters:
        searchFilenamePattern - Search pattern for the attachment search.
      • setSearchSourceTypes

        public void setSearchSourceTypes​(List<EAttachmentSource> searchSourceTypes)
        Sets the attachment source types to which to limit the search for attachments when an attachment item of type SEARCH is selected.
        Parameters:
        searchSourceTypes - Attachment sources to which to limit the search.
      • forSearch

        public static SingleAttachment forSearch​(String filenamePattern,
                                                 Iterable<EAttachmentSource> sourceTypes)
        Creates a single attachment reference that searches for an existing attachment by its file name and type.
        Parameters:
        filenamePattern - Pattern that the file name of the attachment must match.
        sourceTypes - Attachments types to which to limit the search.
        Returns:
        A new single attachment reference for searching an attachment by its name and type.
      • forSearch

        public static SingleAttachment forSearch​(String filenamePattern,
                                                 EAttachmentSource... sourceTypes)
        Creates a single attachment reference that searches for an existing attachment by its file name and type.
        Parameters:
        filenamePattern - Pattern that the file name of the attachment must match.
        sourceTypes - Attachments types to which to limit the search.
        Returns:
        A new single attachment reference for searching an attachment by its name and type.
      • forUploadElement

        public static SingleAttachment forUploadElement​(String uploadElementName)
        Creates a single attachment reference for the attachment created automatically by a file upload form element.
        Parameters:
        uploadElementName - The name of the file upload form element.
        Returns:
        A new single attachment reference for the attachment of a file upload element.
      • forWorkflowNode

        public static SingleAttachment forWorkflowNode​(NodeKey nodeKey)
        Creates a single attachment references for the attachment created by a previously executed workflow node.
        Parameters:
        nodeKey - Key of the referenced workflow node.
        Returns:
        A new single attachment reference for the attachment produced by a workflow node.