Class WorkflowNodeFactory


  • public final class WorkflowNodeFactory
    extends Object
    Factory methods for creating various kinds of WorkflowNodes.
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • changeFormValue

        public static WorkflowNode changeFormValue​(Map<String,​String> formValues)
                                            throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_CHANGE_FORM_VALUE that modifies the value of one or more form elements.
        Parameters:
        formValues - Values to set on the form. Key is the name of the form element, value is the new value for the form element.
        Returns:
        The workflow node for a change form value action with the given details.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • compressAsZip

        public static WorkflowNode compressAsZip​(MultiFile multiFile,
                                                 String compressedFileName,
                                                 boolean attachToFormRecord)
                                          throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COMPRESS_AS_ZIP that creates a ZIP file form the input files.
        Parameters:
        multiFile - Files to compress.
        compressedFileName - File name of the ZIP file.
        attachToFormRecord - Whether the ZIP file should be attached to the current form record.
        Returns:
        The workflow node for a compress as ZIP action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • compressAsZip

        public static WorkflowNode compressAsZip​(MultiFile multiFile,
                                                 String compressedFileName,
                                                 boolean attachToFormRecord,
                                                 ECompressAsZipNamingScheme namingScheme)
                                          throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COMPRESS_AS_ZIP that creates a ZIP file form the input files.
        Parameters:
        multiFile - Files to compress.
        compressedFileName - File name of the ZIP file.
        attachToFormRecord - Whether the ZIP file should be attached to the current form record.
        namingScheme - How the files should be named and whether sub directories should be created.
        Returns:
        The workflow node for a compress as ZIP action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • copyFormRecord

        public static WorkflowNode copyFormRecord​(boolean anonymizeUserMetadata)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COPY_FORM_RECORD that moves the current form record to the given inbox.
        Parameters:
        anonymizeUserMetadata - Whether user metadata should be anonymized in the created protocol entry.
        Returns:
        The workflow node for a copy form record action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • copyFormRecord

        public static WorkflowNode copyFormRecord​(boolean anonymizeUserMetadata,
                                                  WorkflowTrigger triggerToInvoke,
                                                  Postfach targetInbox)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COPY_FORM_RECORD that moves the current form record to the given inbox.
        Parameters:
        triggerToInvoke - An optional trigger that is invoked on the copied form record.
        targetInbox - An optional target inbox to which to move the form record.
        anonymizeUserMetadata - Whether user metadata should be anonymized in the created protocol entry.
        Returns:
        The workflow node for a copy form record action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • counter

        public static WorkflowNode counter​(ClientCounter counter,
                                           ECounterActionType actionType,
                                           String step)
                                    throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COUNTER that modifies a certain client counter.
        Parameters:
        counter - Counter to change.
        actionType - Type how to modify the counter.
        step - Amount by which to increment or decrement the counter (unused when resetting the counter). May contain variables.
        Returns:
        The workflow node for a counter action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • counter

        public static WorkflowNode counter​(String counterName,
                                           ECounterActionType actionType,
                                           String step)
                                    throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COUNTER that modifies a certain client counter.
        Parameters:
        counterName - Name of the counter to change.
        actionType - Type how to modify the counter.
        step - Amount by which to increment or decrement the counter (unused when resetting the counter). May contain variables.
        Returns:
        The workflow node for a counter action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • counterDecrement

        public static WorkflowNode counterDecrement​(ClientCounter counter,
                                                    String step)
                                             throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COUNTER that decrements a client counter.
        Parameters:
        counter - Counter to decrement.
        step - Amount by which to decrement the counter. May contain variables.
        Returns:
        The workflow node for a counter action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • counterDecrement

        public static WorkflowNode counterDecrement​(String counterName,
                                                    String step)
                                             throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COUNTER that decrements a client counter.
        Parameters:
        counterName - Name of the the counter to decrement.
        step - Amount by which to decrement the counter. May contain variables.
        Returns:
        The workflow node for a counter action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • counterIncrement

        public static WorkflowNode counterIncrement​(ClientCounter counter,
                                                    String step)
                                             throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COUNTER that increments a client counter.
        Parameters:
        counter - Counter to increment.
        step - Amount by which to increment the counter. May contain variables.
        Returns:
        The workflow node for a counter action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • counterIncrement

        public static WorkflowNode counterIncrement​(String counterName,
                                                    String step)
                                             throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_COUNTER that increments a client counter.
        Parameters:
        counterName - Name of the counter to increment.
        step - Amount by which to increment the counter. May contain variables.
        Returns:
        The workflow node for a counter action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • createTextFile

        public static WorkflowNode createTextFile​(String fileName,
                                                  String fileContent)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_CREATE_TEXT_FILE that creates a text file with the given content and the default encoding.
        Parameters:
        fileName - Name of the created text file.
        fileContent - Plain text content of the text file.
        Returns:
        The workflow node for a create text file action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • createTextFile

        public static WorkflowNode createTextFile​(String fileName,
                                                  String fileContent,
                                                  ETextFileContentType contentType)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_CREATE_TEXT_FILE that creates a text file with the given content and the default encoding.
        Parameters:
        fileName - Name of the created text file.
        fileContent - Plain text content of the text file.
        contentType - Expected content type of the text file, used for escaping inserted variables.
        Returns:
        The workflow node for a create text file action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • createTextFile

        public static WorkflowNode createTextFile​(String fileName,
                                                  String fileContent,
                                                  ETextFileContentType contentType,
                                                  Charset charset)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_CREATE_TEXT_FILE that creates a text file with the given content.
        Parameters:
        fileName - Name of the created text file.
        fileContent - Plain text content of the text file.
        charset - Charset for encoding the bytes when writing the text file.
        contentType - Expected content type of the text file, used for escaping inserted variables.
        Returns:
        The workflow node for a create text file action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • createTextFile

        public static WorkflowNode createTextFile​(String fileName,
                                                  String fileContent,
                                                  ETextFileContentType contentType,
                                                  Charset charset,
                                                  EByteOrderMarkMode bomMode)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_CREATE_TEXT_FILE that creates a text file with the given content.
        Parameters:
        fileName - Name of the created text file.
        fileContent - Plain text content of the text file.
        charset - Charset for encoding the bytes when writing the text file.
        contentType - Expected content type of the text file, used for escaping inserted variables.
        bomMode - Byte order mark mode to use.
        Returns:
        The workflow node for a create text file action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • custom

        public static WorkflowNode custom​(EWorkflowNodeType type)
        Creates a new workflow node for the given type and no data.
        Parameters:
        type - Type of the workflow node to create.
        Returns:
        A new workflow node of the given type, without any data.
      • custom

        public static WorkflowNode custom​(EWorkflowNodeType type,
                                          Object data,
                                          Mandant client)
                                   throws FastJsonException
        Creates a new workflow node for the given type and data.
        Parameters:
        type - Type of the workflow node to create.
        data - Custom data for the node.
        client - Client used to retrieve node handler plugins.
        Returns:
        A new workflow node of the given type and with the given data.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • custom

        public static WorkflowNode custom​(IWorkflowElementTypeProviding type)
        Creates a new workflow node for the given type and no data.
        Parameters:
        type - Type of the workflow node to create.
        Returns:
        A new workflow node of the given type, without any data.
      • custom

        public static WorkflowNode custom​(IWorkflowElementTypeProviding type,
                                          Object data,
                                          Mandant client)
                                   throws FastJsonException
        Creates a new workflow node for the given type and data.
        Parameters:
        type - Type of the workflow node to create.
        data - Custom data for the node.
        client - Client used to retrieve node handler plugins.
        Returns:
        A new workflow node of the given type and with the given data.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • custom

        public static WorkflowNode custom​(String type)
        Creates a new workflow node for the given type and with no data.
        Parameters:
        type - Type of the workflow node to create.
        Returns:
        A new workflow node of the given type, with no data.
      • custom

        public static WorkflowNode custom​(String type,
                                          Object data,
                                          Mandant client)
                                   throws FastJsonException
        Creates a new workflow node for the given type and data.
        Parameters:
        type - Type of the workflow node to create.
        data - Custom data for the node.
        client - Client used to retrieve node handler plugins.
        Returns:
        A new workflow node of the given type and with the given data.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • databaseQuery

        public static WorkflowNode databaseQuery​(DatenbankZugriff databaseConnection,
                                                 String sqlStatement)
                                          throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_SQL_STATEMENT with a SQL statement.
        Parameters:
        databaseConnection - Database connection to use for the query.
        sqlStatement - The SQL statement to run against the database connection.
        Returns:
        The workflow node for a database query action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • databaseQuery

        public static WorkflowNode databaseQuery​(Datenquelle databaseQuery,
                                                 Map<String,​String> queryParameters)
                                          throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_SQL_STATEMENT that uses a preconfigured database query.
        Parameters:
        databaseQuery - Existing database query to execute.
        queryParameters - Query parameters that are passed to the existing query. Must match the parameter count of the database query.
        Returns:
        The workflow node for a database query action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • doiInit

        public static WorkflowNode doiInit​(String from,
                                           Iterable<String> to,
                                           String subject,
                                           String htmlBody,
                                           String plainTextBody,
                                           Textbaustein doiFailTemplate)
                                    throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_DOI_INIT that initializes the double opt-in process.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        htmlBody - HTML body content of the email, null or empty to omit the HTML body.
        plainTextBody - Plain text body content of the email, null or empty to omit the plain text body.
        doiFailTemplate - Template used when the double opt-in link fails.
        Returns:
        The workflow node for a double opt-in initialization action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • doiInitHtml

        public static WorkflowNode doiInitHtml​(String from,
                                               Iterable<String> to,
                                               String subject,
                                               String body)
                                        throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_DOI_INIT that initializes the double opt-in process.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        body - HTML body of the email.
        Returns:
        The workflow node for a double opt-in initialization action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • doiInitHtml

        public static WorkflowNode doiInitHtml​(String from,
                                               Iterable<String> to,
                                               String subject,
                                               String body,
                                               Textbaustein doiFailTemplate)
                                        throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_DOI_INIT that initializes the double opt-in process.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        body - HTML body of the email.
        doiFailTemplate - Template used when the double opt-in link fails.
        Returns:
        The workflow node for a double opt-in initialization action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • doiInitPlain

        public static WorkflowNode doiInitPlain​(String from,
                                                Iterable<String> to,
                                                String subject,
                                                String body)
                                         throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_DOI_INIT that initializes the double opt-in process.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        body - Plain text body of the email.
        Returns:
        The workflow node for a double opt-in initialization action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • doiInitPlain

        public static WorkflowNode doiInitPlain​(String from,
                                                Iterable<String> to,
                                                String subject,
                                                String body,
                                                Textbaustein doiFailTemplate)
                                         throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_DOI_INIT that initializes the double opt-in process.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        body - Plain text body of the email.
        doiFailTemplate - Template used when the double opt-in link fails.
        Returns:
        The workflow node for a double opt-in initialization action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • email

        public static WorkflowNode email​(String from,
                                         Iterable<String> to,
                                         String subject,
                                         String htmlBody,
                                         String plainTextBody)
                                  throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EMAIL that sends an email to one or more recipients.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        htmlBody - HTML body content of the email, null to omit the HTML body.
        plainTextBody - Plain text body content of the email, null to omit the plain text body.
        Returns:
        The workflow node for an email action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • emailHtml

        public static WorkflowNode emailHtml​(String from,
                                             Iterable<String> to,
                                             String subject,
                                             String body)
                                      throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EMAIL that sends an HTML email to one or more recipients.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        body - Body of the email.
        Returns:
        The workflow node for an email action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • emailPlainText

        public static WorkflowNode emailPlainText​(String from,
                                                  Iterable<String> to,
                                                  String subject,
                                                  String body)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EMAIL that sends a plain text email to one or more recipients.
        Parameters:
        from - Email address of the sender.
        to - Email addresses of the recipients.
        subject - Subject to of the email.
        body - Body of the email.
        Returns:
        The workflow node for an email action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • experiment

        public static WorkflowNode experiment​(WorkflowNode block,
                                              WorkflowNode handler)
                                       throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPERIMENT that catches exception that occur while the block is executed.
        Parameters:
        block - Block for which exception should be caught during execution.
        handler - Handler that is executed when the block threw an exception.
        Returns:
        The workflow node for an experiment action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • exportToPersistence

        public static WorkflowNode exportToPersistence()
                                                throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPORT_TO_PERSISTENCE that creates a persistence file with the submitted form data. The file name is generated automatically and the file is not attached to the form record.
        Returns:
        The workflow node for an export to persistence action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • exportToPersistence

        public static WorkflowNode exportToPersistence​(String exportName)
                                                throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPORT_TO_PERSISTENCE that creates a persistence file with the submitted form data. The file is not attached to the form record.
        Parameters:
        exportName - Name of the created persistence file. Leave empty for an automatically generated name.
        Returns:
        The workflow node for an export to persistence action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • exportToPersistence

        public static WorkflowNode exportToPersistence​(String exportName,
                                                       boolean attachToFormRecord)
                                                throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPORT_TO_PERSISTENCE that creates a persistence file with the submitted form data.
        Parameters:
        exportName - Name of the created persistence file. Leave empty for an automatically generated name.
        attachToFormRecord - When true, attaches the created file to the form record.
        Returns:
        The workflow node for an export to persistence action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • exportToXml

        public static WorkflowNode exportToXml​(String exportName)
                                        throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPORT_TO_PERSISTENCE that creates a persistence file with the submitted form data. The file is not attached to the form record. All additional EExportToXmlFields are included.
        Parameters:
        exportName - Name of the created persistence file. Leave empty for an automatically generated name.
        Returns:
        The workflow node for an export to persistence action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • exportToXml

        public static WorkflowNode exportToXml​(String exportName,
                                               boolean attachToFormRecord)
                                        throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPORT_TO_PERSISTENCE that creates a persistence file with the submitted form data. All additional EExportToXmlFields are included.
        Parameters:
        exportName - Name of the created persistence file. Leave empty for an automatically generated name.
        attachToFormRecord - When true, attaches the created file to the form record.
        Returns:
        The workflow node for an export to persistence action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • exportToXml

        public static WorkflowNode exportToXml​(String exportName,
                                               boolean attachToFormRecord,
                                               Iterable<EExportToXmlField> exportFields,
                                               Textbaustein xslTemplate)
                                        throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_EXPORT_TO_PERSISTENCE that creates a persistence file with the submitted form data.
        Parameters:
        exportName - Name of the created persistence file. Leave empty for an automatically generated name.
        attachToFormRecord - When true, attaches the created file to the form record.
        exportFields - Additional fields that should be included in the exported file.
        xslTemplate - Optional XSL template for transforming the created XML file.
        Returns:
        The workflow node for an export to persistence action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • fillPdf

        public static WorkflowNode fillPdf​(SingleFile pdfDocument)
                                    throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_FILL_PDF that fills a PDF document with the submitted form data. The file name of the created PDF document is generated automatically. The create file is not attached to the form record.
        Parameters:
        pdfDocument - PDF document to fill.
        Returns:
        The workflow node for a fill PDF action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • fillPdf

        public static WorkflowNode fillPdf​(SingleFile pdfDocument,
                                           String exportName,
                                           boolean attachToFormRecord,
                                           String font)
                                    throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_FILL_PDF that fills a PDF document with the submitted form data.
        Parameters:
        pdfDocument - PDF document to fill.
        exportName - Name of the created PDF file. Leave empty for an automatically generated name.
        attachToFormRecord - When true, attaches the created file to the form record.
        font - The font to use within the PDF for the inserted values.
        Returns:
        The workflow node for a fill PDF action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • fillWord

        public static WorkflowNode fillWord​(SingleFile wordDocument)
                                     throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_FILL_WORD that fills a Word document with the submitted form data. The name of the created file is generated automatically. The created file is not attached to the form record.
        Parameters:
        wordDocument - Word document to fill.
        Returns:
        The workflow node for a fill Word action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • fillWord

        public static WorkflowNode fillWord​(SingleFile wordDocument,
                                            String exportName,
                                            boolean attachToFormRecord)
                                     throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_FILL_WORD that fills a Word document with the submitted form data.
        Parameters:
        wordDocument - Word document to fill.
        exportName - Name of the created file. Should end on either .pdf or .docx. Leave empty for an automatically generated name.
        attachToFormRecord - When true, attaches the created file to the form record.
        Returns:
        The workflow node for a fill Word action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • httpRequest

        public static IHttpRequestNodeBuilder httpRequest​(EHttpVerb httpVerb,
                                                          String endpointUrl)
        Creates a builder for a new workflow node for a EWorkflowNodeType.FC_POST_REQUEST that sends an HTTP request to the given URL.
        Parameters:
        httpVerb - HTTP verb to use, such as GET or POST.
        endpointUrl - URL to which to direct the HTTP request.
        Returns:
        A builder for configuring the details of the post request action.
      • httpRequest

        public static IHttpRequestNodeBuilder httpRequest​(String httpVerb,
                                                          String endpointUrl)
        Creates a builder for a new workflow node for a EWorkflowNodeType.FC_POST_REQUEST that sends an HTTP request to the given URL.
        Parameters:
        httpVerb - HTTP verb to use, such as GET or POST.
        endpointUrl - URL to which to direct the HTTP request.
        Returns:
        A builder for configuring the details of the post request action.
      • importFormValueFromXml

        public static WorkflowNode importFormValueFromXml​(SingleFile xmlDocument,
                                                          Map<String,​String> xPathMapping)
                                                   throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_IMPORT_FORM_VALUE_FROM_XML that changes the value of form elements based on the data of an XML document.
        Parameters:
        xmlDocument - XML document with the data to use.
        xPathMapping - A map between the name of a form element and an XPath. The value of the form element is set to the data in the XML document at the given XPath.
        Returns:
        The workflow node for a import form values from XML action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • importFormValueFromXml

        public static WorkflowNode importFormValueFromXml​(SingleFile xmlDocument,
                                                          Map<String,​String> xPathMapping,
                                                          Textbaustein xslTemplate)
                                                   throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_IMPORT_FORM_VALUE_FROM_XML that changes the value of form elements based on the data of an XML document.
        Parameters:
        xmlDocument - XML document with the data to use.
        xPathMapping - A map between the name of a form element and an XPath. The value of the form element is set to the data in the XML document at the given XPath.
        xslTemplate - Optional XSLT document applied to the XML document before data is extracted via the given XPaths.
        Returns:
        The workflow node for a import form values from XML action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • ldapQuery

        public static WorkflowNode ldapQuery​(LDAPAbfrage ldapQuery,
                                             Map<String,​String> queryParameters)
                                      throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_LDAP_QUERY that uses a preconfigured LDAP query.
        Parameters:
        ldapQuery - Existing LDAP query to execute.
        queryParameters - Query parameters that are passed to the existing query. Must match the parameter count of the LDAP query.
        Returns:
        The workflow node for an LDAP query action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • ldapQuery

        public static WorkflowNode ldapQuery​(LDAPZugriff ldapConnection,
                                             String searchFilter)
                                      throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_LDAP_QUERY with a custom search filter.
        Parameters:
        ldapConnection - LDAP connection to use for the query. When null, the client LDAP connection is used.
        searchFilter - The LDAP search filter expression.
        Returns:
        The workflow node for an LDAP query action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • ldapQuery

        public static WorkflowNode ldapQuery​(LDAPZugriff ldapConnection,
                                             String searchFilter,
                                             String baseDn)
                                      throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_LDAP_QUERY with a custom search filter.
        Parameters:
        ldapConnection - LDAP connection to use for the query. When null, the client LDAP connection is used.
        searchFilter - The LDAP search filter expression.
        baseDn - Base DN for the LDAP search.
        Returns:
        The workflow node for an LDAP query action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • ldapQuery

        public static WorkflowNode ldapQuery​(LDAPZugriff ldapConnection,
                                             String searchFilter,
                                             String baseDn,
                                             Iterable<String> resultFilter)
                                      throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_LDAP_QUERY with a custom search filter.
        Parameters:
        ldapConnection - LDAP connection to use for the query. When null, the client LDAP connection is used.
        searchFilter - The LDAP search filter expression.
        baseDn - Base DN for the LDAP search.
        resultFilter - Result filter to limit the returned data to these attributes.
        Returns:
        The workflow node for an LDAP query action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • multipleCondition

        public static WorkflowNode multipleCondition​(FcMultipleConditionProps props,
                                                     WorkflowNode consequent,
                                                     WorkflowNode alternate)
                                              throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_MULTIPLE_CONDITION that executes one of its children depending on the result of a logical test that may consist of multiple conditions.
        Parameters:
        props - Properties for the condition that describe the logical test.
        consequent - Child that will be executed when the test succeeds.
        alternate - Child that will be executed when the test fails.
        Returns:
        The workflow node for a multiple condition action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • provideResource

        public static WorkflowNode provideResource​(SingleFile singleFile,
                                                   String exportName)
                                            throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_PROVIDE_RESOURCE that provides the given resource.
        Parameters:
        singleFile - Resource that is made available by the action. Use the static factory methods provided by SingleFile to create an instance.
        exportName - Name of the file that is created by the action.
        Returns:
        The workflow node for a provide resource action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • provideResource

        public static WorkflowNode provideResource​(SingleFile singleFile,
                                                   String exportName,
                                                   boolean attachToFormRecord)
                                            throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_PROVIDE_RESOURCE that provides the given resource.
        Parameters:
        singleFile - Resource that is made available by the action. Use the static factory methods provided by SingleFile to create an instance.
        exportName - Name of the file that is created by the action.
        attachToFormRecord - Whether the provided file should be attached to the current form record.
        Returns:
        The workflow node for a provide resource action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • queueTask

        public static WorkflowNode queueTask​(WorkflowTrigger triggerToInvoke,
                                             boolean addToEnd)
                                      throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_QUEUE_TASK that invokes the given task.
        Parameters:
        triggerToInvoke - Trigger to invoke. Should be of type EWorkflowTriggerType.FC_MANUAL.
        addToEnd - When true, the task is added to the end of the task queue. Otherwise, the task is added at the beginning of the task queue (and will be executed once this task finishes).
        Returns:
        The workflow node for a queue task action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • returnFile

        public static WorkflowNode returnFile​(MultiFile files,
                                              boolean forceDownload)
                                       throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_RETURN_FILE that sends the given files as the HTTP response.
        Parameters:
        files - Files to send.
        forceDownload - If true, sets the Content-Disposition header to attachment, so that the browser does not show the file inline.
        Returns:
        The workflow node for a return file action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • saveToFileSystem

        public static WorkflowNode saveToFileSystem​(MultiFile files,
                                                    String directory)
                                             throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_SAVE_TO_FILE_SYSTEM that saves the given file to a directory on the file system.
        Parameters:
        files - Files to save to the file system.
        directory - Path to a directory on the file system.
        Returns:
        The workflow node for a save to file system action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • saveToFileSystem

        public static WorkflowNode saveToFileSystem​(MultiFile files,
                                                    String directory,
                                                    boolean allowPathInPlaceholder)
                                             throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_SAVE_TO_FILE_SYSTEM that saves the given file to a directory on the file system.
        Parameters:
        files - Files to save to the file system.
        directory - Path to a directory on the file system.
        allowPathInPlaceholder - When true, paths (forward or backward slashes) are allowed in the values of placeholders. When false, placeholder values are sanitized so that they are valid file names.
        Returns:
        The workflow node for a save to file system action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • sequence

        public static WorkflowNode sequence​(WorkflowNode... blocks)
        Creates a new workflow node for a EWorkflowNodeType.SEQUENCE that executes it children in order.
        Parameters:
        blocks - Children that are executed in order by the node.
        Returns:
        The workflow node for a sequence action.
      • throwException

        public static WorkflowNode throwException​(String errorType,
                                                  String errorMessage)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_THROW_EXCEPTION that throws an exception when executed.
        Parameters:
        errorType - Type of the exception to throw.
        errorMessage - Message of the exception to throw.
        Returns:
        The workflow node for a throw exception action.
        Throws:
        FastJsonException - When the properties model could not be serialized.
      • throwException

        public static WorkflowNode throwException​(String errorType,
                                                  String errorMessage,
                                                  Object errorData)
                                           throws FastJsonException
        Creates a new workflow node for a EWorkflowNodeType.FC_THROW_EXCEPTION that throws an exception when executed.
        Parameters:
        errorType - Type of the exception to throw.
        errorMessage - Message of the exception to throw.
        errorData - Additional data to make available when the exception is thrown. Can be accessed when the exception is caught.
        Returns:
        The workflow node for a throw exception action.
        Throws:
        FastJsonException - When the properties model could not be serialized.