Variables

From RunaWFE
Jump to navigation Jump to search

Using variables

RunaWFE Free Workflow System (BPMS) Version 4.5.0

© 2003 - 2015, Consulting Group Runa

© 2015 - 2024, "Process Technologies" Ltd, this document is available under GNU FDL license. RunaWFE Free is an open source system distributed under a LGPL license (http://www.gnu.org/licenses/lgpl.html).

# Introduction

Process data are organized as variables.

Variables are defined in process definition (use Developer Studio for this). Variable values are set during process instance execution.

# Variable definition (in context of process definition)

attribute value
name used as identifier; unique in process definition
description now used only in Developer Studio for comments
scripting name used as identifier in scripts (JavaScript, Groovy, ...) due to scripting language identifier expression limitation; auto-generated
type defines:
  • persistence data format
  • serialization data format (in WebServices API)
  • user input and output in task forms
default value variable value at process instance creation
access access rights to the variable value

# Variable (in context of process instance)

attribute value
variable definition as defined in process definition
value variable value

# Strong typing 4.0.5+

  • checking that variable is defined in Developer Studio during assigning variable value
  • checking that variable is of corresponding type during assigning variable value

Note. You can disable first check by setting back compatibility process execution mode or setting property undefined.variables.allowed.

Note. You can disable second check by setting property strong.variables.format.enabled. Setting property variables.autocast.enabled allows using autocasting capabilities.

# Simple types

format class value class description serialization
ru.runa.wfe.var.format.BooleanFormat java.lang.Boolean boolean value "true" or "false"
ru.runa.wfe.var.format.LongFormat java.lang.Long integer value number as string
ru.runa.wfe.var.format.DoubleFormat java.lang.Double double value number as string
ru.runa.wfe.var.format.BigDecimalFormat java.math.BigDecimal big decimal value number as string
ru.runa.wfe.var.format.DateFormat java.util.Date date date as string using date.format.pattern
ru.runa.wfe.var.format.DateTimeFormat java.util.Date date with time date as string using date.format.pattern, time as string using HH:mm
ru.runa.wfe.var.format.TimeFormat java.util.Date time time as string using HH:mm
ru.runa.wfe.var.format.StringFormat java.lang.String string string
ru.runa.wfe.var.format.TextFormat java.lang.String string (differs from StringFormat only by presentation in forms) string
ru.runa.wfe.var.format.FileFormat ru.runa.wfe.var.FileVariable file read-only file name
ru.runa.wfe.var.format.ProcessIdFormat java.lang.Long process id as integer value (reference inside system) number as string

# Executor types (User, Group, Executor)

format class value class description JSON serialization


ru.runa.wfe.var.format.ExecutorFormat ru.runa.wfe.user.Executor executor (system group or user) JSON-object like
{"id": 1, "name": "Administrator", "fullName": "Adm A.A."}

For submission you should fill only "id" or "name" property

ru.runa.wfe.var.format.GroupFormat ru.runa.wfe.user.Group system group JSON-object like
{"id": 2, "name": "Administrators", "fullName": ""}

For submission you should fill only "id" or "name" property

ru.runa.wfe.var.format.ActorFormat ru.runa.wfe.user.Actor system user JSON-object like
{"id": 1, "name": "Administrator", "fullName": "Adm A.A."}

For submission you should fill only "id" or "name" property

For these variable values is defined field access:

ru.runa.wfe.user.Executor (executor) ru.runa.wfe.user.Group (group) ru.runa.wfe.user.Actor (user)


id (identifier) + + +
name (user login or group name) + + +
description (description) + + +
fullName (user full name) - - +
code (user code) - - +
active (user status) - - +
email (user email) - - +
phone (user phone) - - +
ldapGroupName (ldap group name) - + -
lastName (user last name) 4.0.6+ - - +
firstName (user first name) 4.0.6+ - - +
middleName (user middle name) 4.0.6+ - - +

Access to field is done using ".", for example

user1.phone

# Component types

format class value class description JSON serialization
ru.runa.wfe.var.format.ListFormat java.util.ArrayList value list
ru.runa.wfe.var.format.MapFormat java.util.HashMap value map
ru.runa.wfe.var.format.UserTypeFormat java.util.HashMap user defined value

# User defined types 4.1.0+

In Developer Studio you can define custom complex type with named attributes of any type (nesting user type is supported).

Variable value for user defined type is java.util.HashMap.

# Adding new type

In server-side

Format class should implement ru.runa.wfe.var.format.VariableFormat:

// defines value class
public Class<?> getJavaClass();
// serialization to string (JSON for complex types)
public String format(Object object);
// deserialization from string (JSON for complex types)
public Object parse(String source) throws Exception;

In Developer Studio

Registering types using application settings

TODO. In development.

Registering types using extensions mechanism

See extension point ru.runa.gpd.formats.

# Support big data files

By default all variables saved in database. If you operate with big files enable filesystem storage using settings file.variable.local.storage.enabled, file.variable.local.storage.path, file.variable.local.storage.enableforfilesgreaterthan

# Variable value restrictions 4.2.0+

Range of permissible values ​​of variables will help to

  • change repeating form variable check to global check
  • define form tags behavior