org.appng.camunda.bpm

## Class TaskWrapper

- java.lang.Object
- - org.appng.camunda.bpm.TaskWrapper

- All Implemented Interfaces:
    org.camunda.bpm.engine.task.Task

      public class TaskWrapper
      extends Object
      implements org.camunda.bpm.engine.task.Task

  A wrapper for a `Task`, providing the ability of dynamically adding `FieldDef`initions based on the `TaskFormData` that has been defined for that task.
  This class can easily be used as the bind-class of an appNG `Datasource`.
  Author:
    Matthias Müller

- - ### Field Summary

    - ### Fields inherited from interface org.camunda.bpm.engine.task.Task

      `PRIORITY_MAXIMUM, PRIORITY_MINIUM, PRIORITY_NORMAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskWrapper()`
    `TaskWrapper(org.camunda.bpm.engine.task.Task task, Collection<org.camunda.bpm.engine.task.IdentityLink> identityLinks, org.camunda.bpm.engine.variable.VariableMap variables)` Create a new `TaskWrapper` from the given `Task`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFormFields(FieldProcessor fp, org.camunda.bpm.engine.form.TaskFormData taskFormData, String mandatoryMessage)` Dynamically adds `FieldDef`initions to the given `FieldProcessor`, depending on the `FormField`s defined at the `TaskFormData`.
    `protected void` | `addValidation(FieldDef field, org.camunda.bpm.engine.form.FormFieldValidationConstraint validationConstraint, String mandatoryMessage)`
    `protected void` | `determineFieldType(org.camunda.bpm.engine.form.FormType type, FieldDef field)`
    `Object` | `getFormField(String name)`
    `void` | `validate(Site site, Application application, Environment environment, Options options, Request request, FieldProcessor fp, org.camunda.bpm.engine.form.TaskFormData taskFormData, String requiredMessage)` Validates this `TaskWrapper`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.camunda.bpm.engine.task.Task

      `delegate, getAssignee, getCaseDefinitionId, getCaseExecutionId, getCaseInstanceId, getCreateTime, getDelegationState, getDescription, getDueDate, getExecutionId, getFollowUpDate, getFormKey, getId, getName, getOwner, getParentTaskId, getPriority, getProcessDefinitionId, getProcessInstanceId, getTaskDefinitionKey, getTenantId, isSuspended, setAssignee, setCaseInstanceId, setDelegationState, setDescription, setDueDate, setFollowUpDate, setName, setOwner, setParentTaskId, setPriority, setTenantId`

- - ### Constructor Detail

    - #### TaskWrapper

          public TaskWrapper()

    - #### TaskWrapper

          public TaskWrapper(org.camunda.bpm.engine.task.Task task,
                             Collection<org.camunda.bpm.engine.task.IdentityLink> identityLinks,
                             org.camunda.bpm.engine.variable.VariableMap variables)

      Create a new `TaskWrapper` from the given `Task`
      Parameters:
        `task` - the `Task` to wrap, retrieved from a `TaskService`
        `identityLinks` - the `IdentityLink`s for the task, usually retrieved with `TaskService.getIdentityLinksForTask(String)`
        `variables` - the variables for this `Task`, usually retrieved with `TaskService.getVariablesTyped(String)`

  - ### Method Detail

    - #### addFormFields

          public void addFormFields(FieldProcessor fp,
                                    org.camunda.bpm.engine.form.TaskFormData taskFormData,
                                    String mandatoryMessage)

      Dynamically adds `FieldDef`initions to the given `FieldProcessor`, depending on the `FormField`s defined at the `TaskFormData`.
      Parameters:
        `fp` - the `FieldProcessor`
        `taskFormData` - the `TaskFormData` to dynamically add the fields from
        `mandatoryMessage` - the message in case a field id mandatory

    - #### addValidation

          protected void addValidation(FieldDef field,
                                       org.camunda.bpm.engine.form.FormFieldValidationConstraint validationConstraint,
                                       String mandatoryMessage)

    - #### determineFieldType

          protected void determineFieldType(org.camunda.bpm.engine.form.FormType type,
                                            FieldDef field)

    - #### validate

          public void validate(Site site,
                               Application application,
                               Environment environment,
                               Options options,
                               Request request,
                               FieldProcessor fp,
                               org.camunda.bpm.engine.form.TaskFormData taskFormData,
                               String requiredMessage)

      Validates this `TaskWrapper`. Therefore, the `FormField`s returned by the `TaskFormData` are checked for `FormFieldValidationConstraint`s. If there is a `required` constraint, and the value returned by `getFormField(String)` is `null` or empty for the given `FormField`, an error-message as append to the `FieldDef`inition of that field.
      Parameters:
        `site` - the current `Site`
        `application` - the current `Application`
        `environment` - the current `Environment`
        `options` - the current `Options`
        `request` - the current `Request`
        `fp` - the current `FieldProcessor`
        `taskFormData` - the current `TaskFormData`
        `requiredMessage` - the current `Site`

    - #### getFormField

          public Object getFormField(String name)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.