Checkbox

Checkboxes are HTML <input type="checkbox"> controls. Checkbox controls can be used for booleanvariable types.

Binding a Checkbox to a Process Variable

A checkbox input can be bound to a process variable using the cam-variable-type and cam-variable-name directives:

  1. <input type="checkbox"
  2. cam-variable-name="IS_VIP_CUSTOMER"
  3. cam-variable-type="Boolean" />

In the example above, the checkbox is bound to the variable named IS_VIP_CUSTOMER of typeBoolean.

Supported Variable Types for Checkboxes

The checkbox input field only supports boolean variable types. A checked checkbox corresponds tothe value true, an unchecked checkbox corresponds to the value false.

Boolean Select Box

To bind a <select> box to a Java Boolean variable, the directivecam-variable-type="Boolean" must be used.

Example:

  1. <select cam-variable-name="APPROVED"
  2. cam-variable-type="Boolean">
  3. <option value="true">Yes</option>
  4. <option value="false">No</option>
  5. </select>

Boolean text Input

To bind a text input field to a Java Boolean variable, the directivecam-variable-type="Boolean" must be used.

Text input fields of type Boolean accept the following string values:

  • true
  • false
    Meaning that the user has to type the words “true” or “false” into the text input field.

Example:

  1. <input type="text"
  2. cam-variable-name="IS_VIP_CUSTOMER"
  3. cam-variable-type="Boolean" />

原文: https://docs.camunda.org/manual/7.9/reference/embedded-forms/controls/boolean-inputs/