Package org.camunda.bpm.engine.impl
Class FormServiceImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.ServiceImpl
-
- org.camunda.bpm.engine.impl.FormServiceImpl
-
- All Implemented Interfaces:
FormService
public class FormServiceImpl extends ServiceImpl implements FormService
- Author:
- Tom Baeyens, Falko Menge (camunda)
-
-
Field Summary
-
Fields inherited from class org.camunda.bpm.engine.impl.ServiceImpl
commandExecutor
-
-
Constructor Summary
Constructors Constructor Description FormServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
getDeployedStartForm(java.lang.String processDefinitionId)
Retrieves a deployed start form for a process definition with a given id.java.io.InputStream
getDeployedTaskForm(java.lang.String taskId)
Retrieves a deployed task form for a task with a given id.java.lang.Object
getRenderedStartForm(java.lang.String processDefinitionId)
Rendered form generated by the default build-in form engine for starting a new process instance.java.lang.Object
getRenderedStartForm(java.lang.String processDefinitionId, java.lang.String engineName)
Rendered form generated by the given build-in form engine for starting a new process instance.java.lang.Object
getRenderedTaskForm(java.lang.String taskId)
Rendered form generated by the default build-in form engine for completing a task.java.lang.Object
getRenderedTaskForm(java.lang.String taskId, java.lang.String engineName)
Rendered form generated by the given build-in form engine for completing a task.StartFormData
getStartFormData(java.lang.String processDefinitionId)
Retrieves all data necessary for rendering a form to start a new process instance.java.lang.String
getStartFormKey(java.lang.String processDefinitionId)
Retrieves a user defined reference to a start form.VariableMap
getStartFormVariables(java.lang.String processDefinitionId)
Retrieves a list of all variables for rendering a start from.VariableMap
getStartFormVariables(java.lang.String processDefinitionId, java.util.Collection<java.lang.String> formVariables, boolean deserializeObjectValues)
Retrieves a list of requested variables for rendering a start from.TaskFormData
getTaskFormData(java.lang.String taskId)
Retrieves all data necessary for rendering a form to complete a task.java.lang.String
getTaskFormKey(java.lang.String processDefinitionId, java.lang.String taskDefinitionKey)
Retrieves a user defined reference to a task form.VariableMap
getTaskFormVariables(java.lang.String taskId)
Retrieves a list of all variables for rendering a task form.VariableMap
getTaskFormVariables(java.lang.String taskId, java.util.Collection<java.lang.String> formVariables, boolean deserializeObjectValues)
Retrieves a list of requested variables for rendering a task form.ProcessInstance
submitStartForm(java.lang.String processDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.Object> properties)
Start a new process instance with the user data that was entered as properties in a start form.ProcessInstance
submitStartForm(java.lang.String processDefinitionId, java.util.Map<java.lang.String,java.lang.Object> properties)
Start a new process instance with the user data that was entered as properties in a start form.ProcessInstance
submitStartFormData(java.lang.String processDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.String> properties)
ProcessInstance
submitStartFormData(java.lang.String processDefinitionId, java.util.Map<java.lang.String,java.lang.String> properties)
void
submitTaskForm(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.Object> properties)
Completes a task with the user data that was entered as properties in a task form.void
submitTaskFormData(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.String> properties)
VariableMap
submitTaskFormWithVariablesInReturn(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.Object> properties, boolean deserializeValues)
Completes a task with the user data that was entered as properties in a task form.-
Methods inherited from class org.camunda.bpm.engine.impl.ServiceImpl
getCommandExecutor, setCommandExecutor
-
-
-
-
Method Detail
-
getRenderedStartForm
public java.lang.Object getRenderedStartForm(java.lang.String processDefinitionId)
Description copied from interface:FormService
Rendered form generated by the default build-in form engine for starting a new process instance.- Specified by:
getRenderedStartForm
in interfaceFormService
-
getRenderedStartForm
public java.lang.Object getRenderedStartForm(java.lang.String processDefinitionId, java.lang.String engineName)
Description copied from interface:FormService
Rendered form generated by the given build-in form engine for starting a new process instance.- Specified by:
getRenderedStartForm
in interfaceFormService
-
getRenderedTaskForm
public java.lang.Object getRenderedTaskForm(java.lang.String taskId)
Description copied from interface:FormService
Rendered form generated by the default build-in form engine for completing a task.- Specified by:
getRenderedTaskForm
in interfaceFormService
-
getRenderedTaskForm
public java.lang.Object getRenderedTaskForm(java.lang.String taskId, java.lang.String engineName)
Description copied from interface:FormService
Rendered form generated by the given build-in form engine for completing a task.- Specified by:
getRenderedTaskForm
in interfaceFormService
-
getStartFormData
public StartFormData getStartFormData(java.lang.String processDefinitionId)
Description copied from interface:FormService
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.- Specified by:
getStartFormData
in interfaceFormService
-
getTaskFormData
public TaskFormData getTaskFormData(java.lang.String taskId)
Description copied from interface:FormService
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.- Specified by:
getTaskFormData
in interfaceFormService
-
submitStartFormData
public ProcessInstance submitStartFormData(java.lang.String processDefinitionId, java.util.Map<java.lang.String,java.lang.String> properties)
- Specified by:
submitStartFormData
in interfaceFormService
-
submitStartFormData
public ProcessInstance submitStartFormData(java.lang.String processDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.String> properties)
- Specified by:
submitStartFormData
in interfaceFormService
-
submitStartForm
public ProcessInstance submitStartForm(java.lang.String processDefinitionId, java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface:FormService
Start a new process instance with the user data that was entered as properties in a start form.- Specified by:
submitStartForm
in interfaceFormService
-
submitStartForm
public ProcessInstance submitStartForm(java.lang.String processDefinitionId, java.lang.String businessKey, java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface:FormService
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.- Specified by:
submitStartForm
in interfaceFormService
- 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.
-
submitTaskFormData
public void submitTaskFormData(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.String> properties)
- Specified by:
submitTaskFormData
in interfaceFormService
-
submitTaskForm
public void submitTaskForm(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface:FormService
Completes a task with the user data that was entered as properties in a task form.- Specified by:
submitTaskForm
in interfaceFormService
-
submitTaskFormWithVariablesInReturn
public VariableMap submitTaskFormWithVariablesInReturn(java.lang.String taskId, java.util.Map<java.lang.String,java.lang.Object> properties, boolean deserializeValues)
Description copied from interface:FormService
Completes a task with the user data that was entered as properties in a task form.- Specified by:
submitTaskFormWithVariablesInReturn
in interfaceFormService
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
-
getStartFormKey
public java.lang.String getStartFormKey(java.lang.String processDefinitionId)
Description copied from interface:FormService
Retrieves a user defined reference to a start form. In the Explorer app, it is assumed that the form key specifies a resource in the deployment, which is the template for the form. But users are free to use this property differently.- Specified by:
getStartFormKey
in interfaceFormService
-
getTaskFormKey
public java.lang.String getTaskFormKey(java.lang.String processDefinitionId, java.lang.String taskDefinitionKey)
Description copied from interface:FormService
Retrieves a user defined reference to a task form. In the Explorer app, it is assumed that the form key specifies a resource in the deployment, which is the template for the form. But users are free to use this property differently. Both arguments can be obtained fromTask
instances returned by anyTaskQuery
.- Specified by:
getTaskFormKey
in interfaceFormService
-
getStartFormVariables
public VariableMap getStartFormVariables(java.lang.String processDefinitionId)
Description copied from interface:FormService
Retrieves a list of all variables for rendering a start from. The method takes into account FormData specified for the start event. This allows defining default values for form fields.- Specified by:
getStartFormVariables
in interfaceFormService
- Parameters:
processDefinitionId
- the id of the process definition for which the start form should be retrieved.- Returns:
- a map of VariableInstances.
-
getStartFormVariables
public VariableMap getStartFormVariables(java.lang.String processDefinitionId, java.util.Collection<java.lang.String> formVariables, boolean deserializeObjectValues)
Description copied from interface:FormService
Retrieves a list of requested variables for rendering a start from. The method takes into account FormData specified for the start event. This allows defining default values for form fields.- Specified by:
getStartFormVariables
in interfaceFormService
- 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.
-
getTaskFormVariables
public VariableMap getTaskFormVariables(java.lang.String taskId)
Description copied from interface:FormService
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.
- Specified by:
getTaskFormVariables
in interfaceFormService
- Parameters:
taskId
- the id of the task for which the variables should be retrieved.- Returns:
- a map of VariableInstances.
-
getTaskFormVariables
public VariableMap getTaskFormVariables(java.lang.String taskId, java.util.Collection<java.lang.String> formVariables, boolean deserializeObjectValues)
Description copied from interface:FormService
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.
- Specified by:
getTaskFormVariables
in interfaceFormService
- 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.
-
getDeployedStartForm
public java.io.InputStream getDeployedStartForm(java.lang.String processDefinitionId)
Description copied from interface:FormService
Retrieves a deployed start form for a process definition with a given id.- Specified by:
getDeployedStartForm
in interfaceFormService
-
getDeployedTaskForm
public java.io.InputStream getDeployedTaskForm(java.lang.String taskId)
Description copied from interface:FormService
Retrieves a deployed task form for a task with a given id.- Specified by:
getDeployedTaskForm
in interfaceFormService
-
-