×
Menu
Index

Userinterface XML

 

Introduction

UserInterfaces are meant to be parsed by client applications to form a user interface in HTML or any other language of your choice. Below is described how all items from the UserInterface are stored in an XML document so that developers can build a custom parser for it. Eventually we can provide you with ASP.Net (C#) examples if you like. Please contact us at support@softrules.com if you would like to use that.
 

XML structure

The UserInterface XML document looks like this:
 
<?xml version="1.0" encoding="utf-8"?>
<SoftRulesUserInterface>
    <Questions>
        <Question State="New"></Question>
        <Question State="New"></Question>
        <Group MaxOccurs="1">
            <Items>
                <Question State="New"></Question>
                <Question State="New"></Question>
                <Group MaxOccurs="1"></Group>
            </Items>
        </Group>
    </Questions>
    <SoftRulesXML></SoftRulesXML>
    <ConfigID>1000</ConfigID>
    <UserInterfaceID>1</UserInterfaceID>
</SoftRulesUserInterface>
 

Questions

The XML representation of a Question:
 
<Question State="New">
    <Name>PK_BRANCHE</Name>
    <Description>ADN branchecode</Description>
    <Value>990</Value>
    <ToolTip/>
    <HelpText>Classificering verzekeringscontract.</HelpText>
    <DefaultState>Editable</DefaultState>
    <DisplayOnly>False</DisplayOnly>
    <VisibleExpression>
        <Conditions/>
        <StartValue>False</StartValue>
    </VisibleExpression>
    <DefaultStateExpression>
        <Conditions/>
        <StartValue>True</StartValue>
    </DefaultStateExpression>
    <RequiredExpression>
        <Conditions/>
        <StartValue>True</StartValue>
    </RequiredExpression>
    <DataType>AlphaNumeric</DataType>
    <ElementPath>Relatiedocument/Pakket/Mantel/PK{1}</ElementPath>
    <ValidRanges/>
    <ValidValues/>
    <Unit/>
    <TextValues TextValuesID="5" TextQuestionID="">
        <Item>
            <Value>010</Value>
            <Text>Ongevallen en ziekte</Text>
        </Item>
        <Item>
            <Value>011</Value>
            <Text>Ongevallen</Text>
        </Item>
    </TextValues>
    <UpdateUserInterface Description="">False</UpdateUserInterface>
    <QuestionID>de1a5bd3-caca-41f1-a982-bf44832281fc</QuestionID>
</Question>
 
A Question has the following properties:
 
Attribuut State
 
State of the Question. Possible values: New, Changed, Unchanged
Name (*)
 
Name of the Element. This Name field will be parsed by SoftRules® to create an Input XML document.
Description
 
This field describes the question to be asked to the user. For example: What is your age?
Value (*)
 
The answer given by the user, eventually prefilled by SoftRules®
ToolTip
 
Contains text to use as a tooltip in the user interface
HelpText
 
Contains text to use a helptext in the user interface
DefaultState
 
Describes the function of the DefaultStateExpression. If DefaultState is Editable and the DefaultStateExpression is True (which they are by default), the Question should be editable (and when False they are read only). If DefaultState is ReadOnly and the DefaultStateExpression is True (which they are by default), the Questions are read only (and when False, they are editable).
DisplayOnly
 
Indicates that the Question should be displayed only and should not be returned to the Server during a process
VisibleExpression (*)
 
Is the expression that tells the client to make the Question visible or not visible
DefaultStateExpression
 
See DefaultState
RequiredExpression
 
Is the expression that tells the client to make the Question required or not
DataType
 
For example String or Integer
Restrictions
 
Restrictions as they are mentioned in an XML schema
ElementPath (*)
 
The path where the element will be placed in the XML document by SoftRules® before processing
ValidRanges
 
The boundaries of the Value field
ValidValues
 
The values that may be used in the Value field
Unit
 
This Value may be postfixed to the element's Value field. For example kg (for kilograms) or % (for percentage)
TextValues
 
 
A list with all possible labels and values (for example: G=Gasoline, D=Diesel, L=LPG). After the user has made his choice, the client application should write the Question/TextValues/Item/Value field in the Question/Value field of the Question that has a QuestionID matching with the attribute TextQuestionID. When the TextQuestionID is empty, the Value of the current Question should be used.
 
Example: List of car brands
 
<TextValues TextValuesID="-1" TextQuestionID="">
    <Item>
        <Value>3</Value>
        <Text>A M C</Text>
    </Item>
    <Item>
        <Value>10030</Value>
        <Text>Ac Cobra</Text>
    </Item>
    <Item>
        <Value>2</Value>
        <Text>Alfa Romeo</Text>
    </Item>
    <Item>
        <Value>10061</Value>
        <Text>Alko</Text>
    </Item>
    <Item>
        <Value>56</Value>
        <Text>Aro</Text>
    </Item>
</TextValues>
 
UpdateUserinterface
 
Indicates that this field has a server side action attached. So after the user has changed this field, the client should send the userinterface to SoftRules®, using Function 15.  Possible values: True and False.
QuestionID (*)
 
A unique ID (GUID) for the Question.
 
 

Obliged fields

All fields marked with a * symbol are obliged in the communication between client and SoftRules® Server.
 

Groups

The XML representation of a Group is as follows:
 
<Group MaxOccurs="1">
    <GroupID>81d06bff-b5c5-4201-ac9e-3537c5d9c988</GroupID>
    <Name>Aansprakelijkheid Particulieren</Name>
    <Type>box</Type>
    <RepeatingPath/>
    <VisibleExpression>
        <Conditions/>
        <StartValue>True</StartValue>
    </VisibleExpression>
    <Items>
        <Question State="New"></Question>
        <Question State="New"></Question>
        <Group MaxOccurs="1"></Group>
    </Items>
</Group>
 
A Group has the following properties:
 
MaxOccurs
 
The number of times that this Group may appear in the Userinterface
GroupID
 
A unique Code (GUID) for the Group
Name
 
The name of the Group. Client applications may use this for display on a tab (for example)
Type
 
The type of the Group
  • Page (new page or tab page)
  • Box (rectangular around a number of Questions to indicate that they belong to each other)
  • Expandable (Possibility to expend and collapse the Questions in the Group)
RepeatingPath
 
The repeating path in case a Group appears multiple times
VisibleExpression
 
An Expression indicating at which conditions the Group is visible. If the Group is of type Expandable, it indicates the conditions at which the Group is expanded
Items
 
Contains Questions, Labels, Buttons and Groups
 
 

Expressions

Expressions consist out of one or more Conditions that are separated with an AND or an OR Operator (the LogOperator)
 
<VisibleExpression>
    <Conditions>
        <Condition>
            <LogOperator>AND</LogOperator>
            <Operator>NOT_EQUAL</Operator>
            <LeftOperand>
                <Value>OB_TYPE</Value>
                <Attributes/>
                <ElementPath>Batch/Relatiedocument/Contract/PP/OB</ElementPath>
                <ValueType>ELEMENTNAME</ValueType>
            </LeftOperand>
            <RightOperand>
                <Value/>
                <Attributes/>
                <ElementPath/>
                <ValueType>CONSTANT</ValueType>
            </RightOperand>
        </Condition>
    </Conditions>
    <StartValue>True</StartValue>
</VisibleExpression>
 
The LogOperator determines how the Conditions 's result values are connected to each other. One Condition can have only two result values, True and False. An empty Condition is always True. The starting value (StartValue) is part of the Expression.
 
So, we only have two Logical Operators:
 

AND

The following is applicable to the AND operator:
Current value
Condition's value
New value
True
True
True
True
False
False
False
True
False
False
False
False
 

OR

The following is applicable to the OR operator:
Current value
Condition's value
New value
True
True
True
True
False
True
False
True
True
False
False
False
 

Value type

Value type is an element of LeftOperand and RightOperand. This can have the following values:
 
Elementname
 
The Value field contains the name of an Element and ElementPath contains its path. The Value of this Element should be used to determine the result of the Condition.
Constant
 
The Value field contains a constant value that can be used to determine the result of the Condition directly.
 

Operators

Possible values:
EQUAL
 
If Left en Right operand are equal, the Condition will be True otherwise False.
LESS_EQUAL
 
If Left operand is smaller than the Right operand or equal to the Right operand, the Condition will be True otherwise False.
LESS
 
If Left operand is smaller than the Right operand, the Condition will be True otherwise False.
NOT_EQUAL
 
If Left en Right operand are NOT equal, the Condition will be True otherwise False.
GREATER_EQUAL
 
If Left operand is greater than the Right operand or equal to the Right operand, the Condition will be True otherwise False.
GREATER
 
If Left operand is greater than the Right operand, the Condition will be True otherwise False.
 

Button

The Button 's description is under construction. Please contact us (support@softrules.com) if needed.
 

Label

The Label 's description is under construction. Please contact us (support@softrules.com) if needed.
 

Request userinterface

To Request a Userinterface from a client application, see here.