Package de.xima.fc.refactor
Class WorkflowPlaceholderRefactorProcessor
- java.lang.Object
-
- de.xima.fc.refactor.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 Summary
Constructors Constructor Description WorkflowPlaceholderRefactorProcessor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IPlaceholderRefactorMappercreateFormElementNameChangeRefactorer(String oldName, String newName)Creates the refactorer that can be used withrefactorPlaceholders(Object, IElementHandler, IPlaceholderRefactorMapper)for when a form element name was renamed.static booleanrefactorPlaceholders(Object data, IElementHandler<?,?> handler, IPlaceholderRefactorMapper refactorer)Replaces all placeholders in the given properties model of a workflow element.static booleanrefactorPlaceholdersInWorkflowElement(AWorkflowElement<?,?> element, IPlaceholderRefactorMapper refactorer, Mandant client)PerformsrefactorPlaceholdersin the given workflow element (node or trigger).static IWorkflowPlaceholderRefactorRetValrefactorPlaceholdersInWorkflowProcess(WorkflowProcess process, IPlaceholderRefactorMapper refactorer, Mandant client)PerformsrefactorPlaceholdersin all elements of the given process.static IWorkflowPlaceholderRefactorRetValrefactorPlaceholdersInWorkflowTask(WorkflowTask task, IPlaceholderRefactorMapper refactorer, Mandant client)PerformsrefactorPlaceholdersin all elements of the given task.static IWorkflowPlaceholderRefactorRetValrefactorPlaceholdersInWorkflowVersion(long workflowVersionId, IPlaceholderRefactorMapper refactorer, IEntityContext ec)Reads the given workflow version from the database, performsrefactorPlaceholderson that version, and writes back the version to the database.static IWorkflowPlaceholderRefactorRetValrefactorPlaceholdersInWorkflowVersion(WorkflowVersion version, IPlaceholderRefactorMapper refactorer, Mandant client)PerformsrefactorPlaceholdersin all elements of the given version.
-
-
-
Method Detail
-
createFormElementNameChangeRefactorer
public static IPlaceholderRefactorMapper createFormElementNameChangeRefactorer(String oldName, String newName)
Creates the refactorer that can be used withrefactorPlaceholders(Object, IElementHandler, IPlaceholderRefactorMapper)for when a form element name was renamed. Replaces form placeholders with the old name with a placeholder for the new name.- Parameters:
oldName- Old name of a form element.newName- New name of a form element.- Returns:
trueif at least on change was made,falseotherwise.
-
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:
trueif at least on change was made,falseotherwise.- 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
PerformsrefactorPlaceholdersin 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)
PerformsrefactorPlaceholdersin 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)
PerformsrefactorPlaceholdersin 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, performsrefactorPlaceholderson 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)
PerformsrefactorPlaceholdersin 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.
-
-