Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-1587

Use JSF parameterMap instead of <viewParam> to avoid problems with JSF validation

XMLWordPrintable

      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="#

      {camunda.taskForm.startTask(taskId, callbackUrl)}" />
      </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="#

      {camunda.taskForm.startTaskForm()}

      " />
      </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

        This is the controller panel for Smart Panels app

              michael.schoettes Michael Schoettes
              ruecker Bernd Ruecker
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: