Interface FormService
- All Known Implementing Classes:
FormServiceImpl
- Author:
- Tom Baeyens, Falko Menge (camunda)
-
Method Summary
Modifier and TypeMethodDescriptiongetDeployedStartForm
(String processDefinitionId) Retrieves a deployed start form for a process definition with a given id.getDeployedTaskForm
(String taskId) Retrieves a deployed task form for a task with a given id.getRenderedStartForm
(String processDefinitionId) Rendered form generated by the default build-in form engine for starting a new process instance.getRenderedStartForm
(String processDefinitionId, String formEngineName) Rendered form generated by the given build-in form engine for starting a new process instance.getRenderedTaskForm
(String taskId) Rendered form generated by the default build-in form engine for completing a task.getRenderedTaskForm
(String taskId, String formEngineName) Rendered form generated by the given build-in form engine for completing a task.getStartFormData
(String processDefinitionId) Retrieves all data necessary for rendering a form to start a new process instance.getStartFormKey
(String processDefinitionId) Retrieves a user defined reference to a start form.getStartFormVariables
(String processDefinitionId) Retrieves a list of all variables for rendering a start from.getStartFormVariables
(String processDefinitionId, Collection<String> formVariables, boolean deserializeObjectValues) Retrieves a list of requested variables for rendering a start from.getTaskFormData
(String taskId) Retrieves all data necessary for rendering a form to complete a task.getTaskFormKey
(String processDefinitionId, String taskDefinitionKey) Retrieves a user defined reference to a task form.getTaskFormVariables
(String taskId) Retrieves a list of all variables for rendering a task form.getTaskFormVariables
(String taskId, Collection<String> formVariables, boolean deserializeObjectValues) Retrieves a list of requested variables for rendering a task form.Start a new process instance with the user data that was entered as properties in a start form.submitStartForm
(String processDefinitionId, Map<String, Object> properties) Start a new process instance with the user data that was entered as properties in a start form.Deprecated.submitStartFormData
(String processDefinitionId, Map<String, String> properties) Deprecated.void
submitTaskForm
(String taskId, Map<String, Object> properties) Completes a task with the user data that was entered as properties in a task form.void
submitTaskFormData
(String taskId, Map<String, String> properties) Deprecated.submitTaskFormWithVariablesInReturn
(String taskId, Map<String, Object> properties, boolean deserializeValues) Completes a task with the user data that was entered as properties in a task form.
-
Method Details
-
getStartFormData
Retrieves all data necessary for rendering a form to start a new process instance. This can be used to perform rendering of the forms outside of the process engine.- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
-
getRenderedStartForm
Rendered form generated by the default build-in form engine for starting a new process instance.- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
-
getRenderedStartForm
Rendered form generated by the given build-in form engine for starting a new process instance.- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
-
submitStartFormData
@Deprecated ProcessInstance submitStartFormData(String processDefinitionId, Map<String, String> properties) Deprecated. -
submitStartForm
Start a new process instance with the user data that was entered as properties in a start form.- Throws:
AuthorizationException
- If the user has noPermissions.CREATE
permission onResources.PROCESS_INSTANCE
and noPermissions.CREATE_INSTANCE
permission onResources.PROCESS_DEFINITION
.
-
submitStartFormData
@Deprecated ProcessInstance submitStartFormData(String processDefinitionId, String businessKey, Map<String, String> properties) Deprecated. -
submitStartForm
ProcessInstance submitStartForm(String processDefinitionId, String businessKey, Map<String, Object> properties) Start a new process instance with the user data that was entered as properties in a start form. A business key can be provided to associate the process instance with a certain identifier that has a clear business meaning. For example in an order process, the business key could be an order id. This business key can then be used to easily look up that process instance , seeProcessInstanceQuery.processInstanceBusinessKey(String)
. Providing such a business key is definitely a best practice. Note that a business key MUST be unique for the given process definition. Process instance from different process definition are allowed to have the same business key.- Parameters:
processDefinitionId
- the id of the process definition, cannot be null.businessKey
- a key that uniquely identifies the process instance in the context or the given process definition.properties
- the properties to pass, can be null.- Throws:
AuthorizationException
- If the user has noPermissions.CREATE
permission onResources.PROCESS_INSTANCE
and noPermissions.CREATE_INSTANCE
permission onResources.PROCESS_DEFINITION
.
-
getTaskFormData
Retrieves all data necessary for rendering a form to complete a task. This can be used to perform rendering of the forms outside of the process engine.- Throws:
AuthorizationException
-In case of standalone tasks:
- if the user has no
Permissions.READ
permission onResources.TASK
or- if the user has no
TaskPermissions#READ_VARIABLE
permission onResources.TASK
In case the task is part of a running process instance:
- if the user has no
- if the user has no
Permissions.READ
permission onResources.TASK
or noPermissions.READ_TASK
permission onResources.PROCESS_DEFINITION
- if the user has
TaskPermissions#READ_VARIABLE
permission onResources.TASK
or noProcessDefinitionPermissions#READ_TASK_VARIABLE
permission onResources.PROCESS_DEFINITION
whenthis
config is enabled
-
-
getRenderedTaskForm
Rendered form generated by the default build-in form engine for completing a task.- Throws:
AuthorizationException
-In case of standalone tasks:
- if the user has no
Permissions.READ
permission onResources.TASK
or- if the user has no
TaskPermissions#READ_VARIABLE
permission onResources.TASK
whenthis
config is enabledIn case the task is part of a running process instance:
- if the user has no
- if the user has no
Permissions.READ
permission onResources.TASK
or noPermissions.READ_TASK
permission onResources.PROCESS_DEFINITION
- if the user has
TaskPermissions#READ_VARIABLE
permission onResources.TASK
or noProcessDefinitionPermissions#READ_TASK_VARIABLE
permission onResources.PROCESS_DEFINITION
whenthis
config is enabled
getRenderedTaskForm
- Throws:
AuthorizationException
-In case of standalone tasks:
- if the user has no
Permissions.READ
permission onResources.TASK
or- if the user has no
TaskPermissions#READ_VARIABLE
permission onResources.TASK
whenthis
config is enabledIn case the task is part of a running process instance:
- if the user has no
Permissions.READ
permission on Resources.TASK
or
no Permissions.READ_TASK
permission on Resources.PROCESS_DEFINITION
TaskPermissions#READ_VARIABLE
permission on Resources.TASK
or
no ProcessDefinitionPermissions#READ_TASK_VARIABLE
permission on Resources.PROCESS_DEFINITION
when this
config is enabledsubmitTaskFormData
submitTaskForm
- Parameters:
taskId
-properties
-- Throws:
AuthorizationException
- If the user has noPermissions.UPDATE
permission onResources.TASK
or noPermissions.UPDATE_TASK
permission onResources.PROCESS_DEFINITION
.
submitTaskFormWithVariablesInReturn
- Parameters:
taskId
-properties
-deserializeValues
- if false, returnedSerializableValue
s will not be deserialized (unless they are passed into this method as a deserialized value or if the BPMN process triggers deserialization)- Returns:
- a map of process variables
- Throws:
AuthorizationException
- If the user has noPermissions.UPDATE
permission onResources.TASK
or noPermissions.UPDATE_TASK
permission onResources.PROCESS_DEFINITION
.
getStartFormVariables
- Parameters:
processDefinitionId
- the id of the process definition for which the start form should be retrieved.- Returns:
- a map of VariableInstances.
- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
getStartFormVariables
- Parameters:
processDefinitionId
- the id of the process definition for which the start form should be retrieved.formVariables
- a Collection of the names of the variables to retrieve. Allows restricting the set of retrieved variables.deserializeObjectValues
- if false object values are not deserialized- Returns:
- a map of VariableInstances.
- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
getTaskFormVariables
Retrieves a list of all variables for rendering a task form. In addition to the task variables and process variables, the method takes into account FormData specified for the task. This allows defining default values for form fields.
A variable is resolved in the following order:
- First, the method collects all form fields and creates variable instances for the form fields.
- Next, the task variables are collected.
- Next, process variables from the parent scopes of the task are collected, until the process instance scope is reached.
- Parameters:
taskId
- the id of the task for which the variables should be retrieved.- Returns:
- a map of VariableInstances.
- Throws:
AuthorizationException
-In case of standalone tasks:
- if the user has no
Permissions.READ
permission onResources.TASK
or- if the user has no
TaskPermissions#READ_VARIABLE
permission onResources.TASK
whenthis
config is enabledIn case the task is part of a running process instance:
- if the user has no
Permissions.READ
permission on Resources.TASK
or
no Permissions.READ_TASK
permission on Resources.PROCESS_DEFINITION
TaskPermissions#READ_VARIABLE
permission on Resources.TASK
or
no ProcessDefinitionPermissions#READ_TASK_VARIABLE
permission on Resources.PROCESS_DEFINITION
when this
config is enabledgetTaskFormVariables
Retrieves a list of requested variables for rendering a task form. In addition to the task variables and process variables, the method takes into account FormData specified for the task. This allows defining default values for form fields.
A variable is resolved in the following order:
- First, the method collects all form fields and creates variable instances for the form fields.
- Next, the task variables are collected.
- Next, process variables from the parent scopes of the task are collected, until the process instance scope is reached.
- Parameters:
taskId
- the id of the task for which the variables should be retrieved.formVariables
- a Collection of the names of the variables to retrieve. Allows restricting the set of retrieved variables.deserializeObjectValues
- if false object values are not deserialized- Returns:
- a map of VariableInstances.
- Throws:
AuthorizationException
-In case of standalone tasks:
- if the user has no
Permissions.READ
permission onResources.TASK
or- if the user has no
TaskPermissions#READ_VARIABLE
permission onResources.TASK
whenthis
config is enabledIn case the task is part of a running process instance:
- if the user has no
Permissions.READ
permission on Resources.TASK
or
no Permissions.READ_TASK
permission on Resources.PROCESS_DEFINITION
TaskPermissions#READ_VARIABLE
permission on Resources.TASK
or
no ProcessDefinitionPermissions#READ_TASK_VARIABLE
permission on Resources.PROCESS_DEFINITION
when this
config is enabledgetStartFormKey
- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
getTaskFormKey
Task
instances returned by any
TaskQuery
.- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.
getDeployedStartForm
- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.PROCESS_DEFINITION
.NotFoundException
- If the start form cannot be found.BadUserRequestException
- If the start form key has wrong format ("embedded:deployment:" or "deployment: " required).
getDeployedTaskForm
- Throws:
AuthorizationException
- If the user has noPermissions.READ
permission onResources.TASK
.NotFoundException
- If the task form cannot be found.BadUserRequestException
- If the task form key has wrong format ("embedded:deployment:" or "deployment: " required).
submitStartForm(String, String, Map)