Package de.xima.fc.workflow.model
Class WorkflowTaskRunnerParams.Builder
- java.lang.Object
-
- de.xima.fc.workflow.model.WorkflowTaskRunnerParams.Builder
-
- All Implemented Interfaces:
org.apache.commons.lang3.builder.Builder<IWorkflowTaskRunnerParams>
- Enclosing class:
- WorkflowTaskRunnerParams
public static final class WorkflowTaskRunnerParams.Builder extends Object implements org.apache.commons.lang3.builder.Builder<IWorkflowTaskRunnerParams>
A builder for creating theIWorkflowTaskRunnerParams
. Only theVorgang
is required, all other parameters can either be inferred from the form record, or have an appropriate default.Normally, you want to at least set a
locale(Locale)
, otherwise the client's default locale is used.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
-
-
-
Constructor Detail
-
Builder
public Builder(Vorgang formRecord)
Creates a new builder for executing a task of the given form record.- Parameters:
formRecord
- Form record for which a task is to be executed. Must not benull
.
-
-
Method Detail
-
addWorkflowExecutionPostProcessor
public WorkflowTaskRunnerParams.Builder addWorkflowExecutionPostProcessor(IWorkflowExecutionPostProcessor workflowExecutionPostProcessor)
- Parameters:
workflowExecutionPostProcessor
- A post processor to add, seeIWorkflowExecutionPostProcessor
for details.- Returns:
- This builder for chaining method calls.
-
anonymize
public WorkflowTaskRunnerParams.Builder anonymize(Boolean anonymize)
- Parameters:
anonymize
- Whether data related to individual persons or users must be anonymized. When not given, defaults tonull
. Whennull
, an appropriate default is used: (true
when theProjekt.isAnonymize()
requires it, orfalse
otherwise.)- Returns:
- This builder for chaining method calls.
-
build
public IWorkflowTaskRunnerParams build()
- Specified by:
build
in interfaceorg.apache.commons.lang3.builder.Builder<IWorkflowTaskRunnerParams>
-
client
public WorkflowTaskRunnerParams.Builder client(Mandant client)
- Parameters:
client
- The client to use for executing the workflow. If not given, the client of the form record or the user is used, if available.- Returns:
- This builder for chaining method calls.
-
clock
public WorkflowTaskRunnerParams.Builder clock(Clock clock)
- Parameters:
clock
- The clock to use for obtaining the current time.- Returns:
- This builder for chaining method calls.
-
defaultSystemState
public WorkflowTaskRunnerParams.Builder defaultSystemState(EWorkflowStateType defaultSystemState)
- Parameters:
defaultSystemState
- The system state set automatically when a form record has got no state (i.e. whenVorgang.getCurrentWorkflowState()
isnull
. Must no beEWorkflowStateType.CUSTOM
(as that is not a system state).- Returns:
- This builder for chaining method calls.
-
formDataAdapter
public WorkflowTaskRunnerParams.Builder formDataAdapter(IFormDataAdapter formDataAdapter)
- Parameters:
formDataAdapter
- The adapter containing the form data of the form record. When not given, a new form data adapter is created with the data from theVorgang.getCurrentFormeingang()
.- Returns:
- This builder for chaining method calls.
-
formReordLockContext
public WorkflowTaskRunnerParams.Builder formReordLockContext(IFormRecordLockContext formRecordLockContext)
- Parameters:
formRecordLockContext
- The context that is locking the form record.- Returns:
- this for chaining.
-
httpContextData
public WorkflowTaskRunnerParams.Builder httpContextData(IHttpContextData httpContextData)
- Parameters:
httpContextData
- Data of the current HTTP session, if one exists. If not given, dummy or empty data is used.- Returns:
- This builder for chaining method calls.
-
locale
public WorkflowTaskRunnerParams.Builder locale(Locale locale)
- Parameters:
locale
- Locale to use for locale-sensitive operations. When not given, the locale of the client or the default locale is used.- Returns:
- this for chaining.
-
project
public WorkflowTaskRunnerParams.Builder project(Projekt project)
- Parameters:
project
- The project to which the form record belongs. When not given, the project is read from the form record.- Returns:
- This builder for chaining method calls.
-
unsafeSkipFormRecordLock
@Deprecated public WorkflowTaskRunnerParams.Builder unsafeSkipFormRecordLock(boolean unsafeSkipFormRecordLock)
Deprecated.UseformReordLockContext(IFormRecordLockContext)
with a dummy context.Whether the form record should be locked for exclusive use, to ensure that a form record is not processed by multiple threads. This should normally be left at the defaultfalse
.- Parameters:
unsafeSkipFormRecordLock
- Whether the form record should be locked for exclusive use before a task is executed.- Returns:
- This builder for chaining method calls.
-
user
@Deprecated public WorkflowTaskRunnerParams.Builder user(Benutzer user)
Deprecated.Useuser(IUser)
instead.- Parameters:
user
- The user who initiated the workflow execution. If not given, an anonymous user is used.- Returns:
- This builder for chaining method calls.
-
user
public WorkflowTaskRunnerParams.Builder user(IUser user)
- Parameters:
user
- The user who initiated the workflow execution. If not given, an anonymous user is used.- Returns:
- This builder for chaining method calls.
-
workflowExecutionPostProcessors
public WorkflowTaskRunnerParams.Builder workflowExecutionPostProcessors(Iterable<IWorkflowExecutionPostProcessor> workflowExecutionPostProcessors)
- Parameters:
workflowExecutionPostProcessors
- The post processors to set (overwrites the current ones), seeIWorkflowExecutionPostProcessor
for details.- Returns:
- This builder for chaining method calls.
-
workflowVersion
public WorkflowTaskRunnerParams.Builder workflowVersion(WorkflowVersion workflowVersion)
- Parameters:
workflowVersion
- The workflow version with the process to execute. If not given, theVorgang.getWorkflowVersion()
is used.- Returns:
- This builder for chaining method calls.
-
xForm
public WorkflowTaskRunnerParams.Builder xForm(IXForm xForm)
- Parameters:
xForm
- The form belonging to the form record. If not given, the form is read from the currentVorgang.getFormVersion()
.- Returns:
- This builder for chaining method calls.
-
xFormRenderConfig
public WorkflowTaskRunnerParams.Builder xFormRenderConfig(IXFormRenderConfig xFormRenderConfig)
- Parameters:
xFormRenderConfig
- The configuration that was used to render the form. If not given, a new configuration is created for the project.- Returns:
- This builder for chaining method calls.
-
-