-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
None
JSF-based taskforms are used in combination with the org.camunda.bpm.engine.cdi.jsf.TaskForm class.
This class can be invoked using
<f:metadata>
<f:viewParam id="taskId" name="taskId" />
<f:viewParam id="callbackUrl" name="callbackUrl" />
<f:event type="preRenderView" listener="#
</f:metadata>
Bug:
===
Invoking a method using Expression language with null params fails. Null params occur if one of the vew params in
<f:viewParam id="taskId" name="taskId" />
<f:viewParam id="callbackUrl" name="callbackUrl" />
<f:event type="preRenderView" listener="#{camunda.taskForm.startTask(taskId, callbackUrl)}
" />
is null.
This is true for the following methods:
- `startTask(taskId, callbackUrl)`
- `startProcessInstanceByIdForm(processDefinitionId, callbackUrl)`
- `startProcessInstanceByKeyForm(processDefinitionKey, callbackUrl)`
Proposed fix:
=========
AT:
Add a methods with signature
- startTaskForm()
- startProcessInstanceByIdForm()
- startProcessInstanceByKeyForm()
Ie. taking no parameter.
The methods should read the parameters from `FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();`
Usage in JSF form:
<f:metadata>
<f:event type="preRenderView" listener="#
" />
</f:metadata>
Important: update documentation and examples with new method signature.
See this commit for an example: https://github.com/camunda/camunda-bpm-examples/commit/042d9a093c6009f8eeca178308f4bbd8c462e8ef
—
see https://groups.google.com/forum/#!msg/camunda-bpm-users/Haqwm-XJk8k/NZ9t5ji1o0QJ
and https://github.com/camunda/camunda-bpm-examples/blob/master/invoice-en/src/main/java/org/camunda/bpm/demo/invoice/InvoiceTaskForm.java