Class WorkflowPlaceholderRefactorProcessor


  • public final class WorkflowPlaceholderRefactorProcessor
    extends Object
    Methods for processing and replacing placeholders in workflow elements.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • WorkflowPlaceholderRefactorProcessor

        public WorkflowPlaceholderRefactorProcessor()
    • Method Detail

      • refactorPlaceholders

        public static boolean refactorPlaceholders​(Object data,
                                                   IElementHandler<?,​?> handler,
                                                   IPlaceholderRefactorMapper refactorer)
                                            throws WorkflowPlaceholderException
        Replaces all placeholders in the given properties model of a workflow element.
        Parameters:
        data - Properties model of a workflow element.
        handler - Handler for that workflow element.
        refactorer - Refactor function that map to a new placeholder.
        Returns:
        true if at least on change was made, false otherwise.
        Throws:
        WorkflowPlaceholderException - When the placeholders could not be modified, e.g. when the handler threw an exception.
      • refactorPlaceholdersInWorkflowElement

        public static boolean refactorPlaceholdersInWorkflowElement​(AWorkflowElement<?,​?> element,
                                                                    IPlaceholderRefactorMapper refactorer,
                                                                    Mandant client)
                                                             throws WorkflowPlaceholderException
        Performs refactorPlaceholders in the given workflow element (node or trigger). It is assumed that all lazy child entities have been initialized already or that a database session is currently active for fetching the entities.
        Parameters:
        element - Workflow element in which to replace.
        refactorer - Refactorer to use for replacing placeholders.
        client - Current client for retrieving node handlers.
        Returns:
        Whether any changed took place.
        Throws:
        WorkflowPlaceholderException - When the placeholders could not be modified, e.g. when a handler threw an exception.
      • refactorPlaceholdersInWorkflowProcess

        public static IWorkflowPlaceholderRefactorRetVal refactorPlaceholdersInWorkflowProcess​(WorkflowProcess process,
                                                                                               IPlaceholderRefactorMapper refactorer,
                                                                                               Mandant client)
        Performs refactorPlaceholders in all elements of the given process. It is assumed that all lazy child entities have been initialized already or that a database session is currently active for fetching the entities.
        Parameters:
        process - Workflow process in which to replace.
        refactorer - Refactorer to use for replacing placeholders.
        client - Current client for retrieving node handlers.
        Returns:
        The result of the refactoring.
      • refactorPlaceholdersInWorkflowTask

        public static IWorkflowPlaceholderRefactorRetVal refactorPlaceholdersInWorkflowTask​(WorkflowTask task,
                                                                                            IPlaceholderRefactorMapper refactorer,
                                                                                            Mandant client)
        Performs refactorPlaceholders in all elements of the given task. It is assumed that all lazy child entities have been initialized already or that a database session is currently active for fetching the entities.
        Parameters:
        task - Workflow task in which to replace.
        refactorer - Refactorer to use for replacing placeholders.
        client - Current client for retrieving node handlers.
        Returns:
        The result of the refactoring.
      • refactorPlaceholdersInWorkflowVersion

        public static IWorkflowPlaceholderRefactorRetVal refactorPlaceholdersInWorkflowVersion​(long workflowVersionId,
                                                                                               IPlaceholderRefactorMapper refactorer,
                                                                                               IEntityContext ec)
                                                                                        throws WorkflowPlaceholderException
        Reads the given workflow version from the database, performs refactorPlaceholders on that version, and writes back the version to the database.
        Parameters:
        workflowVersionId - ID of the workflow version in which to replace placeholders.
        refactorer - Refactorer to use for replacing placeholders.
        ec - Entity context to use for accessing the database.
        Returns:
        Whether any changed took place.
        Throws:
        WorkflowPlaceholderException - When the placeholders could not be modified, e.g. when a handler threw an exception.
      • refactorPlaceholdersInWorkflowVersion

        public static IWorkflowPlaceholderRefactorRetVal refactorPlaceholdersInWorkflowVersion​(WorkflowVersion version,
                                                                                               IPlaceholderRefactorMapper refactorer,
                                                                                               Mandant client)
        Performs refactorPlaceholders in all elements of the given version. It is assumed that all lazy child entities have been initialized already or that a database session is currently active for fetching the entities.
        Parameters:
        version - Workflow version in which to replace.
        refactorer - Refactorer to use for replacing placeholders.
        client - Current client for retrieving node handlers.
        Returns:
        The result of the refactoring.