Tiny Workflow XML reference

This document describes all XML elements of a XML Workflow definition.

Introduction

The workflow XML is a description of a finite state machine: It defines a set of states and transitions between those states.

TODO: simple schema.

Namespace: all elements described in this document belong to the "http://org.tinyWorkflow/2005/workflowDefinition" namespace.

Table of Contents

Core Elements

workflow

Syntax: <workflow id="wfId" version="1.0"> ... </workflow>

Main element of the workflow definition.

Attributes:

AttributeDescriptionType
idUnique ID for the workflow definition.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
versionVersion of the workflow definition.* occurrence: Mandatory
* type: String
peerFully-qualified class name of the workflow peer.* occurrence: optional
* type: String
* default value: null (no peer defined)
nameDisplayable name of the workflow (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the workflow (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Content:

ElementMultiplicity
name*
description*
meta0..1
extends*
any priority calculator0..1
flags0..1
preFunctions0..1
initialTransitions0..1
globalTransitions0..1
states0..1
postFunctions0..1

(--> toc)

name

Syntax: <name locale="en" value="My name"/>

Name of a workflow/state/transition (depending on the element containing this one) for the given locale. The name is there to be displayed to the user, so it must be provided in each possible user locale. There should be also a name without locale, which is the default one, used when the name is asked for an unknown locale. The default name can also be provided as an attribute of the enclosing element.

Attributes:

AttributeDescriptionType
localeLocale of this name.* occurrence: optional
* type: a java locale id
* default value: null (default name)
valueName value.* occurrence: Mandatory
* type: String

(--> toc)

text

Syntax: <text locale="en" value="Some text"/>

Text for the given locale. The text is there to be displayed to the user, so it must be provided in each possible user locale. There should be also a text without locale, which is the default one, used when the text is asked for an unknown locale. The default text can also be provided as an attribute of the enclosing element.

Attributes:

AttributeDescriptionType
localeLocale of this text.* occurrence: optional
* type: a java locale id
* default value: null (default name)
valueText value.* occurrence: Mandatory
* type: String

(--> toc)

description

Syntax: <description locale="en" > Some description </description/>

Description of a workflow/state/transition (depending on the element containing this one) for the given locale. The description is there to be displayed to the user, so it must be provided in each possible user locale. There should be also a description without locale, which is the default one, used when the description is asked for an unknown locale. The default description can also be provided as an attribute of the enclosing element.

Attributes:

AttributeDescriptionType
localeLocale of this description.* occurrence: optional
* type: a java locale id
* default value: null (default name)

Content: Text content.

(--> toc)

meta

Syntax: <meta> ... </meta>

Tag enclosing meta-data of a workflow/state/transition (depending on the element containing this one). Meta-data is not interpreted by the workflow engine. They are just made accessible through the definition. They can be used to encode specific behaviour for extension of workflow engine (GUI support, design tool ...)

No Attributes

Content:

ElementMultiplicity
any meta-attribute*

(--> toc)

flags

Syntax: <flags> ... </flags>

Tag enclosing flag definitions of a workflow.

No Attributes

Content:

ElementMultiplicity
any flag1..*

(--> toc)

extends

Syntax: <extends id="someWorkflowId" version="1.0"/>

Specify the id and version of a workflow extended by this one. All initial transitions, global transitions and states defined in the extended workflow will be available in this one. If this workflow defines transitions or states with the same id as in the extended workflow, they will replace them. If there are several extended workflows, a new definition (with same id) always replaces the preceding one.

Attributes:

AttributeDescriptionType
idId of the extended workflow description.* occurrence: Mandatory
* type: string
versionVersion of the extended workflow description.* occurrence: optional
* type: String
* default value: null (the latest version available in the repository will be used)

(--> toc)

preFunctions

Syntax: <preFunctions> ... </preFunctions>

Tag enclosing pre-functions of a workflow/state/transition (depending on the element containing this one). Pre-functions are functions that are executed respectively:

  • for workflow pre-functions: Just before the initial transition.
  • for transition pre-functions: Just before the transition execution.
  • for state pre-functions: Just before entering a state.

No Attributes

Content:

ElementMultiplicity
any function*

(--> toc)

initialTransitions

Syntax: <initialTransitions> ... </initialTransitions>

Tag enclosing initial transitions of the workflow. Initial transitions are transitions starting from the initial state of the workflow. The initial state itself is not represented in the workflow definition.

No Attributes

Content:

ElementMultiplicity
transition1..*

(--> toc)

globalTransitions

Syntax: <globalTransitions> ... </globalTransitions>

Tag enclosing global transitions of the workflow. Global transitions are just a way to share definition of transitions between different states. When the same transition is available in several states, Instead of defining it in each state, you can define it once as a global transition. Then you can refer this global transition form each state needing it.

No Attributes

Content:

ElementMultiplicity
transition1..*

(--> toc)

states

Syntax: <states> ... </states>

Tag enclosing states of the workflow.

No Attributes

Content:

ElementMultiplicity
state*
endState*

(--> toc)

postFunctions

Syntax: <postFunctions> ... </postFunctions>

Tag enclosing post-functions of a workflow/state/transition (depending on the element containing this one). Post-functions are functions that are executed respectively:

  • for workflow post-functions: Just after the final transitions.
  • for transition post-functions: Just after the transition execution.
  • for state post-functions: Just after leaving a state.

No Attributes

Content:

ElementMultiplicity
any function*

(--> toc)

transition

Syntax: <transition id="transId"> ... </transition>

Transition definition.

Attributes:

AttributeDescriptionType
idUnique ID for the transition.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
autoFlag saying if this transition can be executed automatically. After executing a transition (or a transition on a child workflow), the workflow engine checks all the automatic transition of the new state. The first that can be executed automatically (and that have permissions/conditions matching) is executed.* occurrence: optional
* type: boolean ("true" or "false")
* default value: false
groupName of the group owning this transition. A group works like a Swing ButtonGroup. In a GUI, only one of the group transitions is available at one time (ex: 'lock' and 'unlock' transition will belong to a locking group). This group is only used to optimise user interface, it has no effect on workflow execution or transition availability.* occurrence: optional
* type: String
* default value: null (no group defined)
nameDisplayable name of the workflow (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the workflow (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Content:

ElementMultiplicity
name*
description*
meta*
parameters0..1
permissions0..1
conditions0..1
preFunctions0..1
results0..1
postFunctions0..1

(--> toc)

parameters

Syntax: <parameters> ... </parameters>

Tag enclosing definition of parameters of a transition. For each transition execution a Map containing parameters is given. You are not obliged to declare the parameters used by the transition in this parameter list but it's a good practice to do so.

Declaring the parameters brings you automatically:

  • Visibility and documentation of the parameters.
  • Validation of the parameters before transition execution.
  • GUI support: an application can automatically create forms to enter parameters on the basis of this parameter list.

No Attributes

Content:

ElementMultiplicity
any parameter*

(--> toc)

permissions

Syntax: <permissions> ... </permissions>

Tag enclosing definition of permissions needed by a user to perform a transition. Permissions contained in this elements are combined with a AND operator.

Note: though this element can contain any condition, it is expected to contain conditions that are permissions (i.e. related to the identity and roles of the caller).

No Attributes

Content:

ElementMultiplicity
any condition*

(--> toc)

conditions

Syntax: <conditions> ... </conditions>

Tag enclosing definition of conditions requested for the transition to be available. Permissions contained in this elements are combined with a AND operator.

No Attributes

Content:

ElementMultiplicity
any condition*

(--> toc)

results

Syntax: <results> ... </results>

Tag enclosing definitions of all possible transition results. This sequence must always end with one unconditional result.

No Attributes

Content:

ElementMultiplicity
conditionalResult*
result1

(--> toc)

conditionalResult

Syntax: <conditionalResult state="state1" owner="Billy" logInfo="Some info using ${param}"> ... </conditionalResult>

Conditional result of a transition. A conditional result is a result with a condition. When the transition is started all the conditions of the results list are evaluated sequentially and the first result with matching condition is used. The result sequence must always end with an unconditional result.

Attributes:

AttributeDescriptionType
stateID of the result state.* occurrence: Mandatory
* type: String
* expr: this attribute can contain expressions. Most common expression value is ${oldStateId} meaning that the state doesn't change.
ownerOwner id of the result state.* occurrence: optional
* type: String
* default value: null (no owner)
* expr: this attribute can contain expressions. Most common expression values are ${callerId} meaning that the new owner is the caller of the transition and ${oldOwnerId} meaning that the owner doesn't change.
logInfoAdditional log info to be kept in workflow transition history. Note that the caller, old/new state, old/new owner are already automatically stored in history. So it is useless to store them again in this info. This info is there to store something about the parameters of the transition, you can include them by using parameters in the attribute (ex: TODO).* occurrence: optional
* type: String
* default value: null (no additional info)
* expr: this attribute can contains expressions. Most common expression value is of the form ${...} meaning that ... TODO.
workflowIdWhen the transition goes to a state of another workflow, use this attribute to specify the id of the new workflow definition.* occurrence: optional
* type: String
* default value: null (stay in the same workflow definition)
* expr: this attribute can contain expressions.
workflowVersionWhen the transition goes to a state of another workflow, use this attribute to specify the version of the new workflow definition. This attribute is ignored when the workflowId attribute is null.* occurrence: optional
* type: String
* default value: null (latest workflow definition available)
* expr: this attribute can contain expressions.

Content:

ElementMultiplicity
any condition1

(--> toc)

result

Syntax: <result state="state1" owner="Billy" logInfo="Some info using ${param}"/>

Result of a transition.

Attributes:

AttributeDescriptionType
stateID of the result state.* occurrence: Mandatory
* type: String
* expr: this attribute can contains expressions. Most common expression value is ${oldStateId} meaning that the state doesn't change.
ownerOwner id of the result state.* occurrence: optional
* type: String
* default value: null (no owner)
* expr: this attribute can contains expressions. Most common expression values are ${callerId} meaning that the new owner is the caller of the transition and ${oldOwnerId} meaning that the owner doesn't change.
logInfoAdditional log info to be kept in workflow transition history. Note that the caller, old/new state, old/new owner are already automatically stored in history. So it is useless to store them again in this info. This info is there to store something about the parameters of the transition, you can include them by using parameters in the attribute (ex: TODO).* occurrence: optional
* type: String
* default value: null (no additional info)
* expr: this attribute can contains expressions. Most common expression value is of the form ${...} meaning that ... TODO.
workflowIdWhen the transition goes to a state of another workflow, use this attribute to specify the id of the new workflow definition.* occurrence: optional
* type: String
* default value: null (stay in the same workflow definition)
* expr: this attribute can contains expressions.
workflowVersionWhen the transition goes to a state of another workflow, use this attribute to specify the version of the new workflow definition. This attribute is ignored when the workflowId attribute is null.* occurrence: optional
* type: String
* default value: null (latest workflow definition available)
* expr: this attribute can contains expressions.

(--> toc)

state

Syntax: <state id="stateId"> ... </state>

State definition.

Attributes:

AttributeDescriptionType
idUnique ID for this state.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
nameDisplayable name of the workflow (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the workflow (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Content:

ElementMultiplicity
name*
description*
meta*
preFunctions0..1
transitions0..1
postFunctions0..1

(--> toc)

endState

Syntax: <endState id="stateId"> ... </endState>

Final state definition. A final state is like a state but it can have no outgoing transition and no post-functions.

Attributes:

AttributeDescriptionType
idUnique ID for this state.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
nameDisplayable name of the workflow (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the workflow (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Content:

ElementMultiplicity
name*
description*
meta*
preFunctions0..1

(--> toc)

transitions

Syntax: <transitions> ... </transitions>

Tag enclosing transitions of a state.

No Attributes

Content:

ElementMultiplicity
transitionRef*
transition*

(--> toc)

transitionRef

Syntax: <transitionRef refId="transId"/>

Reference to a global transition definition. If you specify attribut or content in the transition reference, it override the content of the referred transition (for this transitionRef).

Attributes:

AttributeDescriptionType
refIdId of the referenced global transition.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
idGive the reference a specific ID* occurrence: optional
* type: XML ID (string without spaces or special characters)
* default value: same sa refId
autoOverride the 'auto' parameter of referenced transition* occurrence: optional
* type: boolean ("true" or "false")
* default value: not defined (value of referenced transition is used)
groupOverride the 'group' parameter of referenced transition* occurrence: optional
* type: String
* default value: not defined (value of referenced transition is used)
nameOverride the 'name' parameter of referenced transition* occurrence: optional
* type: String
* default value: not defined (value of referenced transition is used)
descriptionOverride the 'description' parameter of referenced transition* occurrence: optional
* type: String
* default value: not defined (value of referenced transition is used)

Content (override the referenced transition content if present):

ElementMultiplicity
name*
description*
meta*
parameters0..1
permissions0..1
conditions0..1
preFunctions0..1
results0..1
postFunctions0..1

(--> toc)

option

Syntax: <option id="opt1" name="Option One"> ... </option>

Option of an enumerated parameter.

Attributes:

AttributeDescriptionType
idId of the option (= it actual value).* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
nameDisplayable name of the option (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)

Content:

ElementMultiplicity
name*

(--> toc)

flagValue

Syntax: <flagValue value="someValue" > ... </flagValue>

Definition of an enumerated value flag inside a workflow flag.

Attributes:

AttributeDescriptionType
valueThe value of the flag. If not defined, the flag itself is not defined for this case.* occurrence: Optional
* type: string
* default value: null (flag not defined in this case)
nameDisplayable name of the flag value (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the flag value (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Content:

ElementMultiplicity
name*
description*

(--> toc)

Functions Substitution Group

Functions are ways to execute a piece of code. This code can be a script embedded in the workflow definition, or java code. Functions are part of a XML substitution group, all the function described in this section are equivalent (from XML point of view).

proxyFunction

Syntax: <proxyFunction class="org.company.MyClass"> ... </proxyFunction>

Function delegating the execution to a class implementing the org.tinyWorkflow.definition.function.WorkflowExternalFunction interface. This element can contain properties that will be passed as in Map to the function by the init(ProxyFunction) method.

Attributes:

AttributeDescriptionType
classFully qualified name of the class implementing the function.* occurrence: Mandatory
* type: String
resultParamIdA parameter Id used to store the result of the function into the TransitionContext* occurrence: optional
* type: String
* default value: null (function result ignored)

Content:

ElementMultiplicity
any meta-attribute*

(--> toc)

beanshellFunction

Syntax: <beanshellFunction> script </beanshellFunction>

Scripted function with typeless java-like code (beanshell). This script can access the transition context by using the context variable.

No Attributes

Content: Text content.

(--> toc)

peerCall

Syntax: <peerCall method="someMethod"/>

Function delegating the execution method of the workflow peer. The specified method can have no parameter or can accept a TransitionContext as parameter.

Attributes:

AttributeDescriptionType
methodName of the peer method to call.* occurrence: Mandatory
* type: String
resultParamIdA parameter Id used to store the result of the function into the TransitionContext* occurrence: optional
* type: String
* default value: null (function result ignored)

(--> toc)

startChildWorkflow

Syntax: <startChildWorkflow id="someWorkflow" initialTransition="someTransition"/>

Function starting a child workflow. The given initial transition is directly executed on this new child workflow.

Attributes:

AttributeDescriptionType
idId of the workflow definition for the child workflow.* occurrence: Mandatory
* type: String
versionVersion of the workflow definition for the child workflow.* occurrence: optional
* type: String
* default value: null (latest version available)
initialTransitionId of the initial transition to execute on the child workflow.* occurrence: Mandatory
* type: String
forwardCallerFlag telling if the caller of the current transition is forwarded to the initial transition call. If false, the 'System' user is used to call the initial transition.* occurrence: optional
* type: boolean
* default value: false
forwardParamsFlag telling if the parameters of the current transition are forwarded to the initial transition call. If false, an empty parameter map is used for the initital transition* occurrence: optional
* type: boolean
* default value: false
resultParamIdA parameter Id used to store the result of the function into the TransitionContext* occurrence: optional
* type: String
* default value: null (function result ignored)

(--> toc)

Conditions Substitution Group

Conditions are part of a XML substitution group; all the conditions described in this section are equivalent (from XML point of view).

proxyCondition

Syntax: <proxyCondition class="org.cmpany.MyClass"> ... </proxyCondition>

Condition delegating the execution to a class implementing the org.tinyWorkflow.definition.condition.WorkflowExternalCondition interface. This element can contain properties that will be passed as in Map to the condition by the init(ProxyCondition) method.

Attributes:

AttributeDescriptionType
classFully qualified name of the class implementing the condition.* occurrence: Mandatory
* type: String

Content:

ElementMultiplicity
any meta-attribute*

(--> toc)

beanshellCondition

Syntax: <beanshellCondition> script </beanshellCondition>

Scripted condition with typeless java-like code (beanshell). This script can access the transtition context by using the context variable.

The script must return a boolean value just like a java method.

No Attributes

Content: Text content.

(--> toc)

peerCondition

Syntax: <peerCondition method="someMethod"/>

Condition delegating the execution method of the workflow peer. The specified method can have no parameter or can accept a TransitionContext as parameter and must return a boolean (or Boolean).

Attributes:

AttributeDescriptionType
methodName of the peer method to call.* occurrence: Mandatory
* type: String

(--> toc)

and

Syntax: <and> ... </and>

Condition combining sub-condition with a AND operator.

No attribute

Content:

ElementMultiplicity
any condition2..*

(--> toc)

or

Syntax: <or> ... </or>

Condition combining sub-condition with an OR operator.

No attribute

Content:

ElementMultiplicity
any condition2..*

(--> toc)

not

Syntax: <not> ... </not>

Condition negating it sub-condition.

No attribute

Content:

ElementMultiplicity
any condition1

(--> toc)

callerIsSystem

Syntax: <callerIsSystem/>

Condition checking that the caller of a transition is the 'system'.

The system is identified by its special user id kept in the Workflow.SYSTEM_USER_ID static variable.

No attribute

(--> toc)

callerIsWorkflowOwner

Syntax: <callerIsWorkflowOwner/>

Condition checking that the caller of a transition is the owner of the workflow instance.

No attribute

(--> toc)

workflowHasNoOwner

Syntax: <workflowHasNoOwner/>

Condition checking that the caller of a transition is the owner of the workflow.

No attribute

(--> toc)

allowedCaller

Syntax: <allowedCaller ids="John,Bill,Bob"/>

Condition checking that the id of the caller of a transition is in the provided id list.

This condition allows implementing very basic permission checking.

Attributes:

AttributeDescriptionType
idsList of the allowed ids separated by comas.* occurrence: Mandatory
* type: coma-separated list of string

(--> toc)

paramIsDefined

Syntax: <paramIsDefined paramId="aparam"/>

Condition checking that the named parameter is defined in the parameter list of the transition context.

'Defined' means that the parameter is present and has a non-null value.

Attributes:

AttributeDescriptionType
paramIdId of the parameter to check.* occurrence: Mandatory
* type: String

(--> toc)

paramEquals

Syntax: <paramEquals paramId="aparam" value="abc"/>

Condition checking that the identified parameter has the provided value.

This condition effectuates a String comparison. Whatever the type of the parameter is, it is transformed to a string with the toString() method and the result string is compared. If the parameter is null, false is returned.

Attributes:

AttributeDescriptionType
paramIdId of the parameter to check.* occurrence: Mandatory
* type: String
valueThe expected parameter value.* occurrence: Mandatory
* type: String

(--> toc)

expressionEquals

Syntax: <expressionEquals eval="${some.expression}" value="abc"/>

Condition checking that the given expression is evaluated to the provided value.

This condition effectuates a String comparison. Whatever the type of the parameter is, it is transformed to a string with the toString() method and the result string is compared. If the expression result is null, false is returned.

Attributes:

AttributeDescriptionType
evalThe expression to evaluate.* occurrence: Mandatory
* type: String
* expr: this attribute is meant to contains expressions. Note that if you use an expression of form ${param(paramId)}, it is equivalent to the <paramEquals> condition.
valueThe comparison value.* occurrence: Mandatory
* type: String

(--> toc)

hiddenTransition

Syntax: <hiddenTransition/>

Condition allowing to hide a transition. When this condition is added the transition is never returned in the list of available transition but it can still be executed.

Note: an automatic transition cannot use this condition as the workflow will always say that the transition is not available. To have an automatic transition not visible in the available transitions list, use the <callerIsSystem> condition.

No attribute

(--> toc)

waitForChildren

Syntax: <waitForChildren/>

Condition checking that all child workflow are terminated.

No attribute

(--> toc)

Meta-Attributes Substitution Group

Meta-attributes are ways to add custom data in the workflow definition that is not used by the workflow core. Extension can use specific mate-attributes to add the data they need.

Meta-attributes are forming a XML substitution group. All the meta-attributes described in this section are equivalent from XML point of view.

property

Syntax: <property id="propId" value="text"/>

Simple property (key-value pair).

Attributes:

AttributeDescriptionType
idId of the property.* occurrence: Mandatory
* type: string
valueValue of the property.* occurrence: Mandatory
* type: string

(--> toc)

nameData

Syntax: <nameData id="dataId" name="A Name"> ... </nameData>

Multi-lingual meta-data. 'name' means single-line short text; for multi-line text use the <textData> element.

Attributes:

AttributeDescriptionType
idUnique ID for the workflow definition.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
nameMeta-data name value (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)

Content:

ElementMultiplicity
name*

(--> toc)

textData

Syntax: <textData id="dataId" text="A text"> ... </textData>

Multi-lingual meta-data. 'text' means multi-line and possibly long text; for short and single-line text use the <nameData> element.

Attributes:

AttributeDescriptionType
idUnique ID for the workflow definition.* occurrence: Mandatory
* type: XML ID (string without spaces or special characters)
textMeta-data text value (for the default locale). Using this attribute is the same as using a <text> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)

Content:

ElementMultiplicity
text*

(--> toc)

Parameters Substitution Group

Parameters elements are ways to describe transition parameters. New elements can be made to describe application-specific types of parameters.

Parameters are forming a XML substitution group. All the parameters described in this section are equivalent from XML point of view.

Note: the parameters default value is used ... (TODO)

Parameter Common Attributes & Content

All the parameter definition share a set of attributes and can have <name> and <descritpion> content.

Parameter Common Attributes:

AttributeDescriptionType
idId of the parameter.* occurrence: Mandatory
* type: string
mandatoryFlag saying if the parameter is mandatory.* occurrence: Optional
* type: boolean ('true' or 'false')
* default value: true
defaultValueDefault value of the parameter. Ex: if your define a 'name' parameter and your peer has a getName() method, typical values is '${peer.name}'* occurrence: Optional
* type: string
* default value: null
* expr: this attribute can contain expressions.
nameDisplayable name of the parameter (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the parameter (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Parameter Common Content:

ElementMultiplicity
name*
description*

stringParameter

Syntax: <stringParameter id="strParam" maxLength="50"/>

Definition of a string parameter for the transition. This parameter definition is for single-line string (no CR), for multi-line strings, use <textParameter> instead.

Attributes (in addition to the Parameter Common Attributes):

AttributeDescriptionType
minLengthMinimum length of the string.* occurrence: Optional
* type: positive integer
* default value: 0
maxLengthMaximum length of the string.* occurrence: Optional
* type: positive integer
* default value: (no maximum length)

(--> toc)

textParameter

Syntax: <textParameter id="txtParam" maxLength="1024"/>

Definition of a string parameter for the transition. This parameter definition is for multi-line string, for single-line strings, use <stringParameter> instead.

The validity of the parameters passed to a transition is checked. The presence of mandatory parameters and the type of the parameters is always checked. Additional constraints can be defined depending of the type of parameter.

Attributes (in addition to the Parameter Common Attributes):

AttributeDescriptionType
minLengthMinimum length of the string.* occurrence: Optional
* type: positive integer
* default value: 0
maxLengthMaximum length of the string.* occurrence: Optional
* type: positive integer
* default value: maxint (no maximum length)

(--> toc)

booleanParameter

Syntax: <booleanParameter id="boolParam" />

Definition of a boolean parameter for the transition.

Attributes: see Parameter Common Attributes.

(--> toc)

intParameter

Syntax: <intParameter id="intParam" />

Definition of an integer parameter for the transition.

Attributes (in addition to the Parameter Common Attributes):

AttributeDescriptionType
minMinimum value of the parameter.* occurrence: Optional
* type: integer
* default value: minint (no minimum)
maxMaximum value of the parameter.* occurrence: Optional
* type: integer
* default value: maxint (no maximum)

(--> toc)

longParameter

Syntax: <longParameter id="lngParam" />

Definition of a long parameter for the transition.

Attributes (in addition to the Parameter Common Attributes):

AttributeDescriptionType
minMinimum value of the parameter.* occurrence: Optional
* type: long
* default value: minlong (no minimum)
maxMaximum value of the parameter.* occurrence: Optional
* type: long
* default value: maxlong (no maximum)

(--> toc)

enumParameter

Syntax: <enumParameter id="enumParam"> ... </enumParameter>

Parameter with enumerated values. The possible values of the parameter are described by <option> sub-elements.

Attributes: see Parameter Common Attributes.

Content (in addition to the Parameter Common Content):

ElementMultiplicity
option1..*

(--> toc)

proxyParameter

Syntax: <proxyParameter id="clsParam" class="org.company.MyClass"> ... </proxyParameter>

Definition of a parameter delegating the actual definition to a class implementing the org.tinyWorkflow.definition.parameter.TransitionParameterExternalDefinition interface.

The common attributes and all defined meta-data are passed to the implementing class with the init(ProxyParameterDefinition) method.

Attributes (in addition to the Parameter Common Attributes):

AttributeDescriptionType
classFully qualified name of the class implementing the TransitionParameterDefinition interface* occurrence: Mandatory
* type: string

Content (in addition to the Parameter Common Content):

ElementMultiplicity
any meta-attribute*

(--> toc)

dateParameter

Syntax: <dateParameter id="dateParam" />

Definition of a parameter of type 'Date'.

Attributes: see Parameter Common Attributes.

(--> toc)

workflowStateParameter

Syntax: <workflowStateParameter id="wfStateParam" />

Definition of a parameter which is a state ID of the current workflow. This parameter definition will provide an enumeration of all the possible states of the workflow.

Attributes: see Parameter Common Attributes.

(--> toc)

fileParameter

Syntax: <fileParameter id="fileParamId" />

Definition of a parameter which is an HTML uploaded file. This parameter is represented by an object of the org.tinyWorkflow.struts.parameter.UploadedFile class.

Note: this parameter class is defined in the TinyWorkflow-Struts extension

Attributes: see Parameter Common Attributes.

(--> toc)

objectParameter

Syntax: <objectParameter id="objParamId" class="java.util.List" />

Definition of a parameter of any type. When the class attribute is defined, the given object is validated to be an instance of that class (or interface). The object type can also be a sub-class of the given class.

Attributes (in addition to the Parameter Common Attributes):

AttributeDescriptionType
classFully qualified name of the class (or super-class) of the object* occurrence: Optional
* type: string
* default value: null (no type checking)

(--> toc)

Priority Calculators Substitution Group

Priority calculators are objects used to calculate the workflow priority. The workflow can have 5 priority levels: Low, Normal, Medium, High and Urgent. The priority calculators mainly implement a calculatePriority method calculating one of those 5 constants from the current workflow state.

Priority calculators are forming a XML substitution group. All the priority calculators described in this section are equivalent from XML point of view.

proxyPriority

Syntax: <proxyPriority class="org.company.MyClass"> ... </proxyPriority>

Definition of a priority calculator delegating the actual calculation to a class implementing the org.tinyWorkflow.definition.priority.ExternalPriorityCalculator interface.

All defined meta-data are passed to the implementing class with the init(ProxyPriorityCalculator) method.

Attributes:

AttributeDescriptionType
classFully qualified name of the class implementing the ExternalPriorityCalculator interface* occurrence: Mandatory
* type: string

Content:

ElementMultiplicity
any meta-attribute*

(--> toc)

durationPriority

Syntax: <durationPriority days="5"/>

Definition of a priority calculator based on duration. The duration is expressed as a sum of days, hours and minutes. The whole workflow must complete in less time that the given duration. The more the workflow elapsed time reaches this duration the more it priority increase. When the workflow is still not finished after the due time, it priority is set to Urgent.

Attributes:

AttributeDescriptionType
daysNumber of days of the maximum workflow duration* occurrence: At least one of 'days', 'hours' or 'minutes' must be specified
* type: int
* default value: 0
hoursNumber of hours of the maximum workflow duration* occurrence: At least one of 'days', 'hours' or 'minutes' must be specified
* type: int
* default value: 0
minutesNumber of minutes of the maximum workflow duration* occurrence: At least one of 'days', 'hours' or 'minutes' must be specified
* type: int
* default value: 0

(--> toc)

fixedPriority

Syntax: <fixedPriority value="high"/>

Definition of a priority calculator always returning the same fixed priority value.

Attributes:

AttributeDescriptionType
valueThe value of the priority.* occurrence: Mandatory
* type: enumerated = one of "low", "normal", "medium", "high" or "urgent"

(--> toc)

peerPriority

Syntax: <peerPriority method="calculatePriority"/>

Definition of a priority calculator delegating the actual priority calculation to a method of the workflow peer. The specified method can have no parameter or can accept a TransitionContext as parameter.

Attributes:

AttributeDescriptionType
methodName of the method to call.* occurrence: Mandatory
* type: string

(--> toc)

Flags Substitution Group

Flags are objects used encode specific state of the workflow. This state is saved in the database and can be retrieved without having to re-evaluate it. It's useful when the state involve a set of sub-element of the workflow, in this case the calculation of the state require complex database selection that you don't want to redo each time the state is displayed.

Flags are forming a XML substitution group. All the flags described in this section are equivalent from XML point of view.

Flags Common Attributes & Content

All the flags share a set of attributes and can have <name>, <description> and <meta> content.

Flags Common Attributes:

AttributeDescriptionType
idId of the parameter.* occurrence: Mandatory
* type: string
maskIndicates the bits reserved to encode the flag.* occurrence: Mandatory
* type: integer
nameDisplayable name of the flag (for the default locale). Using this attribute is the same as using a <name> element without locale.* occurrence: optional
* type: String
* default value: null (no name defined)
descriptionDisplayable description of the flag (for the default locale). Using this attribute is the same as using a <description> element without locale.* occurrence: optional
* type: String
* default value: null (no description defined)

Flags Common Content:

ElementMultiplicity
name*
description*
meta0..1

proxyFlag

Syntax: <proxyFlag id="clsFlag" mask="1" class="org.company.MyClass"> ... </proxyFlag>

Definition of a flag delegating the actual calculation to a class implementing the org.tinyWorkflow.definition.flags.ExternalWorkflowFlag interface.

The common attributes and all defined meta-data are accessible to the implementing class within the init(ClassWorkflowFlag) method.

Attributes (in addition to the Flags Common Attributes):

AttributeDescriptionType
classFully qualified name of the class implementing the ExternalWorkflowFlag interface* occurrence: Mandatory
* type: string

(--> toc)

peerBooleanFlag

Syntax: <peerBooleanFlag id="peerFlag" mask="1" method="calculateFlag" trueValue="ok"> ... </peerBooleanFlag>

Definition of a flag delegating the actual calculation to a boolean method of the workflow peer. If the method returns true, the 'trueValue' is used as the flag value, if it returns false, the 'falseValue' is used. If one of the 'trueValue' or 'falseValue' is not defined, the flag is not defined in the corresponding case.

Attributes (in addition to the Flags Common Attributes):

AttributeDescriptionType
methodName of the boolean method to call on the workflow peer.* occurrence: Mandatory
* type: string
trueValueValue of the flag when the peer method returns true.* occurrence: Optional (but at least one of 'trueValue' or 'falseValue' must be defined)
* type: string
* default value: null (flag not defined in this case)
falseValueValue of the flag when the peer method returns false.* occurrence: Optional (but at least one of 'trueValue' or 'falseValue' must be defined)
* type: string
* default value: null (flag not defined in this case)

(--> toc)

subWorkflowFlag

Syntax: <subWorkflowFlag id="subWfFlag" mask="1"> ... </subWorkflowFlag>

Definition of a flag checking if some sub-workflow of the current workflow is defined.

Attributes (in addition to the Flags Common Attributes):

AttributeDescriptionType
someSubValue of the flag when some sub-workflow is defined.* occurrence: Optional
* type: string
* default value: "some"
noSubValue of the flag when no sub-workflow is defined.* occurrence: Optional
* type: string
* default value: null (flag not defined in this case)
includeTerminatedWhen true, the terminated workflows are taken into account for the flag calculation, otherwise they are ignored* occurrence: Optional
* type: boolean
* default value: false

(--> toc)

stateSetFlag

Syntax: <stateSetFlag id="peerFlag" mask="1" states="state1,state2" trueValue="in"> ... </stateSetFlag>

Definition of a flag saying if the workflow is inside or outside a set of states.

Attributes (in addition to the Flags Common Attributes):

AttributeDescriptionType
statesComa-separated list of states ids.* occurrence: Mandatory
* type: string
trueValueValue of the flag when the workflow state is inside the given set.* occurrence: Optional (but at least one of 'trueValue' or 'falseValue' must be defined)
* type: string
* default value: null (flag not defined in this case)
falseValueValue of the flag when the workflow state is outside the given set.* occurrence: Optional (but at least one of 'trueValue' or 'falseValue' must be defined)
* type: string
* default value: null (flag not defined in this case)

(--> toc)

peerEnumerationFlag

Syntax: <peerEnumerationFlag id="peerFlag" mask="14" method="calculateFlag" > ... </peerEnumerationFlag>

Definition of an enumerated flag delegating the actual calculation to a method of the workflow peer. The method returns an int value which represents the index of the <flagValue> in the sub-element sequence. If the <flagValue> element doen't define a 'value' attribute, the flag is not defined for the corresponding case.

Note: as this flag defines an enumerated set of values (usually more than 2) the mask must map to several bits. Ex: if you have 5 values, you mask must be at least 3 bits (as in example above).

Attributes (in addition to the Flags Common Attributes):

AttributeDescriptionType
methodName of the int method to call on the workflow peer.* occurrence: Mandatory
* type: string

Content (in addition to the Flags Common Content):

ElementMultiplicity
flagValue2..*

(--> toc)