w i z a r d 4 j

Flowchart Xml Language Reference

This section contains a detailed description of the flowchart xml language.

Before describing each of the flowchart elements, their attributes and child elements, we provide an overview of which element can contain which element. Grey cells indicate that there is no containment possible.

containsflowchartrootfragmentbranchinfoinputswitchloopfragmentPointervalueoption
flowchart10-N
root0-N0-N0-N0-N0-N
fragment0-N0-N0-N0-N0-N
branch0-N0-N0-N0-N0-N
info
input0-N0-N
switch2-N
loop0-N0-N0-N0-N0-N
fragmentPointer
value
option

1 <flowchart>

The <flowchart> element is the root element of the flowchart description. It contains exactly one <root> element and 0 or more <fragment> elements. A <fragment> is a piece of a flowchart that is used multiple times and that can be pointed at by a <fragmentPointer> element. One can compare a <fragment> with a subroutine or a function.

This element has no attributes.

2 <root>

The <root> element is the starting point of the flowchart. It has a number of attributes that specify the default attribute values of other flowchart elements. If these defaults are not explicitly set, the defaults of the xsd file are used (cfr. column Default).

AttributeMandatoryDefaultDescription
defaultMinNbrOfCharsN0If the min attribute of an input element of type string or stringArray is not specified, the value in this attribute will be used for the minimum number of characters in the string.
defaultMaxNbrOfCharsN30If the max attribute of an input element of type string or stringArray is not specified, the value in this attribute will be used for the maximum number of characters in the string.
defaultMinNbrOfElementsN1If the minNbrOfElements attribute of an input element of type stringArray is not specified, the value in this attribute will be used for the minimum number of elements in the stringArray.
defaultMaxNbrOfElementsN1If the maxNbrOfElements attribute of an input element of type stringArray is not specified, the value in this attribute will be used for the maximum number of elements in the stringArray.
defaultMinIntValueN0If the min attribute of an input element of type integer is not specified, the value in this attribute will be used for the minimum value of the integer.
defaultMaxIntValueN100If the max attribute of an input element of type integer is not specified, the value in this attribute will be used for the maximum value of the integer.
defaultMinDecValueN0.00If the min attribute of an input element of type decimal is not specified, the value in this attribute will be used for the minimum value of the decimal.
defaultMaxDecValueN100.00If the max attribute of an input element of type decimal is not specified, the value in this attribute will be used for the maximum value of the decimal.
defaultMinYearN0If the min attribute of an input element of type date or dateTime is not specified, the value in this attribute will be used for the minimum value of the year in date or dateTime.
defaultMaxYearN10If the max attribute of an input element of type date or dateTime is not specified, the value in this attribute will be used for the maximum value of the year in date or dateTime.
defaultIncrementN1If the increment attribute of an input element of type integer or decimal is not specified, the value in this attribute will be used as the increment of the integer or decimal (to understand the use of increment with the decimal type, see the increment description).
defaultNbrOfDecimalsN2If the nbrOfDecimals attribute of an input element of type decimal is not specified, the value in this attribute will be used as the number of decimals.
defaultRelativeToCurrentYearNtrueIf the relativeToCurrentYear attribute of an input element of type date or dateTime is not specified, the value in this attribute will be used as the value for the relativeToCurrentYear attribute.
defaultMinNbrOfIterationsN1If the minNbrOfIterations attribute of a loop element of type nbrOfIterations is not specified, the value in this attribute will be used for the minimum number of iterations in the loop.
defaultMaxNbrOfIterationsN3If the maxNbrOfIterations attribute of a loop element of type nbrOfIterations is not specified, the value in this attribute will be used for the maximum number of iterations in the loop (its maximum value is 100).

3 <fragment>

It is not uncommon that a flowchart contains the same sequence of elements in various locations. To avoid duplication in a flowchart tree, one can extract a subtree of this flowchart tree and put it aside in a fragment. The <fragment> element is the root of this subtree. It has a single attribute 'name'. The removed subtree is replaced by a <fragmentPointer> element that refers to the fragment by its name.

A fragment itself can contain fragmentPointers referring to other fragments. To avoid loops of fragments pointing to each other, the fragments must be ordered: a fragment must be listed after the fragment(s) which have a fragmentPointer to the fragment.

AttributeMandatoryDefaultDescription
nameYThe name of this element instance. The name must be unique in the flowchart. It is only used internally. It is not visible to the user.

4 <info>

This element allows to present an 'informational' screen to the user. The user is not asked for any input. This type of element is useful for e.g. indicating the progress of the flowchart, giving introductory information on the questions that will follow, etc.

AttributeMandatoryDefaultDescription
nameYThe name of this element instance. The name must be unique on its branch. It is only used internally. It is not visible to the user.
labelYThis is the text that a user will see.
helpNThis is the content of the help function. Html formatting is allowed, but the html tags must be xml escaped.

5 <input>

This element will prompt the user for input. Several input types are defined. Each input element can have a number of optional attributes that describe the constraints for this input. A detailed description of all input types and their attributes is given below.

AttributeMandatoryDefaultDescription
nameYThe name of this element instance. The name must be unique on its branch. It can be used to refer to user input when constructing the output. It is not visible to the user.
labelYThis is the text that a user will see and that should describe the requested input.
helpNThis is the content of the help function. Html formatting is allowed, but the html tags must be xml escaped.
typeYAt the moment following input types are supported: string, stringArray, integer, decimal, boolean, date, time and dateTime.
type specific attributes
minN

This attribute contains an integer value of which the semantics depend on the input type:

  • string: minimum number of characters
  • stringArray: minimum number of characters of a single element
  • integer: minimum value
  • decimal: minimum value
  • date: minimum value of the year (absolute or offset relative to the current year)
  • dateTime: minimum value of the year (absolute or offset relative to the current year)

If this attribute is not specified, the corresponding attribute of the root element is used to set the value.

maxNSimilar to the min attribute.
minNbrOfElementsNThis attribute specifies the minimum number of elements for the stringArray type.
maxNbrOfElementsNThis attribute specifies the maximum number of elements for the stringArray type.
incrementNThis attribute is only relevant for the integer and decimal types.
  • For an integer type with e.g. min=2, max=10 and increment=2 the values 2, 4, 6, 8 and 10 are allowed. Note that when a default value is specified, it must be one of these values as well.
  • For the decimal type, the increment is specified on the scale of the least significant digit, e.g. an increment set to 20 when the nbrOfDecimals is 2, means an absolute increment of 0.20. For the decimal type only increments that are a divisor of 10**nbrOfDecimals are allowed (not including 10**nbrOfDecimals itself). If the increment is not such a divisor it will be set to 1. E.g. valid increments for nbrOfDecimals=2 are: 1, 2, 4, 5, 10, 20, 25 and 50.
nbrOfDecimalsNThe number of decimals for an input of type decimal.
relativeToCurrentYearNThis attribute is only relevant for the date and dateTime types. Indicates whether min/max are absolute or an offset relative to the current year.
regExpNThis attribute allows to specify a regular expression to which the input must match (only for types string and stringArray). The syntax of the regular expressions is described here. There are also a number of predefined values one can use. These are taken from the regular expression library, so all credits should go to the people contributing at that site:
  • REGEXP_IPv4Address: IPv4 address in dotted notation, e.g. 123.24.56.223.
  • REGEXP_IPv6Address: IPv6 address, e.g. ::0:0:0:FFFF:129.144.52.38, FEDC:BA98::3210:fedc:BA98:7654:3210, ::13.1.68.3.
  • REGEXP_MacAddress: colon separated MAC address, e.g. fE:dC:bA:98:76:54.
  • REGEXP_EmailAddress: email address, e.g. bob@smith.com, bob@j.smith.museum, bob.smith@a-1.smith.com.
  • REGEXP_Url: url, e.g. http://www.domain.com, http://domain.com, https://domain.com, https://sub.domain-name.com:8080, http://domain.com/dir%201/dir_2/program.ext?var1=x&var2=my%20value, domain.com/index.html#bookmark.
  • REGEXP_HostName: hostname, e.g. regexlib.com, this.is.a.museum, 3com.com.
  • REGEXP_HostNameOrIPv4Address: hostname or IPv4 address, the union of REGEXP_HostName and REGEXP_IPv4Address.
  • REGEXP_IPv4AddressOrEmpty: REGEXP_IPv4Address or empty.
  • REGEXP_IPv6AddressOrEmpty: REGEXP_IPv6Address or empty.
  • REGEXP_MacAddressOrEmpty: REGEXP_MacAddress or empty.
  • REGEXP_EmailAddressOrEmpty: REGEXP_EmailAddress or empty.
  • REGEXP_UrlOrEmpty: REGEXP_Url or empty.
  • REGEXP_HostNameOrEmpty: REGEXP_HostName or empty.
  • REGEXP_HostNameOrIPv4AddressOrEmpty: REGEXP_HostNameOrIPv4Address or empty.

6 <value>

This <value> element can be used to store a default value(s) for the input element. The value element has no attributes. The formatting of the default values for the various types is described in the next table.

InputTypeExampleDescription
stringsome input string
integer123
decimal12.87two integers separated by a '.'
booleanfalsetrue or false
date2006-09-28formatted as yyyy-MM-dd
time14:34:42formatted as HH:mm:ss
dateTime2006-09-28T14:34:42formatted as yyyy-MM-dd'T'HH:mm:ss

For type stringArray multiple value elements can be specified.

7 <option>

If the number of allowed values for string or stringArray is limited, one can use the <option> element. The types string and stringArray can contain multiple option elements to store the allowed values as well as the default value(s). Option elements can not be combined with value elements within a single input element.

AttributeMandatoryDefaultDescription
valueYA possible value for the parent input element.
labelYThe string that will be used to present this option to the user.
selectedNfalseTo indicate whether this option is a/the default.

8 <switch>

The <switch> element will also prompt the user for input, but the difference with the input element is that the provided input will determine the branch that will be followed in the flowchart. This element is also more flexible than the binary decisions in traditional flowcharts. It is possible to select one out of multiple branches or even to select a subset of branches. In the latter case the branches will be executed in the order in which they are listed in the flowchart description.

AttributeMandatoryDefaultDescription
nameYThe name of this element instance. The name must be unique on its branch. It is not visible to the user.
labelYThis is the text that a user will see and that describes the decision to be taken.
helpNThis is the content of the help function. Html formatting is allowed, but the html tags must be xml escaped.
minNbrOfBranchesN1The minimum number of branches that need to be selected by the user.
maxNbrOfBranchesN1The maximum number of branches that can be selected by the user.

9 <branch>

The <branch> element is introduced to explicitly define a branch of a <switch> element.

AttributeMandatoryDefaultDescription
nameYThe name of this element instance. The name must be unique within the switch. It is not visible to the user.
labelYThe string that will be used to present this switch option (branch) to the user.
selectedNfalseTo indicate whether this branch is selected by default.

10 <loop>

This element allows to execute a 'flowchart section' multiple times. The number of iterations can be fixed or the user can be queried to specify the (number of) iterations.

AttributeMandatoryDefaultDescription
nameYThe name of this element instance. The name must be unique on its branch. It will also be used in the user interaction to announce the next iteration.
labelYThis is the text that a user will see at the start of a loop and that should guide the user when a decision on the number of iterations or the subset of iterations needs to be taken.
helpNThis is the content of the help function. Html formatting is allowed, but the html tags must be xml escaped.
modeY

At the moment there are three main loop modes:

  1. list: this mode requires that the list attribute is set.
  2. nbrOfIterations: for this mode the attributes minNbrOfIterations and maxNbrOfIterations determine the range of the allowed number of iterations. The iterations will be named it0, it1, it2,...
  3. userInterrupted: for this mode the user will be asked whether he/she wants another iteration (for iterations minNbrOfIterations to maxNbrOfIterations-1). For this mode the anotherIterationQuestion attribute needs to be specified. The iterations will be named it0, it1, it2,...
  4. doWhile: for this mode the loop is executed as long as the condition is valid or until the maxNbrOfIterations has been reached. The operands in the condition are either parameters (input or branch elements specified by their full path) or literals. The minNbrOfIterations attribute is ignored. In this mode the condition attribute needs to be specified. The iterations will be named it0, it1, it2,...

When the attributes minNbrOfIterations and maxNbrOfIterations are specified in the list mode, the user will be asked to select an appropriate subset of the list (if only one attribute is present, the other one will be set to either min=0 or max=nbrOfListElements. When both attributes are absent the loop will iterate over all elements in the list.

When the attributes minNbrOfIterations and maxNbrOfIterations are not specified in the nbrOfIterations mode, the corresponding root attributes will be used. If minNbrOfIterations equals maxNbrOfIterations, the number of iterations is fixed and there will be no user interaction. If minNbrOfIterations < maxNbrOfIterations: the user will be prompted to select the number of iterations.

When the attributes minNbrOfIterations and maxNbrOfIterations are not specified in the userInterrupted mode, the corresponding root attributes will be used. If minNbrOfIterations equals maxNbrOfIterations, the number of iterations is fixed and there will be no user interaction. If minNbrOfIterations < maxNbrOfIterations: the user will be prompted whether he/she wants to execute another iteration (for iterations minNbrOfIterations to maxNbrOfIterations-1).

When the attribute maxNbrOfIterations is not specified in the doWhile mode, the corresponding root attribute will be used.

listNOnly used in the list mode. It is a ',' separated list of strings, each specifying an iteration, e.g. "red,blue,yellow".
minNbrOfIterationsNSee description mode attribute.
maxNbrOfIterationsNSee the description of the mode attribute (its maximum value is 100).
anotherIterationQuestionNOnly for mode 'userInterrupted'.
conditionNOnly for mode 'doWhile'. It must contain a wizard4j boolean expression. The boolean expression can be simple or composed. For composed expressions the traditional precedence rules apply and precedence can also be specified by the use of parentheses: '(' and ')'. Operators, operands and parentheses MUST be separated by whitespace. A literal operand that contains whitespaces or parentheses or that equals an operator name, must be enclosed by single quotes (') to indicate that it is a (single) operand (note that a single quote is a special character in xml, but it can be used safely in an attribute when the attribute delimitors are double quotes (")). Note that traditional names of operators (e.g. '&&', '<=') are not used since they contain characters that are special in xml. The operands can be parameters (input or branch elements specified by their full path) or literals. The next table gives an overview of the supported operators and their use.

OperatorOperand(s)Description
EXISTSbranch parameterReturns true if the specified branch exists. This operator can not be applied to an input parameter (note: checking the existence of an input parameter can be achieved by checking the existence of its parent branch).
!input parameter or literal (type boolean)The 'not' operator. Inverses the boolean value.
LTinput parameter or literal (any type)The 'less than' operator requires 2 operands. If an operand is an input parameter it can be of any type (for type stringArray the number of elements are compared). The formatting of the literals must be done as specified in the value element.
GTinput parameter or literal (any type)The 'greater than' operator requires 2 operands. See 'LT' operator.
LTEinput parameter or literal (any type)The 'less than or equals' operator requires 2 operands. See 'LT' operator.
GTEinput parameter or literal (any type)The 'greater than or equals' operator requires 2 operands. See 'LT' operator.
!=input parameter or literal (any type)The 'not equal' operator requires 2 operands. See 'LT' operator.
==input parameter or literal (any type)The 'equals' operator requires 2 operands. See 'LT' operator.
ORinput parameter or literal (boolean type)The 'or' operator requires 2 boolean operands.
ANDinput parameter or literal (boolean type)The 'and' operator requires 2 boolean operands.

Example: ( /branch1/name != 'Joe Smith' ) AND ( /loop/*/age LTE 40 )

11 <fragmentPointer>

The <fragmentPointer> element points to a <fragment>.

AttributeMandatoryDefaultDescription
nameYThe name of the element instance.
refYThe reference to the name of the fragment.