Class WorkflowFormOperations
- java.lang.Object
-
- cronapi.workflow.WorkflowFormOperations
-
public class WorkflowFormOperations extends Object
-
-
Constructor Summary
Constructors Constructor Description WorkflowFormOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static InputStreamgetDeployedStartForm(String processDefinitionId)Retrieves a deployed start form for a process definition with a given id.static InputStreamgetDeployedTaskForm(String taskId)Retrieves a deployed task form for a task with a given id.static ObjectgetRenderedStartForm(String processDefinitionId)Rendered form generated by the default build-in form engine for starting a new process instance.static ObjectgetRenderedStartForm(String processDefinitionId, String formEngineName)Rendered form generated by the given build-in form engine for starting a new process instance.static ObjectgetRenderedTaskForm(String taskId)Rendered form generated by the default build-in form engine for completing a task.static ObjectgetRenderedTaskForm(String taskId, String formEngineName)Rendered form generated by the given build-in form engine for completing a task.static org.camunda.bpm.engine.form.StartFormDatagetStartFormData(String processDefinitionId)Retrieves all data necessary for rendering a form to start a new process instance.static StringgetStartFormKey(String processDefinitionId)Retrieves a user defined reference to a start form.static org.camunda.bpm.engine.variable.VariableMapgetStartFormVariables(String processDefinitionId)Retrieves a list of all variables for rendering a start from.static org.camunda.bpm.engine.variable.VariableMapgetStartFormVariables(String processDefinitionId, Collection<String> formVariables, boolean deserializeObjectValues)Retrieves a list of requested variables for rendering a start from.static org.camunda.bpm.engine.form.TaskFormDatagetTaskFormData(String taskId)Retrieves all data necessary for rendering a form to complete a task.static StringgetTaskFormKey(String processDefinitionId, String taskDefinitionKey)Retrieves a user defined reference to a task form.static org.camunda.bpm.engine.variable.VariableMapgetTaskFormVariables(String taskId)Retrieves a list of all variables for rendering a task form.static org.camunda.bpm.engine.variable.VariableMapgetTaskFormVariables(String taskId, Collection<String> formVariables, boolean deserializeObjectValues)Retrieves a list of requested variables for rendering a task form.static org.camunda.bpm.engine.runtime.ProcessInstancesubmitStartForm(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.static org.camunda.bpm.engine.runtime.ProcessInstancesubmitStartForm(String processDefinitionId, Map<String,Object> properties)Start a new process instance with the user data that was entered as properties in a start form.static org.camunda.bpm.engine.runtime.ProcessInstancesubmitStartFormData(String processDefinitionId, String businessKey, Map<String,String> properties)Deprecated.static org.camunda.bpm.engine.runtime.ProcessInstancesubmitStartFormData(String processDefinitionId, Map<String,String> properties)Deprecated.static voidsubmitTaskForm(String taskId, Map<String,Object> properties)Completes a task with the user data that was entered as properties in a task form.static voidsubmitTaskFormData(String taskId, Map<String,String> properties)Deprecated.
-
-
-
Method Detail
-
getStartFormData
public static org.camunda.bpm.engine.form.StartFormData getStartFormData(String processDefinitionId)
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.- Parameters:
processDefinitionId- String- Returns:
- StartFormData
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
getRenderedStartForm
public static Object getRenderedStartForm(String processDefinitionId)
Rendered form generated by the default build-in form engine for starting a new process instance.- Parameters:
processDefinitionId- String- Returns:
- Object
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
getRenderedStartForm
public static Object getRenderedStartForm(String processDefinitionId, String formEngineName)
Rendered form generated by the given build-in form engine for starting a new process instance.- Parameters:
processDefinitionId- StringformEngineName- String- Returns:
- Object
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
submitStartFormData
public static org.camunda.bpm.engine.runtime.ProcessInstance submitStartFormData(String processDefinitionId, Map<String,String> properties)
Deprecated.- Parameters:
processDefinitionId- Stringproperties- Mapa- Returns:
- ProcessInstance
-
submitStartForm
public static org.camunda.bpm.engine.runtime.ProcessInstance 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.- Parameters:
processDefinitionId- Stringproperties- Mapa- Returns:
- ProcessInstance
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.CREATEpermission onResources.PROCESS_INSTANCEand noPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
submitStartFormData
public static org.camunda.bpm.engine.runtime.ProcessInstance submitStartFormData(String processDefinitionId, String businessKey, Map<String,String> properties)
Deprecated.- Parameters:
processDefinitionId- StringbusinessKey- Stringproperties- Mapa- Returns:
- ProcessInstance
-
submitStartForm
public static org.camunda.bpm.engine.runtime.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 , see
ProcessInstanceQuery.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.- Returns:
- ProcessInstance
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.CREATEpermission onResources.PROCESS_INSTANCEand noPermissions.CREATE_INSTANCEpermission onResources.PROCESS_DEFINITION.
-
getTaskFormData
public static org.camunda.bpm.engine.form.TaskFormData getTaskFormData(String taskId)
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.- Parameters:
taskId- String- Returns:
- TaskFormData
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.TASKor noPermissions.READ_TASKpermission onResources.PROCESS_DEFINITION.
-
getRenderedTaskForm
public static Object getRenderedTaskForm(String taskId)
Rendered form generated by the default build-in form engine for completing a task.- Parameters:
taskId- String- Returns:
- Object
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.TASKor noPermissions.READ_TASKpermission onResources.PROCESS_DEFINITION.
-
getRenderedTaskForm
public static Object getRenderedTaskForm(String taskId, String formEngineName)
Rendered form generated by the given build-in form engine for completing a task.- Parameters:
taskId- StringformEngineName- String- Returns:
- Object
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.TASKor noPermissions.READ_TASKpermission onResources.PROCESS_DEFINITION.
-
submitTaskFormData
public static void submitTaskFormData(String taskId, Map<String,String> properties)
Deprecated.- Parameters:
taskId- Stringproperties- Mapa
-
submitTaskForm
public static void submitTaskForm(String taskId, Map<String,Object> properties)
Completes a task with the user data that was entered as properties in a task form.- Parameters:
taskId- Stringproperties- Mapa- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.UPDATEpermission onResources.TASKor noPermissions.UPDATE_TASKpermission onResources.PROCESS_DEFINITION.
-
getStartFormVariables
public static org.camunda.bpm.engine.variable.VariableMap getStartFormVariables(String processDefinitionId)
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.- Parameters:
processDefinitionId- the id of the process definition for which the start form should be retrieved.- Returns:
- a map of VariableInstances.
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
getStartFormVariables
public static org.camunda.bpm.engine.variable.VariableMap getStartFormVariables(String processDefinitionId, Collection<String> formVariables, boolean deserializeObjectValues)
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.- 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:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
getTaskFormVariables
public static org.camunda.bpm.engine.variable.VariableMap getTaskFormVariables(String taskId)
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:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.TASKor noPermissions.READ_TASKpermission onResources.PROCESS_DEFINITION.
-
getTaskFormVariables
public static org.camunda.bpm.engine.variable.VariableMap getTaskFormVariables(String taskId, Collection<String> formVariables, boolean deserializeObjectValues)
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:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.TASKor noPermissions.READ_TASKpermission onResources.PROCESS_DEFINITION.
-
getStartFormKey
public static String getStartFormKey(String processDefinitionId)
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.
- Parameters:
processDefinitionId- String- Returns:
- String
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
getTaskFormKey
public static String getTaskFormKey(String processDefinitionId, String taskDefinitionKey)
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 from
Taskinstances returned by anyTaskQuery.- Parameters:
processDefinitionId- StringtaskDefinitionKey- String- Returns:
- String
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.
-
getDeployedStartForm
public static InputStream getDeployedStartForm(String processDefinitionId)
Retrieves a deployed start form for a process definition with a given id.- Parameters:
processDefinitionId- String- Returns:
- InputStream
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.PROCESS_DEFINITION.org.camunda.bpm.engine.exception.NotFoundException- If the start form cannot be found.org.camunda.bpm.engine.BadUserRequestException- If the start form key has wrong format ("embedded:deployment:<path>" or "deployment:<path>" required).
-
getDeployedTaskForm
public static InputStream getDeployedTaskForm(String taskId)
Retrieves a deployed task form for a task with a given id.- Parameters:
taskId- String- Returns:
- InputStream
- Throws:
org.camunda.bpm.engine.AuthorizationException- If the user has noPermissions.READpermission onResources.TASK.org.camunda.bpm.engine.exception.NotFoundException- If the task form cannot be found.org.camunda.bpm.engine.BadUserRequestException- If the task form key has wrong format ("embedded:deployment:<path>" or "deployment:<path>" required).
-
-