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
-
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 for chaining.
-
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 for chaining.
-
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 for chaining.
-
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 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 for chaining.
-
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 for chaining.
-
unsafeSkipFormRecordLock
public WorkflowTaskRunnerParams.Builder unsafeSkipFormRecordLock(boolean unsafeSkipFormRecordLock)
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 for chaining
-
user
public WorkflowTaskRunnerParams.Builder user(Benutzer user)
- Parameters:
user
- The user who initiated the workflow execution. If not given, an anonymous user is used.- Returns:
- this for chaining.
-
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 for chaining.
-
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 for chaining.
-
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 for chaining.
-
-