import { BpmnType } from '../Constants'; import { Activity } from './ActivityBase'; /** * Describes a BPMN UserTask. * * A user task will hold the current execution of the process and wait for user input * before continuing. */ export type UserTask = Activity & { readonly bpmnType: BpmnType.userTask; customForm?: string; assignee: string; candidateUsers: string; candidateGroups: string; dueDate?: Date; followUpDate?: Date; assignedUsersConfig?: string; formFields: Array; description: string; finishedMessage: string; }; /** * Describes a BPMN FormField. * A FormField is part of a UserTask and can contain all kinds of values. * * These values can then be used to finish the UserTask. */ export type UserTaskFormField = { /** * The UserTasks unique identifier. */ id: string; /** * The UserTasks label. * This is the field that will be used to describe the FormField, * when the UserTask is reached during ProcessModel execution. */ label: string; /** * The type of the FormField. */ type: UserTaskFormFieldType; /** * The default value of the FormField. */ defaultValue: string; /** * If the type of the FormField is set to 'enum', * this will contain all possible enum values. */ enumValues?: Array; /** * Stringified Configuration values for a form field. The content depends on the type of the Form Field. * * **NOTE:** In older versions that still use the legacy portal, this will contain an URI to a Custom Form. */ customForm?: string; /** * JSON formatted Custom Configuration values for a form field. The content depends on the type of the Form Field. * * Will be empty, if the configuration is not a valid JSON. */ parsedCustomForm?: FormFieldCustomForm; }; export declare enum UserTaskFormFieldType { text = "string", integer = "long", number = "number", boolean = "boolean", date = "date", enum = "enum", header = "header", paragraph = "paragraph", confirm = "confirm", color = "color", datetimeLocal = "datetime-local", email = "email", file = "file", hidden = "hidden", month = "month", password = "password", range = "range", tel = "tel", time = "time", url = "url", week = "week", checkbox = "checkbox", radio = "radio", select = "select", textarea = "textarea", custom = "custom" } export type FormFieldCustomForm = FormFieldCustomFormCommonProperties | FormFieldCustomForm_Confirm | FormFieldCustomForm_Number | FormFieldCustomForm_Header | FormFieldCustomForm_Checkbox | FormFieldCustomForm_Radio | FormFieldCustomForm_Range | FormFieldCustomForm_Select | FormFieldCustomForm_Text; export type FormFieldCustomFormCommonProperties = { type: UserTaskFormFieldType; placeholder?: string; customProperties?: Array; validation?: string; hint?: string; }; export type FormFieldCustomForm_Confirm = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.confirm; confirmButtonText?: string; declineButtonText?: string; }; export type FormFieldCustomForm_Number = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.number; step?: number | string; }; export type FormFieldCustomForm_Header = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.header; style?: string; }; export type FormFieldCustomForm_Range = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.range; step?: number; max?: number; min?: number; }; export type FormFieldCustomForm_Checkbox = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.checkbox; entries?: Array & Record<'value', string>>; }; export type FormFieldCustomForm_Radio = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.radio; entries?: Array & Record<'value', string>>; }; export type FormFieldCustomForm_Select = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.select; entries?: Array & Record<'value', string>>; }; export type FormFieldCustomForm_Text = FormFieldCustomFormCommonProperties & { type: UserTaskFormFieldType.text; /** * @deprecated For backwardscompatibilty only. Multiline Textfields are now modeled as Textarea. */ multiline?: boolean; }; export type FormFieldCustomProperty = { name: string; value: string; }; /** * Used in combination with 'enum' type UserTask FormFields, * this describes a single enum value of that FormField. * * @deprecated No longer supported. */ export type FormFieldEnumValue = { id: string; name: string; };