Skip to main content

Widgets

CMDBuild provides a set of default widgets — visual controls placed in the top-right area of the form — that manage process progression through the current activity.

Widgets are rendered as buttons labeled according to their configuration. They are defined as Extended Attributes (as specified in the XPDL standard) using the TWE editor.

The following data types are used throughout this reference:

  • Standard types: integer, string, date, float, boolean
  • CMDBuild custom types: lookup (id + type + description), lookups (lookup array), reference (id + idclass + description), references (reference array)

Widget list

CMDBuild natively supports a set of widgets, each identified by a Widget type. When activated, a widget opens a dedicated modal window that allows specific operations to be performed: browsing and selecting cards, composing emails, generating reports, uploading attachments, starting new workflows, and more.

Parameters can be either static values or dynamic expressions referencing the current execution context via the client: and flow: prefixes. Widgets can also produce output — typically card references, URLs, or serialized strings — which are written to process variables and made available to subsequent activities.

Common configuration

In addition to their specific parameters, all widgets share a set of common parameters described below.

ButtonLabel (string) — The label displayed on the button that opens the widget within the activity form.

Active (boolean) — When set to false, the widget is not rendered. This is useful for conditionally showing or hiding a widget based on a CQL expression.

AlwaysEnabled (boolean) — When set to true, the button remains clickable regardless of the form's validation state, for example even when mandatory fields have not yet been filled in.

General notes

The client: prefix is used to access the current value of a process variable before the workflow advances to the next step. The flow: prefix is used to access process variable values within the flow context. String parameters that accept CQL expressions must be enclosed in single quotes when they represent literal values (e.g. ClassName = 'User'), or written without quotes when referencing a variable (e.g. ObjId = client:Requester).

Displays a paginated list of all cards belonging to a class, with optional geographical map view.

Widget type: Widget_linkCartds

Input parameters

  • ClassNamestring

  • ButtonLabelstring

  • SingleSelectinteger
    set to 1 to allow single-row selection only (radio button instead of checkbox)

  • NoSelectinteger
    set to 1 to disable row selection

  • Requiredinteger
    set to 1 to require at least one row to be selected

  • Filterstring
    accepts a CQL expression (e.g., Filter = "from Person where Id = {client:Customer.Id}")

  • DefaultSelectionstring (optional)
    CQL query used for automatic selection when the widget opens

  • AllowCardEditinginteger (optional)
    set to 1 to add a card edit icon

  • DisableGridFilterTogglerboolean (optional)
    set to "true" to hide the Disable filter button

Output parameters

  • CheckArrayreferences

Create Modify Card

Widget type: Widget_createModifyCard

Displays an existing card (if ObjId is specified) or allows creating a new card in the specified class.

This widget accepts three input configurations.

Configuration 1 — create a new card by class name

  • ClassNamestring
  • ButtonLabelstring
  • ReadOnlyinteger

Configuration 2 — open a card from a reference

  • Referencereference
  • ButtonLabelstring
  • ReadOnlyinteger

Configuration 3 — open a specific card by class name and ID

  • ClassNamestring
  • ObjIdlong
  • ButtonLabelstring
  • ReadOnlyinteger

Output parameters

  • Referencereference

Notes

  • The client: prefix is required to access a variable before the workflow advances to the next step
  • ReadOnly = 1 displays the card in read-only mode

Example:

ClassName = 'User'
ObjId = client:Requester
ButtonLabel = 'Create or modify User'

Create Report

Widget type: Widget_createReport

Allows generating a report.

Input parameters

  • ReportTypestring
    must be set to 'custom'

  • ReportCodestring
    corresponds to the Code attribute of the report in the Report schedule

  • ButtonLabelstring

  • ForcePDFinteger
    forces PDF output

  • ForceCSVinteger
    forces CSV output

  • Parameter-1 ... Parameter-nparameters required by the report

Output parameters

  • ReportURLstring

Manage Email

Widget type: Widget_manageEmail

Allows composing emails — from a template or from scratch — that will be sent when the process advances. When the widget is opened, the mailbox is checked for new incoming messages.

Input parameters

  • ButtonLabelstring
  • Template*1 ... Template*nname of the email template used to generate the email
  • Condition*1 ... Condition*nCQL condition that enables email creation with the corresponding template
  • NotifyWith*1 ... NotifyWith*nname of the template used to send a notification email

Output parameters

None.

Open Note

Widget type: Widget_openNote

Displays a page with an HTML editor for inserting notes.

Input parameters

  • ButtonLabelstring

Notes

Cannot be used in the first process activity.

Open Attachment

Widget type: Widget_openAttachment

Displays a page for uploading an attachment to the current process.

Input parameters

  • ButtonLabelstring

Notes

Cannot be used in the first process activity.

Calendar

Widget type: Widget_calendar

Displays a calendar with selected dates.

Input parameters

  • ButtonLabelstring

  • ClassNamestring
    class from which to collect the dates to display

  • Filterstring
    optional CQL filter applied to ClassName

  • EventStartDatedate
    attribute to use as the event start date

  • EventEndDatedate (optional)
    attribute to use as the event end date

  • EventTitlestring
    attribute whose value is displayed as the event label in the calendar

  • EventTypestring
    attribute to use as the event type

  • EventTypeLookupstring
    Lookup used for event types; typically the LookupType of the EventType attribute

  • DefaultDatestring
    attribute to use as the calendar opening date

Preset From Card

Widget type: Widget_presetFromCard

Populates the current activity with data retrieved from a selected card.

Input parameters

  • ButtonLabelstring

  • ClassNamestring
    name of the source class; can be used as an alternative to Filter

  • Filterstring
    CQL filter to restrict the source cards

  • AttributeMappingstring
    maps activity attributes to card attributes using the format a1=c1,a2=c2 (comma-separated assignments)

Start Workflow

Widget type: Widget_startWorkflow

Starts a new workflow. Also referenced as Widget_workflow.

This widget accepts two input configurations.

Configuration 1 — start a workflow by code

  • ButtonLabelstring
  • WorkflowCodestring
    name of the process to start

Configuration 2 — start workflows filtered by CQL

  • ButtonLabelstring
  • FilterTypestring
  • Filterstring
    CQL filter to select cards from a CMDBuild table; the result set must match the names of the processes to start

Output parameters

  • processRefReferenceType

Custom Form

Widget type: Widget_customForm

Manages a form or a row grid, with support for adding, removing, and modifying rows.

Input parameters

  • ButtonLabelstring

  • ModelType[form | class | function]
    defines the structure source:

    • form — JSON item array
    • class — attributes of a class
    • function — function input parameters
  • Layout[grid | form]
    form renders as a CMDBuild card; grid renders as a row series

  • DataType[raw_json | raw_text | function]
    defines the data initialization source:

    • raw_json — JSON item array
    • raw_text — well-structured text string
    • function — output values of a function
  • ReadOnly[true | false]

  • Required[true | false]

  • AddDisabled[true | false]

  • DeleteDisabled[true | false]

  • ImportDisabled[true | false]

  • ModifyDisabled[true | false]

  • SerializationType[json | text]
    output serialization format

  • KeyValueSeparatorstring

  • AttributesSeparatorstring

  • RowsSeparatorstring

Output parameters

  • Outputstring variable

manageEmail — Template String Reference

Widget_manageEmail supports template strings for composing dynamic email content. When the widget is opened, the mailbox is checked for new incoming messages.

Parameters

Input parameters

  • ButtonLabelstring

  • One or more email definition blocks, each containing:

    • ToAddressesstring template
      recipient addresses
    • CcAddressesstring template
      carbon copy addresses
    • Subjectstring template
      email subject
    • Contentstring template
      email body (HTML)
    • Conditionstring template
      JavaScript expression; if evaluated as false, the email is not generated
  • Additional optional parameters containing queries or JavaScript expressions

  • ReadOnlyflag
    marks the email as read-only

Output parameters

None.

Notes

The ReadOnly flag is treated as a boolean: a boolean true, a positive integer, or a non-empty string are all considered true.

Template string namespaces

In template strings, variables use the syntax {namespace:localname}. If the namespace is omitted, it defaults to server.

  • client:name, client:name.Id, client:name.Descriptionform variable
    for Lookup or Reference attributes, append .Id or .Description to specify which value to retrieve

  • server:nameprocess variable from the previous step

  • xa:nameextended attribute variable
    expanded as a template; variables with namespace js and cql are excluded from expansion

  • user:id, user:nameID and name of the connected user

  • group:id, group:nameID and name of the connected group

  • js:nameextended attribute variable evaluated as a JavaScript expression

  • cql:name.fieldextended attribute variable evaluated as a CQL query; the result field is identified by field

Email block definition

For a single email:

ToAddresses="..."
CcAddresses="..."
Subject="..."
Content="..."

For multiple emails, append a numeric suffix to each parameter:

ToAddresses1="..."
CcAddresses1="..."
Subject1="..."
Content1="..."

ToAddresses2="..."
CcAddresses2="..."
Subject2="..."
Content2="..."

Example 1

ToAddresses="foo@example.com"
Subject="{cql:QueryRequester.Description} - {client:Request}"
QueryRequester="select Description,Email,Office from Employee where Id = {cql:SillyQuery.Id}"
SillyQuery="select Id from Employee where Id={client:Requester}"
  • ToAddresses is set to the static address foo@example.com
  • Body is empty
  • Subject uses two variables:
    • {cql:QueryRequester.Description} retrieves the Description field from the QueryRequester CQL result
    • {client:Request} is replaced with the corresponding form value
  • QueryRequester selects an Employee card and exposes the fields Description, Email and Office
  • Inside QueryRequester, {cql:SillyQuery.Id} is resolved first, using the result of SillyQuery, which in turn uses {client:Requester} from the form — nested queries are supported

Example 2

Content="The requester, {js:JoinJS}, belonging to the office {cql:QueryRequester.Office_value} requests: {server:Request}"
JoinJS="{js:FirstJS}+"#"+{js:SecondJS}"
FirstJS="{cql:QueryRequester.Description}.slice(0,{xa:SplitLength})"
SecondJS="{cql:QueryRequester.Description}.slice({xa:SplitLength})"
SplitLength=2
QueryRequester="select Description,Email,Office from Employee where Id = {Requester}"

This is an example of higher complexity.

In the body there are three variables which must by replaced:

  • {js:JoinJS} values the extended attribute variable like a javascript expression, splitting with # the variables FirstJS and SecondJS, always valued through javascript
  • {js:FirstJS} and {js:SecondJS} include both a variable taken from a field of CQL query QueryRequester and a static variable taken from the ones of the extended attribute
  • {cql:QueryRequester\...} includes a reference to a server side variable called Requester
  • {cql:QueryRequester.Office_value} uses the Office reference description instead of its ID (that would be just Office)
  • {server:Request} takes a server side variable (as Requester), but it also states the namespace