Package de.xima.fc.refactor
Class WorkflowPlaceholderRefactorProcessor
java.lang.Object
de.xima.fc.refactor.WorkflowPlaceholderRefactorProcessor
Methods for processing and replacing placeholders in workflow elements.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static boolean
refactorPlaceholders
(Object data, IElementHandler<?, ?> handler, IPlaceholderRefactorMapper refactorer) Replaces all placeholders in the given properties model of a workflow element.static boolean
refactorPlaceholdersInWorkflowElement
(AWorkflowElement<?, ?> element, IPlaceholderRefactorMapper refactorer, Mandant client) PerformsrefactorPlaceholders
in the given workflow element (node or trigger).refactorPlaceholdersInWorkflowProcess
(WorkflowProcess process, IPlaceholderRefactorMapper refactorer, Mandant client) PerformsrefactorPlaceholders
in all elements of the given process.refactorPlaceholdersInWorkflowTask
(WorkflowTask task, IPlaceholderRefactorMapper refactorer, Mandant client) PerformsrefactorPlaceholders
in all elements of the given task.refactorPlaceholdersInWorkflowVersion
(long workflowVersionId, IPlaceholderRefactorMapper refactorer, IEntityContext ec) Reads the given workflow version from the database, performsrefactorPlaceholders
on that version, and writes back the version to the database.refactorPlaceholdersInWorkflowVersion
(WorkflowVersion version, IPlaceholderRefactorMapper refactorer, Mandant client) PerformsrefactorPlaceholders
in all elements of the given version.
-
Constructor Details
-
WorkflowPlaceholderRefactorProcessor
public WorkflowPlaceholderRefactorProcessor()
-
-
Method Details
-
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:
true
if at least on change was made,false
otherwise.
-
refactorPlaceholders
public static boolean refactorPlaceholders(Object data, IElementHandler<?, ?> handler, IPlaceholderRefactorMapper refactorer) throws WorkflowPlaceholderExceptionReplaces 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 WorkflowPlaceholderExceptionPerformsrefactorPlaceholders
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) PerformsrefactorPlaceholders
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) PerformsrefactorPlaceholders
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, performsrefactorPlaceholders
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) PerformsrefactorPlaceholders
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.
-