This document describes all XML elements of a XML Workflow definition.
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.
Syntax: <workflow id="wfId" version="1.0"> ... </workflow>
Main element of the workflow definition.
Attributes:
Attribute | Description | Type |
id | Unique ID for the workflow definition. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
version | Version of the workflow definition. | * occurrence: Mandatory * type: String |
peer | Fully-qualified class name of the workflow peer. | * occurrence: optional * type: String * default value: null (no peer defined) |
name | Displayable 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) |
description | Displayable 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:
Element | Multiplicity |
name | * |
description | * |
meta | 0..1 |
extends | * |
any priority calculator | 0..1 |
flags | 0..1 |
preFunctions | 0..1 |
initialTransitions | 0..1 |
globalTransitions | 0..1 |
states | 0..1 |
postFunctions | 0..1 |
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:
Attribute | Description | Type |
locale | Locale of this name. | * occurrence: optional * type: a java locale id * default value: null (default name) |
value | Name value. | * occurrence: Mandatory * type: String |
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:
Attribute | Description | Type |
locale | Locale of this text. | * occurrence: optional * type: a java locale id * default value: null (default name) |
value | Text value. | * occurrence: Mandatory * type: String |
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:
Attribute | Description | Type |
locale | Locale of this description. | * occurrence: optional * type: a java locale id * default value: null (default name) |
Content: Text content.
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:
Element | Multiplicity |
any meta-attribute | * |
Syntax: <flags> ... </flags>
Tag enclosing flag definitions of a workflow.
No Attributes
Content:
Element | Multiplicity |
any flag | 1..* |
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:
Attribute | Description | Type |
id | Id of the extended workflow description. | * occurrence: Mandatory * type: string |
version | Version of the extended workflow description. | * occurrence: optional * type: String * default value: null (the latest version available in the repository will be used) |
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:
No Attributes
Content:
Element | Multiplicity |
any function | * |
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:
Element | Multiplicity |
transition | 1..* |
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:
Element | Multiplicity |
transition | 1..* |
Syntax: <states> ... </states>
Tag enclosing states of the workflow.
No Attributes
Content:
Element | Multiplicity |
state | * |
endState | * |
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:
No Attributes
Content:
Element | Multiplicity |
any function | * |
Syntax: <transition id="transId"> ... </transition>
Transition definition.
Attributes:
Attribute | Description | Type |
id | Unique ID for the transition. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
auto | Flag 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 |
group | Name 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) |
name | Displayable 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) |
description | Displayable 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:
Element | Multiplicity |
name | * |
description | * |
meta | * |
parameters | 0..1 |
permissions | 0..1 |
conditions | 0..1 |
preFunctions | 0..1 |
results | 0..1 |
postFunctions | 0..1 |
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:
No Attributes
Content:
Element | Multiplicity |
any parameter | * |
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:
Element | Multiplicity |
any condition | * |
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:
Element | Multiplicity |
any condition | * |
Syntax: <results> ... </results>
Tag enclosing definitions of all possible transition results. This sequence must always end with one unconditional result.
No Attributes
Content:
Element | Multiplicity |
conditionalResult | * |
result | 1 |
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:
Attribute | Description | Type |
state | ID 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. |
owner | Owner 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. |
logInfo | Additional 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. |
workflowId | When 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. |
workflowVersion | When 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:
Element | Multiplicity |
any condition | 1 |
Syntax: <result state="state1" owner="Billy" logInfo="Some info using ${param}"/>
Result of a transition.
Attributes:
Attribute | Description | Type |
state | ID 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. |
owner | Owner 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. |
logInfo | Additional 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. |
workflowId | When 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. |
workflowVersion | When 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. |
Syntax: <state id="stateId"> ... </state>
State definition.
Attributes:
Attribute | Description | Type |
id | Unique ID for this state. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
name | Displayable 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) |
description | Displayable 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:
Element | Multiplicity |
name | * |
description | * |
meta | * |
preFunctions | 0..1 |
transitions | 0..1 |
postFunctions | 0..1 |
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:
Attribute | Description | Type |
id | Unique ID for this state. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
name | Displayable 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) |
description | Displayable 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:
Element | Multiplicity |
name | * |
description | * |
meta | * |
preFunctions | 0..1 |
Syntax: <transitions> ... </transitions>
Tag enclosing transitions of a state.
No Attributes
Content:
Element | Multiplicity |
transitionRef | * |
transition | * |
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:
Attribute | Description | Type |
refId | Id of the referenced global transition. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
id | Give the reference a specific ID | * occurrence: optional * type: XML ID (string without spaces or special characters) * default value: same sa refId |
auto | Override the 'auto' parameter of referenced transition | * occurrence: optional * type: boolean ("true" or "false") * default value: not defined (value of referenced transition is used) |
group | Override the 'group' parameter of referenced transition | * occurrence: optional * type: String * default value: not defined (value of referenced transition is used) |
name | Override the 'name' parameter of referenced transition | * occurrence: optional * type: String * default value: not defined (value of referenced transition is used) |
description | Override 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):
Element | Multiplicity |
name | * |
description | * |
meta | * |
parameters | 0..1 |
permissions | 0..1 |
conditions | 0..1 |
preFunctions | 0..1 |
results | 0..1 |
postFunctions | 0..1 |
Syntax: <option id="opt1" name="Option One"> ... </option>
Option of an enumerated parameter.
Attributes:
Attribute | Description | Type |
id | Id of the option (= it actual value). | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
name | Displayable 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:
Element | Multiplicity |
name | * |
Syntax: <flagValue value="someValue" > ... </flagValue>
Definition of an enumerated value flag inside a workflow flag.
Attributes:
Attribute | Description | Type |
value | The 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) |
name | Displayable 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) |
description | Displayable 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:
Element | Multiplicity |
name | * |
description | * |
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).
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:
Attribute | Description | Type |
class | Fully qualified name of the class implementing the function. | * occurrence: Mandatory * type: String |
resultParamId | A parameter Id used to store the result of the function into the TransitionContext | * occurrence: optional * type: String * default value: null (function result ignored) |
Content:
Element | Multiplicity |
any meta-attribute | * |
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.
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:
Attribute | Description | Type |
method | Name of the peer method to call. | * occurrence: Mandatory * type: String |
resultParamId | A parameter Id used to store the result of the function into the TransitionContext | * occurrence: optional * type: String * default value: null (function result ignored) |
Syntax: <startChildWorkflow id="someWorkflow" initialTransition="someTransition"/>
Function starting a child workflow. The given initial transition is directly executed on this new child workflow.
Attributes:
Attribute | Description | Type |
id | Id of the workflow definition for the child workflow. | * occurrence: Mandatory * type: String |
version | Version of the workflow definition for the child workflow. | * occurrence: optional * type: String * default value: null (latest version available) |
initialTransition | Id of the initial transition to execute on the child workflow. | * occurrence: Mandatory * type: String |
forwardCaller | Flag 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 |
forwardParams | Flag 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 |
resultParamId | A parameter Id used to store the result of the function into the TransitionContext | * occurrence: optional * type: String * default value: null (function result ignored) |
Conditions are part of a XML substitution group; all the conditions described in this section are equivalent (from XML point of view).
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:
Attribute | Description | Type |
class | Fully qualified name of the class implementing the condition. | * occurrence: Mandatory * type: String |
Content:
Element | Multiplicity |
any meta-attribute | * |
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.
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:
Attribute | Description | Type |
method | Name of the peer method to call. | * occurrence: Mandatory * type: String |
Syntax: <and> ... </and>
Condition combining sub-condition with a AND operator.
No attribute
Content:
Element | Multiplicity |
any condition | 2..* |
Syntax: <or> ... </or>
Condition combining sub-condition with an OR operator.
No attribute
Content:
Element | Multiplicity |
any condition | 2..* |
Syntax: <not> ... </not>
Condition negating it sub-condition.
No attribute
Content:
Element | Multiplicity |
any condition | 1 |
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
Syntax: <callerIsWorkflowOwner/>
Condition checking that the caller of a transition is the owner of the workflow instance.
No attribute
Syntax: <workflowHasNoOwner/>
Condition checking that the caller of a transition is the owner of the workflow.
No attribute
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:
Attribute | Description | Type |
ids | List of the allowed ids separated by comas. | * occurrence: Mandatory * type: coma-separated list of string |
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:
Attribute | Description | Type |
paramId | Id of the parameter to check. | * occurrence: Mandatory * type: String |
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:
Attribute | Description | Type |
paramId | Id of the parameter to check. | * occurrence: Mandatory * type: String |
value | The expected parameter value. | * occurrence: Mandatory * type: String |
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:
Attribute | Description | Type |
eval | The 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. |
value | The comparison value. | * occurrence: Mandatory * type: String |
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
Syntax: <waitForChildren/>
Condition checking that all child workflow are terminated.
No attribute
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.
Syntax: <property id="propId" value="text"/>
Simple property (key-value pair).
Attributes:
Attribute | Description | Type |
id | Id of the property. | * occurrence: Mandatory * type: string |
value | Value of the property. | * occurrence: Mandatory * type: string |
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:
Attribute | Description | Type |
id | Unique ID for the workflow definition. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
name | Meta-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:
Element | Multiplicity |
name | * |
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:
Attribute | Description | Type |
id | Unique ID for the workflow definition. | * occurrence: Mandatory * type: XML ID (string without spaces or special characters) |
text | Meta-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:
Element | Multiplicity |
text | * |
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)
All the parameter definition share a set of attributes and can have <name> and <descritpion> content.
Attribute | Description | Type |
id | Id of the parameter. | * occurrence: Mandatory * type: string |
mandatory | Flag saying if the parameter is mandatory. | * occurrence: Optional * type: boolean ('true' or 'false') * default value: true |
defaultValue | Default 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. |
name | Displayable 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) |
description | Displayable 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) |
Element | Multiplicity |
name | * |
description | * |
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):
Attribute | Description | Type |
minLength | Minimum length of the string. | * occurrence: Optional * type: positive integer * default value: 0 |
maxLength | Maximum length of the string. | * occurrence: Optional * type: positive integer * default value: (no maximum length) |
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):
Attribute | Description | Type |
minLength | Minimum length of the string. | * occurrence: Optional * type: positive integer * default value: 0 |
maxLength | Maximum length of the string. | * occurrence: Optional * type: positive integer * default value: maxint (no maximum length) |
Syntax: <booleanParameter id="boolParam" />
Definition of a boolean parameter for the transition.
Attributes: see Parameter Common Attributes.
Syntax: <intParameter id="intParam" />
Definition of an integer parameter for the transition.
Attributes (in addition to the Parameter Common Attributes):
Attribute | Description | Type |
min | Minimum value of the parameter. | * occurrence: Optional * type: integer * default value: minint (no minimum) |
max | Maximum value of the parameter. | * occurrence: Optional * type: integer * default value: maxint (no maximum) |
Syntax: <longParameter id="lngParam" />
Definition of a long parameter for the transition.
Attributes (in addition to the Parameter Common Attributes):
Attribute | Description | Type |
min | Minimum value of the parameter. | * occurrence: Optional * type: long * default value: minlong (no minimum) |
max | Maximum value of the parameter. | * occurrence: Optional * type: long * default value: maxlong (no maximum) |
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):
Element | Multiplicity |
option | 1..* |
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):
Attribute | Description | Type |
class | Fully qualified name of the class implementing the TransitionParameterDefinition interface | * occurrence: Mandatory * type: string |
Content (in addition to the Parameter Common Content):
Element | Multiplicity |
any meta-attribute | * |
Syntax: <dateParameter id="dateParam" />
Definition of a parameter of type 'Date'.
Attributes: see Parameter Common Attributes.
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.
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.
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):
Attribute | Description | Type |
class | Fully qualified name of the class (or super-class) of the object | * occurrence: Optional * type: string * default value: null (no type checking) |
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.
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:
Attribute | Description | Type |
class | Fully qualified name of the class implementing the ExternalPriorityCalculator interface | * occurrence: Mandatory * type: string |
Content:
Element | Multiplicity |
any meta-attribute | * |
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:
Attribute | Description | Type |
days | Number of days of the maximum workflow duration | * occurrence: At least one of 'days', 'hours' or 'minutes' must be specified * type: int * default value: 0 |
hours | Number of hours of the maximum workflow duration | * occurrence: At least one of 'days', 'hours' or 'minutes' must be specified * type: int * default value: 0 |
minutes | Number of minutes of the maximum workflow duration | * occurrence: At least one of 'days', 'hours' or 'minutes' must be specified * type: int * default value: 0 |
Syntax: <fixedPriority value="high"/>
Definition of a priority calculator always returning the same fixed priority value.
Attributes:
Attribute | Description | Type |
value | The value of the priority. | * occurrence: Mandatory * type: enumerated = one of "low", "normal", "medium", "high" or "urgent" |
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:
Attribute | Description | Type |
method | Name of the method to call. | * occurrence: Mandatory * type: string |
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.
All the flags share a set of attributes and can have <name>, <description> and <meta> content.
Attribute | Description | Type |
id | Id of the parameter. | * occurrence: Mandatory * type: string |
mask | Indicates the bits reserved to encode the flag. | * occurrence: Mandatory * type: integer |
name | Displayable 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) |
description | Displayable 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) |
Element | Multiplicity |
name | * |
description | * |
meta | 0..1 |
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):
Attribute | Description | Type |
class | Fully qualified name of the class implementing the ExternalWorkflowFlag interface | * occurrence: Mandatory * type: string |
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):
Attribute | Description | Type |
method | Name of the boolean method to call on the workflow peer. | * occurrence: Mandatory * type: string |
trueValue | Value 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) |
falseValue | Value 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) |
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):
Attribute | Description | Type |
someSub | Value of the flag when some sub-workflow is defined. | * occurrence: Optional * type: string * default value: "some" |
noSub | Value of the flag when no sub-workflow is defined. | * occurrence: Optional * type: string * default value: null (flag not defined in this case) |
includeTerminated | When true, the terminated workflows are taken into account for the flag calculation, otherwise they are ignored | * occurrence: Optional * type: boolean * default value: false |
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):
Attribute | Description | Type |
states | Coma-separated list of states ids. | * occurrence: Mandatory * type: string |
trueValue | Value 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) |
falseValue | Value 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) |
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):
Attribute | Description | Type |
method | Name of the int method to call on the workflow peer. | * occurrence: Mandatory * type: string |
Content (in addition to the Flags Common Content):
Element | Multiplicity |
flagValue | 2..* |