0% found this document useful (0 votes)
64 views157 pages

Cortex Studio V6 User Guide

This document is the user guide for Cortex Studio V6. It provides an overview of Cortex Studio and its key concepts, including flows, blocks, variables, and orchestration of automated processes. It also guides the user on how to navigate the Cortex Studio environment and build new automation flows using various blocks, states, variables, and other elements.

Uploaded by

lakshmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views157 pages

Cortex Studio V6 User Guide

This document is the user guide for Cortex Studio V6. It provides an overview of Cortex Studio and its key concepts, including flows, blocks, variables, and orchestration of automated processes. It also guides the user on how to navigate the Cortex Studio environment and build new automation flows using various blocks, states, variables, and other elements.

Uploaded by

lakshmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 157

Cortex Studio V6

User Guide
Cortex Studio V6 User Guide

Cortex Limited
Keypoint
17-23 High Street
Slough
Berkshire
SL1 1DY
United Kingdom
T +44 (0) 1753 513 980
E [email protected]

Status: Release
Release Date: 23/03/2016
Author: Cortex Product Development
Document Version: 1.1
Software Version: Cortex Studio v6.0
All rights reserved. Passing on and copying of this
document, use and communication of its contents
are not permitted without written authorisation
from Cortex Limited.

Cortex Ltd © 2015 All Rights Reserved Page 1


Cortex Studio V6 User Guide

Cortex Studio V6 User Guide ............................................................... 1


Preface ......................................................................................... 5
About this User Guide ................................................................................. 5
Audience ................................................................................................. 5
Related Material ........................................................................................ 5
Abbreviations used in this Document ............................................................... 6
Revisions to this Document ........................................................................... 7
1 Introduction ............................................................................. 8
1.1 Automation ..................................................................................... 8
1.2 Orchestration ................................................................................... 8
1.3 Operational Intelligence ...................................................................... 8
1.4 Cortex ........................................................................................... 8
1.5 Business Process Model and Notation (BPMN) and Cortex .............................. 9
1.6 Cortex Gateway ................................................................................ 9
1.7 Cortex Studio ................................................................................... 9
1.8 LivePortal ....................................................................................... 9
1.9 Triggering a Flow Execution ................................................................ 10
2 Cortex Studio Concepts ..............................................................11
2.1 Concepts and Organisation of Flows ...................................................... 11
2.1.1 Groups ...................................................................................... 11
2.1.2 Flows ........................................................................................ 11
2.1.3 Subtasks .................................................................................... 12
2.1.4 States ....................................................................................... 12
2.1.5 Workspaces ................................................................................ 13
2.1.6 Blocks and Palettes ....................................................................... 14
2.1.7 Connections ................................................................................ 17
2.1.8 Variables ................................................................................... 17
2.1.9 Logical Expressions ....................................................................... 22
2.1.10 Regular Expressions (Regex) ............................................................ 22
2.1.11 Semaphores ................................................................................ 23
2.1.12 LivePortal .................................................................................. 23
3 Navigating the Cortex Studio Environment ........................................25
3.1 Accessing Cortex Studio ..................................................................... 25
3.2 Cortex Gateway User Interface Overview ................................................ 25
3.2.1 Menu Bar ................................................................................... 26
3.3 Cortex Studio User Interface Overview ................................................... 27
3.3.1 Navigation Bar ............................................................................. 27
3.3.2 Toolbox ..................................................................................... 29
3.3.3 Toolbox Icon Bar .......................................................................... 30
3.3.4 Toolbox Search ............................................................................ 31
3.4 Property Viewer............................................................................... 31
3.5 Main Display Area ............................................................................. 32
3.5.1 Main Display Area Toolbar (Edit Mode) ............................................... 32
3.5.2 Main Display Area Toolbar (Debug Mode) ............................................. 33
3.6 Workspace Window ........................................................................... 34
3.6.1 Workspace Window Toolbar ............................................................ 34
3.7 Execution Viewer ............................................................................. 35
3.7.1 Execution Viewer Toolbar ............................................................... 36

Cortex Ltd © 2015 All Rights Reserved Page 2


Cortex Studio V6 User Guide

3.8 Context Menus ................................................................................ 37


3.8.1 State Context Menu Options ............................................................ 37
3.8.2 Function Block Context Menu Options ................................................ 38
3.8.3 Workspace Context Menu Options ..................................................... 38
4 Building an Automation Flow ........................................................39
4.1 Introduction ................................................................................... 39
4.1.1 Overview of Creating a Flow............................................................ 39
4.1.2 Flows ........................................................................................ 39
4.1.3 Anatomy of a Flow ........................................................................ 40
4.2 Working with Blocks and Palettes ......................................................... 43
4.2.1 Displaying the Toolbox ................................................................... 43
4.2.2 Placing Blocks on a Workspace ......................................................... 43
4.2.3 Selecting Blocks on a Workspace ...................................................... 43
4.2.4 Moving Blocks on a Workspace ......................................................... 43
4.2.5 Duplicating Blocks ........................................................................ 44
4.2.6 Deleting Blocks ............................................................................ 44
4.2.7 Connecting Blocks Together ............................................................ 44
4.2.8 Deleting Connections .................................................................... 47
4.2.9 Block Configuration ...................................................................... 47
4.2.10 Property Configuration .................................................................. 47
4.2.11 Property Editor Dialog ................................................................... 50
4.2.12 Adding Notes............................................................................... 56
4.3 Creating a New Flow ......................................................................... 57
4.3.1 Creating an Organisational Hierarchy ................................................. 57
4.3.2 Creating a Flow ........................................................................... 58
4.3.3 Adding States to a Flow ................................................................. 58
4.3.4 Declaring Variables ....................................................................... 59
4.3.5 Initialising Variables ...................................................................... 59
4.4 Using Flow Blocks ............................................................................. 60
4.4.1 Basic Activity Blocks ..................................................................... 60
4.4.2 Decision Branching ....................................................................... 69
4.4.3 Semaphores ................................................................................ 72
4.4.4 Subtasks .................................................................................... 73
4.4.5 Wireless Blocks ............................................................................ 76
4.4.6 Accessing External Systems ............................................................. 77
4.4.7 Database Interaction ..................................................................... 79
4.4.8 Error Handling ............................................................................. 81
4.4.9 LivePortal and Human Interaction ..................................................... 85
4.4.10 Web-form User Interaction.............................................................. 90
4.4.11 Data Exchange between Cortex and LivePortal ..................................... 94
5 Testing and Debugging ............................................................. 113
5.1 Overview ..................................................................................... 113
5.1.1 I/O Errors................................................................................. 113
5.1.2 Logical Errors ............................................................................ 113
5.1.3 Semantic Errors ......................................................................... 113
5.2 Testing ........................................................................................ 113
5.2.1 Simulated 3rd Party Systems’ Interaction ........................................... 113
5.3 Debugging .................................................................................... 114
5.3.1 Observation of Flow Execution ....................................................... 114

Cortex Ltd © 2015 All Rights Reserved Page 3


Cortex Studio V6 User Guide

5.3.2 Tracking .................................................................................. 115


5.3.3 Breakpoints .............................................................................. 115
5.3.4 Flow Execution Actions after a Breakpoint ........................................ 118
6 Helpful Tips and Troubleshooting................................................. 120
6.1 Helpful Tips .................................................................................. 120
6.1.1 Developing a Flow ...................................................................... 120
6.2 Troubleshooting ............................................................................. 120
6.2.1 Testing and Executing a Flow ........................................................ 120
7 Appendices ........................................................................... 123
7.1 Appendix 1: Process Design Procedure ................................................. 123
7.1.1 Project Request ......................................................................... 123
7.1.2 Planning .................................................................................. 123
7.1.3 Develop the Automation Flow ........................................................ 124
7.1.4 Test ....................................................................................... 124
7.1.5 Release ................................................................................... 124
7.1.6 Continuous Improvement .............................................................. 124
7.2 Appendix 2: Variables and Variable Types ............................................. 125
7.2.1 Simple Variables ........................................................................ 125
7.2.2 Composite Variables ................................................................... 127
7.2.3 Multi-Type Variables ................................................................... 129
7.3 Appendix 3: Expressions Detail ........................................................... 132
7.3.1 Logical Expressions ..................................................................... 132
7.4 Appendix 4: Regex Detail ................................................................. 134
7.4.1 Regular Expressions (Regex) .......................................................... 134
7.5 Appendix 6: Built-in Functions ........................................................... 139
7.6 Appendix 7: Using HTML within LivePortal ............................................. 141
7.6.1 Placement of LivePortal Controls .................................................... 141
7.6.2 Using Inline HTML Tags in LivePortal Controls ..................................... 145
7.6.3 Using Cascaded Style Sheets .......................................................... 148
8 Index .................................................................................. 151

Cortex Ltd © 2015 All Rights Reserved Page 4


Cortex Studio V6 User Guide

Preface

About this User Guide


This User Guide explains the concepts and operation of Cortex Studio. In order to
successfully encapsulate a business process into an operational flow suitable for use in a
production environment, the business process needs to be analysed, interpreted and
captured within Cortex Studio’s graphical composition tool. These actions require
knowledge and skills that are outside the scope of this User Guide, which solely focusses on
the use and operation of Cortex Studio and is neither a substitute for Business Process
Analyst training nor is it a manual addressing the concepts surrounding algorithm design.
This guide is organised into the following main sections:
 Section 1 - Introduction
This section introduces concepts of automation and orchestration and describes
the role of Cortex Studio.
 Section 2 – Cortex Studio Concepts
This section introduces some of the terms and concepts used within Cortex
Studio, which are essential to understanding its operation and creating an
automated business process.
 Section 3 – Navigating the Cortex Studio Environment
This section describes the basic user interface and how to access different
aspects of the Cortex Studio environment.
 Section 4 – Building an Automation Flow
The section provides a detailed description of the steps required to build an
automation flow and looks at some of the tools and functions of the component
elements.
 Section 5 – Testing and Debugging
The section describes how to test the flow that has been developed and
examines some of the tools provided with Cortex Studio to debug problems that
may be encountered with the automated flow.
 Section 6 – Helpful Tips and Troubleshooting
This section highlights some helpful tips to avoid potential problems and some
troubleshooting techniques should problems occur.
 Section 7 – Appendices
These appendices provide additional information to support some of the
concepts and tools used within Cortex Studio.

Audience
The intended audience is primarily those responsible for designing or implementing business
automation processes. This User Guide assumes a working knowledge of flow diagrams.

Related Material
For further information, please also consult the following documents:
 Cortex Block Reference Guide – HTML and PDF versions of this guide are normally
located in the C:\Cortex\Help folder on the Cortex server and may also be
duplicated in other locations by the system administrator. This information is
also available through Cortex Studio’s ‘Help’ menu item.
 Cortex Administration Guide

Cortex Ltd © 2015 All Rights Reserved Page 5


Cortex Studio V6 User Guide

Abbreviations used in this Document


BPD - Business Process Diagram
BPMN - Business Process Model and Notation
CSS - Cascading Style Sheet
DNS - Domain Name Server
FTP - File Transfer Protocol
HTML - Hyper-Text Mark-up Language
GUI - Graphical User Interface
I/O - Input/Output
IP - Internet Protocol
MDI - Multi-Document Interface
OCI - Orchestration Communication Interface
PC - Personal Computer
REST - REpresentational State Transfer
SDK - Software Development Kit
SNMP – Simple Network Management Protocol
SQL - Structured Query Language
Syslog - System Log
TCP - Transmission Control Protocol
WMI - Windows Management Instrumentation
WYSIWYG - What You See Is What You Get

Cortex Ltd © 2015 All Rights Reserved Page 6


Cortex Studio V6 User Guide

Revisions to this Document


The following revisions have been made to this document

Date Author Revision Notes

1/10/2015 D. Vant 0.1 First Draft

20/11/2015 D. Vant 0.2 Completed First Draft

02/12/2015 J. de Wet 0.3 First Cortex Review

04/12/2015 D. Vant 0.4 Amendments After First Cortex Review

11/12/2015 J. de Wet 0.5 Second Cortex Review


Amendments After Second Cortex
14/12/2015 D. Vant 0.6
Review
16/12/2015 J. de Wet 1.0 First Release version

23/03/2016 D. Vant 1.01 Updates to reflect changes in UI

08/04/2016 J. de Wet 1.1 Updated Release 1.1

Cortex Ltd © 2015 All Rights Reserved Page 7


Cortex Studio V6 User Guide

1 Introduction
In today’s economic climate, businesses need to be more competitive and agile than ever
before, just to survive; to flourish, businesses also need to deliver a healthy return on
shareholder investment at an acceptable level of risk. This means that businesses need to
reduce their time to market and become ever more efficient, delivering greater
productivity for less cost, whilst controlling and minimising business risk.
To achieve this, business processes must be easily adaptable and executed faster with
greater precision to reduce risk. What is required is flexible, business process automation
that coordinates (or orchestrates) the interworking of different, and often diverse, business
and technology applications; this process is known as Orchestration and Automation.

1.1 Automation
Automation is the use of control systems and information technologies to reduce the need
for human work in the production of goods and services.
Not all processes can be automated, and in some instances it is not desirable to automate
certain processes. However, many processes that are repetitive, are complex, or require
human intervention to undertake well-defined tasks, can be automated, achieving business
benefits, such as:
 Increasing productivity by decreasing the time to complete a process
 Reducing risk of error
 Reducing cost of human intervention
 Improving uniformity of service

1.2 Orchestration
Orchestration is the automated control and coordination of various, often disparate,
systems (and possibly people) to undertake the correct activities at the right time to
achieve an automated end-to-end process.

1.3 Operational Intelligence


Operational Intelligence is a form of real-time dynamic, business analytics, using streaming
data feeds and event data that deliver visibility and insight into business operations. This
enables organisations to be more agile to make decisions and immediately act on these
analytic insights, through manual or automated actions.

1.4 Cortex
Cortex is a powerful software platform that delivers business process automation to
increase business agility and efficiency. It contains three logical elements: Business Rules,
Process Automation, and Operational Intelligence.
Business process flow diagrams may be entered directly into Cortex Studio, which provides
for the visualisation of the process flow, without having to use specialised programmers to
write complex scripts. Cortex Studio is also equipped with predefined ‘interfaces’ enabling
the easy communication to a vast array of external third-party systems in use in businesses
today. If a business uses legacy or custom systems, these can easily be accommodated by
implementing new ‘interfaces’.

Cortex Ltd © 2015 All Rights Reserved Page 8


Cortex Studio V6 User Guide

1.5 Business Process Model and Notation (BPMN) and Cortex


Business Process Model and Notation (BPMN) is a standardised tool for business process
modelling, providing a graphical notation for specifying business processes in a Business
Process Diagram (BPD), based on a flowcharting technique. The primary goal of BPMN is to
provide a standard notation readily understandable by all business stakeholders to provide:
 Process visualisation - Presenting a business process in graphical form.
 Documentation - Describing business activities in detail and specifying process-
specific properties.
 Communication - Providing a set of notations that is simple enough for any
individual to read and understand the business process.
Cortex Studio is very similar in concept to BPMN and achieves the same goals. However,
although Cortex Studio uses much of the same notation as BPMN, Cortex Studio provides
much richer functionality and greater flexibility than BPMN to address the ever evolving
needs of businesses and is therefore not directly translatable.

1.6 Cortex Gateway


Cortex Gateway is a web portal that provides users with navigational access to different
functional areas within the Cortex solution. The options available in the Cortex Gateway
Menu Bar are dependent on the user’s authorisation rights and can range from Cortex
Studio access to compose workflows, to Dashboards, Reporting and Administrative
functions.

1.7 Cortex Studio


Cortex Studio is accessed from the Cortex Gateway Menu Bar, and provides a graphical,
drag-drop-connect-configure environment. This is used to create and edit ‘flows’ that
define the actions, decisions and interactions within an automated business process or
business rule. This environment enables the easy visualisation of the flow, and decouples
the business process flow from the underlying technical processes that occur when the flow
is executed.
Cortex Studio requires no programming or scripting skills, making the process flow
definition accessible to those who are not familiar with computer programming languages.
An analogy with which most people are familiar is constructing flow diagrams in Microsoft
Visio or similar tools.
The visual flow diagram within Cortex Studio defines the steps that describe the process or
business rule, and the flow execution engine follows the flow diagram connections and
executes the activity for each function block individually.
The flow diagram is not compiled into a script or programming language for runtime
execution, but is executed in its graphical form once deployed to Cortex Server.

1.8 LivePortal
LivePortal is a separate web-server component within the Cortex system that allows for
easy end-user interaction with Cortex. Using LivePortal, users can view the service
catalogue available to them, initiate flows (service requests) and interact with the flow.
LivePortal is an integral part of Cortex, enabling flow developers to configure the end-user
interaction whilst requiring little or no knowledge about web technologies.

Cortex Ltd © 2015 All Rights Reserved Page 9


Cortex Studio V6 User Guide

1.9 Triggering a Flow Execution


A new execution of a flow can be triggered in one of the following ways:
 Event triggered: Cortex receives and processes events from many different
types of devices, systems and applications using protocols, including: SNMP,
Syslog, TCP sockets, file parsing, etc. The treatment for any of these events
could include the execution of a predefined flow.
 Scheduled: Cortex contains a powerful scheduler enabling both simple and
complex schedules to be created to automatically trigger the execution of a flow
at any point in time.
 Cortex API: Cortex flows can be triggered and controlled by external systems
via a generic REST web services interface named the ‘Flow API’.
 User driven: The Cortex LivePortal enables users to trigger flow executions and
handles any interaction that the Flow requires with the end user. Reporting
back to the user may be achieved using LivePortal, e-mail or other means of
reporting.
 From another flow: A flow can be designed to trigger another flow at any point.
The triggered flow can run asynchronously, i.e., independently and
simultaneously as the triggering flow, or synchronously (also known as a
‘blocking call’), i.e., the triggering flow waits for the triggered flow to complete
before continuing. The triggered flow can be passed any necessary parameters
from the triggering flow; if called synchronously, values can be also passed back
to the triggering flow from the triggered flow.
 Internal (Development Purposes): The flow developer can trigger a flow
directly from within the Cortex Studio during the flow development and testing
phases.

Cortex Ltd © 2015 All Rights Reserved Page 10


Cortex Studio V6 User Guide

2 Cortex Studio Concepts

2.1 Concepts and Organisation of Flows


Cortex can simultaneously accommodate many different Flows, organised in a hierarchical
structure of groups; Figure 1 shows an example of such a hierarchical organisation.

CORTEX

SubtaskA Flow1
SubtaskB Flow2 MyGroup AnotherGroup Group ...
... Flow3
...

ExampleFlow Subtask12 FlowABC


AnotherFlow MySubGroup ... FlowDEF
...

MySubtask1 MyFirstFlow
MySecondFlow MySubSubGroup

Figure 1 – Hierarchical Organisation of Flows

In the hierarchical illustration above, a top-level container ‘CORTEX’, contains a number of


Subtasks (‘SubtaskA’,’ SubtaskB’, etc.), a number of ‘Flows’ (‘Flow1’,’ Flow2’, ‘Flow3’,
etc.), and a number of child Group objects (‘MyGroup’, ‘AnotherGroup’, etc.).
In turn, the Group ‘MyGroup’ contains Flows (‘ExampleFlow’ and ‘AnotherFlow’) and a child
Group (‘MySubGroup’).

2.1.1 Groups
Groups are hierarchical organisational containers that contain related Groups, Flows or
Subtasks. Group containers may contain any number of Flows, Subtasks or other Group
containers.
The hierarchical grouping of Flows in the group hierarchy is replicated within LivePortal.

2.1.2 Flows
A Flow is an object that contains all the logic and other entities that define a process; it
can exist within a nested hierarchical Group structure; Figure 2 shows an example of Flows
as viewed in Cortex Studio.

Cortex Ltd © 2015 All Rights Reserved Page 11


Cortex Studio V6 User Guide

Figure 2 – Hierarchical Display of Flows in Cortex Studio

Each Flow contains:


 One or more States that represent the high-level stages of the Flow.
 A Global Variables Store that holds the global variables declarations for this
Flow.
 A Default Error Handler that is executed whenever an unhandled error is
encountered in the Flow.
 A Default UI Configuration object, used to define the default screen to be
shown on the LivePortal user interface when the flow is executing.

Default Error Handler


State Global Variables Store
Default UI Configuration

Figure 3 – Contents of a Flow’s Top-Level Workspace

2.1.3 Subtasks
Subtasks are re-useable sub-processes that contain logic and other entities that can be
executed at several different points in a Flow, or used within multiple different Flows.
Subtasks can only be used within Flows and cannot be run directly within Cortex Studio, nor
are they visible within LivePortal.
 Note: A Subtask is a ‘Global’ object, which means any Subtask can be made
available to any Flow. The hierarchical grouping of Subtasks within Cortex Studio is
to depict a logical relationship with its associated tasks; its actual location within
the hierarchy does not influence which Flows may make use of it.

2.1.4 States
A State is a high-level step in the Flow; it acts as a container for the detailed logic and
associated objects necessary to perform the functions that form part of that step.
Each State has its own workspace, which contains a local Variables Store, holding the
variable declarations for the variables to be used within that State, and the logic required
to implement that part of the overall Flow, including any specific error handling logic.
 Note: The Default Error Handler in the top-level Flow workspace is identical to any
flow State in that it has its own workspace containing a Variables Store and the

Cortex Ltd © 2015 All Rights Reserved Page 12


Cortex Studio V6 User Guide

necessary logic required to handle errors, including the ability to define its own
Local Error Handler to handle any errors that occur in the Default Error Handler.

Local Variable Container


Function Blocks
(Detailed logic)

Figure 4 – Example Contents of a State

2.1.5 Workspaces
A workspace is a ‘canvas’ onto which blocks are placed in order to build the logic of a Flow.
Workspaces ‘belong’ to an object, such as a State, and can be accessed by double-clicking
the object.
 Note: Any object that has an icon with a ‘page turn’ indicator (the top right corner
of the icon peeling over) has a workspace that can be accessed by double-clicking
the object.
 Note: Some objects that have a ‘page turn’ indicator, such as the ‘Execute
Subtask’ function block, act as a ‘link’ to the actual Subtask definition. Double-
clicking on the ‘Execute Subtask’ function block opens the workspace associated
with the corresponding Subtask object.

‘Page Turn’
Indicator

Figure 5 – Object with ‘Page Turn’ Indicator

To aid navigation and visibility, it is possible to zoom-in or zoom-out of the workspace using
the magnifying glass icon on the workspace title bar or <Ctrl-mouse-wheel>. If the
workspace exceeds the window or tab size, scroll bars at the top and/or bottom of the
workspace window enable easy navigation throughout the workspace; see Section 3.2.
To enable orderly placement of blocks onto the workspace, objects are forced to snap to a
hidden grid.
Figure 6 shows an example of the hierarchy of workspaces that may be found in a typical
Flow.

Cortex Ltd © 2015 All Rights Reserved Page 13


Cortex Studio V6 User Guide

Top-Level Workspace

State Workspace

State Workspace
Figure 6 – Workspaces within a Flow

2.1.6 Blocks and Palettes


Function Blocks (generally referred to as simply ‘blocks’) define the logic and activities
performed when executing a Flow. Flows are created using blocks that have been created
to perform a specific function. Blocks are drawn from palettes, an organisational container
that contains groups of blocks with related functions.
Blocks are placed onto a workspace and connected to other blocks using directional
connections to create a logical sequence of activities, represented by the block functions.
Function blocks are divided into two main categories:
 Activity blocks
These blocks undertake an activity, e.g., extract a column of values from a
data-table, write a data-table to a file, etc. Activity blocks can be further sub-
divided into:
 Internal Activity blocks, evaluated internally within Cortex.
 External Interaction Activity blocks that interact with a component or
system external to Cortex.
An activity block has only one output connection point to connect to the next
block in the Flow for normal execution, and an additional error-handling
connection point on the right edge of the block.
 Flow Control blocks
These blocks determine which function blocks are executed next, e.g., the Flow
is forced to follow a particular branch dependent on a logical condition.
Flow control blocks typically have more than one output connection point but
only one of the outputs is followed during a single execution of the block. The
decision on which output gets used is based on the configuration of the block
and the current state of the environment at the time.

Cortex Ltd © 2015 All Rights Reserved Page 14


Cortex Studio V6 User Guide

2.1.6.1 Block Appearance


The appearance of each block reflects the purpose of the block to aid visualisation of the
flow. All activity blocks are rectangular in shape, whereas flow control blocks usually have
a diamond shape.
Each block has an icon that visually represents the function that the block performs; for
example, the ‘Arithmetic Operation’ activity block has an icon of a calculator, whereas the
‘True/False Expression Evaluator’ flow control block has an icon depicting ‘f(x)’, the
mathematical representation of a function of variable ‘x’. Figure 7 shows an example of an
activity block, a flow control block and an External Interaction Block.
 Note: Many of the External Interaction Activity blocks are identified by a logo
representing the type of system with which they interact, located in the top left
corner of the block.

“Arithmetic Operation” “True/False Expression Evaluator” “WMI Start Service”


Activity Block Flow Control Block External Interaction Activity Block

Figure 7 – Examples of Activity and Flow Control Function Blocks

2.1.6.2 Anatomy of a Block


Each function block consists of a background with a ‘Subject’ icon that represents the core
topic of the block. Many of the function blocks show additional sub-icons that provide
further visual information identifying the block’s function.
Figure 8 shows two examples of function blocks that highlight the additional visual
information available.
 The ‘Canvas Background’ indicates the type of object. Function blocks always
have a light, blue-grey canvas background.
 The ‘Subject’ image represents the core topic that the function block addresses.
The example shows an ‘Execute Subtask’ function block, with the subject image
depicting interaction to and from another group of logic.
 The ‘Page Turn’ image (optional), located at the top right, indicates that the
function block has a workspace or linked workspace; the workspace may be
accessed by double-clicking on the function block. The example shows an
‘Execute Subtask’ function block, which is linked to the corresponding ‘Subtask’.
 The circular ‘Action’ icon (optional), located at the bottom right, indicates what
action is being undertaken. The example shows a ‘Set Service Mode’ function
block, drawn from the WMI Blocks palette, with an icon of a pencil writing,
indicating that this block writes some data, in this case the service mode.
 The ‘Secondary Subject/Action’ icon (optional), located at the top right,
expands on the meaning on the Subject or Action of the block. The example
shows a ‘Set Service Mode’ function block with traffic lights, expanding on the
set service mode of stop, run, etc.
 The ‘3rd Party System’ icon (optional) is often present on External Interaction
Activity blocks to indicate the specific type of 3rd party system with which this
block interfaces. The example on the right of Figure 8 shows a ‘Set Service
Mode’ function block with the Microsoft Windows WMI icon.

Cortex Ltd © 2015 All Rights Reserved Page 15


Cortex Studio V6 User Guide

‘Page Turn’ Image 3rd Party Secondary Subject/


(Optional) System Icon Action Icon
(Optional) (Optional)

Canvas Subject Image Action Icon


Background

‘Execute Subtask’ ‘WMI Set Service Mode’


Function Block Function Block

Figure 8 – Anatomy of Function Blocks

2.1.6.3 Configuration
Each block performs a specific function and has properties that can be configured, using
the Property Viewer, to specify the function’s details. See Section 4.2.9 for more
information about block configuration.

2.1.6.4 Palettes
Palettes are containers that hold template function blocks, similar to the stencils provided
in Visio. Each palette contains a number of function blocks that perform related functions;
for example, Figure 9 shows the function blocks contained within the Database Blocks
Palette.

Figure 9 – Database Blocks Palette

Variable Manipulation Palettes


 Variable Definitions palette: containing definition blocks for each variable type,
enabling variables to be declared, assigned an initial value and to be made
static.
 Variable Blocks palette: containing function blocks to set, test, delete and
manipulate simple variables.
 Text Manipulation palette: containing function blocks to match text patterns,
extract text, and test and manipulate Text variables.
 Date and Time palette: containing function blocks to manipulate Date & Time
variables, calculate time periods and convert between Date & Time variables
and other types of variable.
 List Blocks palette: containing function blocks to create, set, delete and
manipulate List variables.
 Structure Blocks palette: containing function blocks to create a Structure and
add, retrieve, delete or modify fields within a Structure variable.
 Table Blocks palette: containing function blocks to create, copy, delete, query
and manipulate Table variables.

Cortex Ltd © 2015 All Rights Reserved Page 16


Cortex Studio V6 User Guide

Decision Making Palettes


 Branching Blocks palette: containing function blocks to make decisions, test and
set semaphores, and implement loops.
 Error Handling palette: containing function blocks to handle errors that occur at
the block level or at the State level, and includes a block that is used to force an
error condition.
Flow Structure & Miscellaneous Palettes
 Flows and States palette: containing function blocks to create Flows, States,
Subtasks and other functions relating to Flows and States.
 Miscellaneous palette: containing a number of general or miscellaneous blocks
that cannot be conveniently grouped in other palettes.
User Interaction Palettes
 LivePortal Blocks palette: containing function blocks to implement interaction
with an end user accessing the Cortex platform using the LivePortal web user
interface.
 LivePortal Controls palette: containing function blocks that provide HTML
controls for user interaction within LivePortal.
External Interaction Palettes
 Active Directory Blocks palette: provides interaction with Microsoft Active
Directory.
 Database Blocks palette: provides interaction with a range of SQL and other
types of databases.
 Disk and File Blocks palette: provides the ability to create and delete folders,
and create, write and delete files.
 FTP Blocks palette: provides the ability to open and close FTP connections, and
read and write files using FTP.
 Networking Blocks palette: provides the ability to perform ping, trace route
(tracert) and name server lookup (nslookup) commands, as well as writing,
reading and querying DNS.
 Service Blocks palette: provides function blocks to start, stop, restart and get
the status of services of the underlying operating system.
 Telnet Blocks palette: provides function blocks to connect, disconnect and issue
telnet commands to an external machine.
 Operating System Blocks palette: enables interaction with the underlying
operating system, including the ability to send emails.
 WMI Blocks palette: enables interaction with Windows WMI.

2.1.7 Connections
Each block has a single, input connection point, and one or more output connection points.
Using the mouse, the blocks can be connected together to create a logical flow. See
Section 0 for more information about connecting blocks together.

2.1.8 Variables
Variables are named containers that hold data; this data may be changed in the execution
of a Flow, i.e. it can vary. For example, if manipulating information about a person, a
variable could be created to hold a numeric value representing a person’s age. The
variable would be named appropriately, for example, ‘Age’, and its contents can be
manipulated or evaluated by referring to the Variable’s name.

Cortex Ltd © 2015 All Rights Reserved Page 17


Cortex Studio V6 User Guide

Before a flow can use a Variable, it must be created or ‘declared’; before a flow can make
a decision based on the contents of a Variable, or use a Variable as an input to a
calculation, the Variable must be assigned a value. Values can be assigned to Variables at
the time of declaration or during the execution of a flow, or passed to Variables when the
flow is started.

2.1.8.1 Types of Variables


Data can exist in many different forms, from simple integer numbers to strings of text or
even a data-table extracted from a database. Different types of Variables can be created
to hold these differing types of information:
Simple Variable
 Text: A Text Variable holds strings of characters or text. For example, a Text
Variable could be used to hold a person’s name, e.g. ‘John’. Figure 10 shows a
Text Variable definition block, entitled ‘person_name’, which is used to declare
the Text Variable and optionally assign it an initialisation value.

Figure 10 – Text Type Variable Definition Block

 Integer: An Integer Variable holds a whole number. For example, an Integer


Variable could be used to hold a person’s age, e.g. ‘23’. Figure 11 shows an
Integer Variable definition block, entitled ‘person_age’, which is used to declare
the Integer Variable and optionally assign it an initialisation value.

Figure 11 – Integer Type Variable Definition Block

 Float: A Float Variable holds a decimal number, or a very large or very small
number. For example, a Float Variable would be used to hold a person’s bank
balance, e.g. 10,123.49, or it could be used to hold a very large number, such as
the mass of a star in kg, e.g. 1.989 x 1030, which can also be written in scientific
notation as ‘1.989E30’. Figure 12 shows a Float Variable definition block,
entitled ‘bank_balance’, which is used to declare the Float Variable and
optionally assign it an initialisation value.

Figure 12 – Float Type Variable Definition Block

 Boolean: A Boolean Variable holds a logical value of either ‘True’ or ‘False’. For
example, a Boolean Variable could be used to hold a person’s employment
status, e.g. ‘True’. Figure 13 shows a Boolean Variable definition block, entitled
‘employment_status’, which is used to declare the Boolean Variable and
optionally assign it an initialisation value.

Figure 13 – Boolean Type Variable Definition Block

 DateTime: A DateTime Variable holds a single date and time value. For
example, a DateTime Variable could be used to hold an employee’s start date,
e.g. 1st January 2012. Figure 14 shows a DateTime Variable definition block,
entitled ‘start_date’, which is used to declare the DateTime Variable and
optionally assign it an initialisation value.

Cortex Ltd © 2015 All Rights Reserved Page 18


Cortex Studio V6 User Guide

Figure 14 – DateTime Type Variable Definition Block

 Timespan: A Timespan Variable holds a value that corresponds to a period of


time. For example, a Timespan Variable could be used to hold an employee’s
employment duration, e.g. 2 years, 51 days. Figure 15 shows a Timespan
Variable definition block, entitled ‘employment_duration’, which is used to
declare the Timespan Variable and optionally assign it an initialisation value.

Figure 15 – Timespan Type Variable Definition Block

 Object: An Object Variable can hold an instance of an underlying Cortex server


object; this variable type is for ‘advanced use’ only. Figure 16 shows an Object
Variable definition block, entitled ‘server_object’, which is used to declare the
Object Variable.

Figure 16 – Object Type Variable Definition Block

For more detailed information about Simple Variables, see Appendix 7.2.1.
Composite Variables
List: A List Variable holds a collection of values, which can be of different types
and can include other composite types. Each value in a List variable is called an
Element, and is referenced by its position in the List, known as an ‘index’. For
example, a List variable could be used to hold the examination scores obtained
by an individual for each question, e.g. ‘9, 9, 8, 10 …’. The score of the first
exam would be referenced as the first element (index=0), the second exam as
the second element (index=1), etc. Figure 17 shows a List Variable definition
block, entitled ‘exam_scores’, which is used to declare the List Variable and
optionally assign it an initialisation value.
A specific syntax using ‘[ ]’ (double square-brackets), i.e., ($)exam_scores[1], is
used to directly access a specific list member for use in expressions, see
Appendix 7.2.2.1 for more details.

Figure 17 – List Type Variable Definition Block

 Structure: A Structure variable is similar to a List variable in that it holds a


collection of variables, but instead of each element being referenced by its
position (index), the elements in a Structure variable are referenced by name.
For example, a Structure variable could be used to hold the personal details of
an employee, e.g. ‘EmployeeName’ (Text), ‘Age’ (Integer), ‘Address’ (List of
Text variables),…’.
Figure 18 shows a Structure Variable definition block, entitled
‘personal_details’, which is used to declare the Structure Variable and
optionally assign it an initialisation value.
A specific syntax using ‘.’, i.e., ($)personal_details.Age is used to directly access
a specific structure member for use in expressions, see Appendix 7.2.2.2 for
more details.

Cortex Ltd © 2015 All Rights Reserved Page 19


Cortex Studio V6 User Guide

Figure 18 – Structure Type Variable Definition Block

 Table: A Table variable is similar to a spreadsheet and organises data into a


well-defined set of rows and columns. Columns are named and each column is
defined to accept a specific data type, e.g. a column named ‘UID’ and defined
to hold Integer values, or a column named ‘First Name’ and defined to hold Text
values. A row (also known as a ‘record’) is the associated group of values for
the different columns at the same position (or index). Each value contained in a
record is known as a field and corresponds to a specific column; therefore the
field name will reflect the column name.

Column Name UID First Name Last Name Date of Birth Average Score Member
Column Data Type Integer Text Text DateTime Float Boolean

1 Andrew Jones 21/6/1996 7.73 False


2 Bob Smith 10/5/1992 3.99 False
3 Charles Archer 2/8/1997 8.01 True
Row (Record) 4 Mary Gerrard 5/9/1992 7.75 False
5 Andrea Williams 25/1/1989 7.73 False
6 David Smith 7/10/1994 8.22 False
7 Chris Johns 27/12/1998 6.12 True
8 John Stevens 28/2/1990 4.05 False

Column
Figure 19 – Visual Representation of a Table Variable (with example data)

A Table generally has a fixed number of columns to describe a dataset, but rows
(records) can be added and removed as size of the dataset changes. For
example, a Table, designed to keep the data for all employees, has columns for
‘firstname’, ‘surname’, ‘age’ and ‘job title’. As a person joins the company, a
new record for that person will be added to the Table; when a person leaves the
company, the corresponding record will be removed from the Table.
Figure 20 shows a Table Variable definition block, entitled ‘all_employees’,
which is used to declare the Table Variable.

Figure 20 – Table Type Variable Definition Block

For more detailed information about Composite Variables, see Appendix 7.2.2.
Multi-type Variables
Multi-type Variables can accommodate values of multiple, different types and can be
viewed as generic data containers. Multi-type Variables should be used sparingly as it is
easy to inadvertently cause run-time errors that might not be identified during the testing
phase. However, there are situations where Multi-type Variables are really useful, for
example to receive a value of a type that is not known in advance from an external system.
The Multi-type Variable types available in Cortex are:
 Quantity: A Quantity Variable can hold either an integer value (see Integer
Variable) or a floating point value (see Float Variable). Figure 21 shows a
Quantity Variable definition block, entitled ‘quantity_var’, which is used to
declare the Quantity Variable and optionally assign it an initialisation value.

Figure 21 – Quantity Type Variable Definition Block

Cortex Ltd © 2015 All Rights Reserved Page 20


Cortex Studio V6 User Guide

 Value: A Value Variable can hold any of the simple or complex variable types,
except for an Object variable; i.e. Integer, Float, Text, Boolean, List, Structure,
DateTime or Timespan. Figure 22 shows a Value Variable definition block,
entitled ‘value_var’, which is used to declare the Value Variable and optionally
assign it an initialisation value.

Figure 22 – Value Type Variable Definition Block

 Any: An Any Variable can hold any information type, including data relating to
an Object Variable. Figure 23 shows an Any Variable definition block, entitled
‘any_status’, which is used to declare the Any Variable and optionally assign it
an initialisation value.

Figure 23 – Any Type Variable Definition Block

For more detailed information on Multi-type Variables, see Appendix 7.2.3.

2.1.8.2 Declaring Variables


All variables must be declared (defined as a specific type and assigned a name) before they
can be used; this is done by placing a variable on a Variables Store workspace. Declaring a
variable does not assign a value to the variable, it simply creates the variable so that it is
available for use; however, many types of variable may be initialised with a value at the
time of declaration (by setting the Set initial value property to True), or within the Flow
execution by using the ‘Set Variable’ function block (for Simple variables) or the ‘Create
<variable>’ function blocks (for Composite variables).
See Section 4.3.4 for information on how to declare variables.

2.1.8.3 Scope of Variables


A variable only exists within a certain area of a Flow; this area is called the ‘Scope’ of the
variable.
A variable that is declared at the Flow level (top-level workspace of a Flow), has the scope
of the entire Flow, i.e. it is valid anywhere within the Flow.
A Variable that is declared at a lower workspace level has the scope of only the workspace
in which it was declared and any of that workspace’s sub-workspaces; it would not be valid
in any other State workspaces. Any variables declared within a workspace are destroyed
when Flow execution leaves the workspace in which they were declared and moves to a
superior-workspace, and cannot be referenced later on.
Variables with identical names that are declared in different ‘peer’ level workspaces, e.g.,
different States, are completely independent of each other.
 Note: A variable declared at the workspace level should not have an identical name
to a variable declared in a sub-workspace.

2.1.8.4 Lifetime of a Variable


In general, the values of variables are linked to a specific execution instance of a Flow;
simultaneous executions of the same Flow will have multiple instances of the same
variable, each independent of each other and capable of having differing values.
All the variables (except for Static variables) associated with an instance of a Flow are
destroyed when the Flow terminates; in addition, all non-static, local variables are
destroyed when the Flow moves to a superior-workspace.

Cortex Ltd © 2015 All Rights Reserved Page 21


Cortex Studio V6 User Guide

If it is necessary to persist the value of any variable from one Flow execution to another,
either the variable has to be made ‘Static’, or the Flow has to write the values to some
persistent media or system (e.g., file, database, or other system).

2.1.8.5 Static Variables


A Static variable is not destroyed after the execution of a Flow; both the variable and its
value will persist from one execution of the Flow to the next, regardless of how the Flow
was triggered or by whom. For example, a Static Integer variable could be incremented
every time a specific Flow is executed to keep a tally of the total number of times the Flow
has been used.
Any variable can be made Static at the time of its declaration. For further information on
making a variable Static, see Section 4.3.4.

2.1.8.6 Initialising Variables


When a variable is declared, it is also possible to initialise or assign a value to the variable
at the same time; assigning a value to a variable at the time of declaration is optional.
 Note: It is currently not possible to initialise a Table variable when it is declared.
To create and populate a Table variable, use the ‘Create Table’ function block and
populate it using function blocks from the Table Block palette, or use the ‘Query
DB’ block to create and populate it with information from an external database.
For more information of variables and initialising variables, see Section 4.3.5.

2.1.9 Logical Expressions


A logical expression is an assertion, expressed as a mathematical equation; either the
assertion is ‘true’ or the assertion is ‘false’; for example, the assertion 1 + 2 = 1 is false.
Using variables in the expression enables simple true/false decisions to be made dependent
on the values of the variables at the time of Flow execution.
For example, if the variable ‘temperature’ was constantly updated with the current indoor
temperature, then the logical expression {{temperature}} <= 20 could be used to turn on
the central heating should the temperature drop to 20 degrees or below (the ‘ <=’ symbol
meaning ‘less than or equal to’).
 Note: The use of double-braces ‘{{ }}’ around a variable name, casts the variable as
a text. For further information on entering expressions into blocks, see Section
4.2.9; and for further information about casting and automatic conversion, see
Appendix 7.2.
A logical expression can consist of variables or functions of the types: Boolean, Integer,
Float, Quantity or Text. For more information on logical expressions, see Section 7.3.1.

2.1.10 Regular Expressions (Regex)


A Regular Expression (Regex) provides a concise and flexible mechanism to match or
identify specific characters or patterns of characters contained within some source text.
It can be used as a powerful tool for parsing text messages from external systems to
determine how the Flow should be executed, e.g. take a particular course of action on
receipt of a particular text-based error message. To facilitate this, Cortex Studio provides
a range of flow control blocks that alter the direction of flow execution based on Regex
finding a pattern match in the source text or not.
Regex can also be used to extract matching character strings from the source text and
place them in a Text variable for subsequent processing and use in the Flow, e.g. to
automatically compose the body text of an email based on text received from different
external systems.
For more information on Regex, see Section 7.4.1.

Cortex Ltd © 2015 All Rights Reserved Page 22


Cortex Studio V6 User Guide

2.1.11 Semaphores
A Flow in Cortex can be simultaneously triggered and executed multiple times (a concept
called parallel execution). Each execution will follow its own path through the Flow based
on:
 The initial values passed into the execution
 The current values of data in external systems or database
 The current state of infrastructure and the environment
 The time of day
A similar concept is that of many cars simultaneously travelling on a town's road network,
each taking its own route depending on where it wanted to go in the first place, traffic
volumes, etc.
Sometimes it is necessary to restrict the number of cars on a section of the road, e.g. due
to a weak bridge. In that case some mechanism, e.g., a traffic light, is used to only allow a
certain number of cars onto that section of the road, forcing the others to either wait or
take a different route.
The same scenario can occur for multiple parallel Flow executions. For example, if an
external system can only support a maximum of 3 concurrent connections, any section of a
Flow that uses that system should be controlled to only allow 3 executions inside that
section, and other executions should wait their turn or branch away.
In Cortex this is achieved using a Semaphore, which is a special counter used to restrict
access to an area of a Flow to a configurable maximum number of simultaneous executions.
Before entering a protected area, each Flow execution checks the value of the associated
semaphore. If the semaphore is at the configured maximum, the flow execution is
prevented from entering the protected area and either has to wait or branch (depending on
the type of semaphore block used); if the Semaphore is not at its maximum the Flow
execution is allowed to enter the protected area, and the semaphore counter is increased.
As soon as an execution leaves the protected section of the flow the semaphore counter is
decreased, allowing the next flow in line to enter.

2.1.12 LivePortal
LivePortal is a component of Cortex that provides a web-based interface for user
interaction. Using a standard web browser, a user can:
 Trigger the execution of a Flow
 Observe real-time status information on the progress of the Flow execution
 Interact with a Flow execution using web-forms

2.1.12.1 Service Request Catalogue


Flows created in Cortex Studio can be exported or published to LivePortal to provide a
catalogue of available services or Flows. The service request catalogue is organised in the
same hierarchical structure as defined by the Group hierarchy within Cortex Studio. Within
a Microsoft Windows environment, the visibility of, and hence access to, individual Flows
can be controlled using Active Directory Security Groups.
Once a Flow has been initiated by a user, LivePortal can then be used to monitor the
progress of the Flow execution and provide interaction with the user.

2.1.12.2 Execution Progress/Status Display


A Flow can display any information pertinent to its execution progress on LivePortal. This
display of information is:
 Read-only, i.e. for informational purposes only

Cortex Ltd © 2015 All Rights Reserved Page 23


Cortex Studio V6 User Guide

 Dynamic, i.e. it updates automatically as the state of the Flow changes


The information that is displayed and its format are defined by the Flow developer;
however, it is not necessary to have any knowledge of web development as the display is
defined using a WYSIWYG graphical editor. Cortex LivePortal dynamically creates and
updates the web page displayed in the web browser based on how the Flow developer has
configured the user interaction form; no modification, compiling and deployment of web-
page code is required.

2.1.12.3 User Interaction


LivePortal provides a dynamic user interface to provide information to the user and enable
user data to be entered into web-forms for subsequent processing in the Flow execution.
User Interaction forms will be dynamically displayed when either:
 A User Interaction block is encountered in the Flow and the Flow was initiated
from LivePortal’s Service Request Catalogue, whereupon the LivePortal display
will dynamically show the rendered User Interaction form, or
 A URL, inserted into an e-mail or other system, e.g. Service Desk, by the Cortex
flow execution, is clicked. Clicking the URL hyperlink will launch the user’s
default browser and display the current user Interface for the Flow execution,
which could be a read-only status display but more likely a web-form to the user
to provide information or make a decision. In this way, it is possible to
‘transfer’ the Flow interaction to another party, e.g. the user’s manager, to
enable the manual authorisation of part of the business process.

Cortex Ltd © 2015 All Rights Reserved Page 24


Cortex Studio V6 User Guide

3 Navigating the Cortex Studio Environment

3.1 Accessing Cortex Studio


Cortex Studio is accessed from Cortex Gateway, using a standard web browser and entering
the URL for Cortex Gateway that has been provided to you by your Cortex administrator.
 Note: Cortex Gateway supports an extensive set of recent versions of Microsoft
Internet Explorer, Google Chrome and Mozilla Firefox web browsers, which is
updated regularly. Please contact Cortex Customer Support for a full and up to
date list of the supported browsers.
When the Cortex Gateway web page is loaded, the user will prompted to logon to Cortex
Gateway with a screen similar to that shown in Figure 24. Users should logon using the
credentials provided by their Cortex administrator, which in most cases will be their
standard domain logon credentials.

Figure 24 – Cortex Gateway Welcome Screen

 Note: It is possible for more than one user to edit their copy of a particular Flow at
the same time, however when any one of the users commit their changes to Cortex,
they will be warned if any other user’s changes will be overwritten.

3.2 Cortex Gateway User Interface Overview


The User Interface of Cortex Gateway consists of a single Menu Bar, located at the left of
the screen, and a Main Display Area to the right; see Figure 25.

Cortex Gateway Cortex Gateway


Menu Bar Display Area

Figure 25 – Cortex Gateway User Interface

Cortex Ltd © 2015 All Rights Reserved Page 25


Cortex Studio V6 User Guide

3.2.1 Menu Bar


The Menu Bar consists of one or more icons, which enable the easy navigation to key areas
within Cortex Gateway, see Figure 26.

Figure 26 – Menu Bar of Cortex Gateway

The Menu Bar items available to the user are:


 Cortex Icon: Hovering the mouse over the Cortex Icon will display the current
software version of the Cortex interface.
 Flows: Provides a hierarchical menu structure of the Flows and organisation
Groups, enabling direct access to existing flows and the ability to create new
Flows or Subtasks within Cortex Studio.
 Log Out: Logs off the current user.

3.2.1.1 Flows
Flows are organised hierarchically in Groups and sub-Groups, see Figure 27.
 <Left-Click> the Flows icon to reveal a list of the top-level group, CORTEX;
Groups that contain sub-Groups, Flows or Subtasks will be denoted by a right-
arrow at the left of the Group name, see Figure 27.
 <Left-Click> on a Group’s name to reveal its contents of sub-Group, Flows or
Subtasks.
 <Left-Click> on a Flow’s or Subtask’s name to open that object in the main
display window.
 <Left-Click> on the ‘+’ icon to the right of parent Group’s name, see Figure
27, to create a new sub-Group, Flow or Subtask within that Group container.

Figure 27 – Hierarchical Display of Groups and Flows in Cortex Studio

3.2.1.2 Log Out


The Log Out icon logs the user out of Cortex Gateway. If the user has made any changes to
any of the objects within Cortex Studio, a pop-up window confirmation window will be
presented to the user; see Figure 28.

Cortex Ltd © 2015 All Rights Reserved Page 26


Cortex Studio V6 User Guide

Figure 28 – Warning Message

3.3 Cortex Studio User Interface Overview


The User Interface of Cortex Studio occupies the screen area to the right of the Cortex
Gateway Menu Bar and typically consists of a Navigation Bar, a Toolbox window containing
palettes, and a Main Display Area, which will display workspace windows, and a Property
Viewer to display the properties of an object; see Figure 25.
Navigation Bar

Property
Toolbox Viewer

Main Display Area Workspace

Figure 29 – Cortex Studio User Interface

If the contents of a window exceed the window’s size, scroll bars will automatically appear
at the right hand side and bottom edge of the window to enable the easy scrolling
throughout the window’s workspace.

3.3.1 Navigation Bar


The grey Navigation Bar contains a number of icons associated with handling the Flow, see
Figure 30.

Cortex Ltd © 2015 All Rights Reserved Page 27


Cortex Studio V6 User Guide

Close Flow
Help
Currently selected workspace Current User
highlighted in dark grey

Workspace Path Quick Navigation


Previous Flow
History
Next Flow

Figure 30 – Navigation Bar

 Note: Some icons may be greyed-out if that option is currently unavailable.

3.3.1.1 History
The History icon displays a list of the 10 most recently opened workspaces associated with
any of the Flows.
To navigate to a previously opened workspace within a Flow:
1 <Left-Click> on the History icon to reveal a dropdown list of all of the
workspaces, displayed hierarchically, that have been recently opened for any
Flow.
2 <Left-Click> on a workspace name, displayed in the dropdown, to open and
navigate to that workspace.

3.3.1.2 Workspace Path


The workspace path is displayed to the right of the History icon. The Flow name is
displayed first with a right arrow to indicate that this workspace contains objects that have
their own workspaces; see Figure 30.
To navigate to a subordinate workspace:
1 <Left-Click> on an arrow to the right of a workspace name to reveal a
dropdown list of subordinate workspaces.
2 <Left-Click> on any subordinate workspace name to open and select that
workspace.
To navigate to a superior workspace:
1 <Left-Click> on any superior workspace name in the workspace path to open
and select that workspace.
 Note: The currently selected workspace is emphasised in the workspace path by a
dark-grey back ground.
 Note: If the Flow has unsaved changes, an asterisk will be displayed to the right of
the Flow name in the workspace path; the asterisk is automatically cleared when
any changes have been saved.

3.3.1.3 Current User


Displays the current username of the user logged into Cortex Studio.

3.3.1.4 Help
This icon displays help for Cortex Studio, including detailed information on block
configuration, in a new tab on the current web browser.

Cortex Ltd © 2015 All Rights Reserved Page 28


Cortex Studio V6 User Guide

3.3.1.5 Quick Navigation


The Quick Navigation icon opens the Quick Navigation Window to the right of the Main
Display Window, replacing the Property Viewer.
The Quick Navigation Window displays all of the Flows currently open in Cortex Studio, with
the currently active Flow greyed-out; Figure 31 shows an example of the Quick Navigation
Window, depicting two open Flows.

Figure 31 – Quick Navigation Window

To navigate to a different, open Flow:


1 <Left-Click> on the Quick Navigation icon to open the Quick Navigation
Window.
2 <Left-Click> on any Flow shown in the Quick Navigation Window to switch the
Main Display Window to that Flow.

3.3.1.6 Previous Flow


The Previous Flow icon selects the immediately previous Flow opened in Cortex Studio.
This icon is only enabled when more than one Flow is open.

3.3.1.7 Next Flow


The Next Flow icon selects the immediately successive Flow opened in Cortex Studio. This
icon is also only enabled when more than one Flow is open.

3.3.1.8 Close Flow


The Close Flow icon closes the currently active Flow shown in the Main Display Window. If
there are unsaved changes to the currently active Flow, the user will be prompted to save
the Flow before closing.

3.3.2 Toolbox
The Toolbox is displayed to the left of the Main Display Area, see Figure 32, whenever a
Flow is open and Cortex Studio is in Edit Mode (default mode). The Toolbox contains a list

Cortex Ltd © 2015 All Rights Reserved Page 29


Cortex Studio V6 User Guide

of palettes; each palette contains groups of related function blocks that can be used to
build a Flow.

Figure 32 – Toolbox

For more information on palettes and function blocks, see Section 4.2.
Within the Toolbox, it is possible to:
 Expand an individual Palette to display all the associated Function Blocks.
 Collapse an individual Palette to hide its associated Function Blocks.
 Expand all the Palettes to display all the Function Blocks, using the Palettes
Window icon bar.
 Collapse all the Palettes to hide all the Function Blocks, using the Palettes
Window icon bar.
 Search for a Function Block within all the Palettes.
 Select a Function Block from the Palette to be placed on a flow workspace.
To expand an individual Palette:
 <Left-Click> on the down arrow to the right of the Palette’s name to reveal all
the Function Blocks associated with that Palette.
To collapse an individual Palette:
 <Left-Click> on the up arrow to the right of the Palette’s name to hide the
function blocks associated with that Palette.
For more information on the Toolbox and Function Blocks, see Section 4.2.

3.3.3 Toolbox Icon Bar


Icons on the Toolbox icon bar allow all of the Palettes to be collapsed or expanded, see
Figure 33.

Cortex Ltd © 2015 All Rights Reserved Page 30


Cortex Studio V6 User Guide

Expand All
Collapse All

Search box

Figure 33 – Toolbox Icon Bar

3.3.3.1 Collapse All


This icon collapses all open Palettes, hiding all Function Blocks.

3.3.3.2 Expand All


This icon expands all Palettes, revealing all of the Function Blocks.

3.3.4 Toolbox Search


The Toolbox search function performs a fuzzy search on the names of all of the Function
Blocks contained in all of the palettes; this means that even if the user mistypes the name
of a Function Block, it will still be found.
The search is dynamic in that as the user types more characters of the Function Block
name, the list of matching Function Blocks, shown below the search box, will decrease as
the search criteria become more refined.
To search for a Function Block:
1 <Left-Click> in the Search box immediately below the Toolbox icon bar, see
Figure 33.
2 Type part, or all, of the name of the Function Block to be sought.
3 <Left-Click> on the ‘X’ to the right of the Search box to exit search mode.

3.4 Property Viewer


The Property Viewer is displayed at the right of the Main Display Area; see Figure 34,
whenever a Flow is open. The Property Viewer displays all the properties associated with
the selected object. The example shown in Figure 34 displays the properties a ‘Set
Variable’ function block.
Within the Property Viewer, it is possible to:
 View the Properties and existing Property Values of an object
 Modify the Property Values of an object (when Cortex Studio is in Edit Mode).
For more information on the Property Viewer and the modification of Property Values, see
Section 4.2.9.

Figure 34 – Property Viewer

Cortex Ltd © 2015 All Rights Reserved Page 31


Cortex Studio V6 User Guide

3.5 Main Display Area


The Main Display Area shows all open workspaces associated with the current Flow, and
provides the environment for developing Flows (Edit Mode) and the environment for testing
Flows (Debug Mode).
The blue Main Display Area Toolbar provides a set of icons associated with the development
and testing of the Flow. The current operating mode (Edit or Debug) is shown at the right
of the toolbar.

3.5.1 Main Display Area Toolbar (Edit Mode)


Edit Mode is the default mode when a Flow is opened, enabling the user to develop a Flow.
The toolbar icons associated with Edit Mode, see Figure 35, enable the user to Undo and
Redo the previous actions, execute the Flow and enter Debug Mode, remove all the
breakpoints in the flow, or save, commit or deploy the current Flow to the server.

Commit Flow
Deploy to Server Get Master Version of this Flow
Save Delete

Undo Current Mode (Edit)


Redo
Start an
Execution
Remove All
Breakpoints

Figure 35 – Main Display Area Toolbar (Edit Mode)

 Note: Some icons may be greyed-out if that option is currently unavailable.

3.5.1.1 Undo
Reverses the previous action. The Undo facility can accommodate reversing the previous
50 actions.

3.5.1.2 Redo
Reverses the Undo action. This icon is only available to click immediately after the Undo
icon has been clicked. The previous 50 Undo actions can be reversed.

3.5.1.3 Start an execution


Enters the Debug Mode and starts a new execution of the current Flow in the user’s private
sandbox environment within Cortex.
 Note: Starting an execution of a Flow within Cortex Studio does not make the Flow
generally available to other users; the Flow is executed in isolation to all other
Flows.

3.5.1.4 Exit edit mode and resume executions


Reverts Cortex Studio back to Debug Mode. The user can then resume any previously
executing Flows.
 Note: This icon is only available if the Edit Mode has been reselected during the
debug execution of a Flow.

Cortex Ltd © 2015 All Rights Reserved Page 32


Cortex Studio V6 User Guide

3.5.1.5 Remove all breakpoints


Removes all the breakpoints that have been set by the user in the selected Flow.
Breakpoints are used to temporarily halt flow execution when testing and debugging flows;
for information about breakpoints, see Section 5.3.2.

3.5.1.6 Save
Saves the Flow into the user’s repository on the Cortex server.

3.5.1.7 Deploy to Server


Deploys the user’s version of the Flow to the configured Cortex Debug Server, where it will
replace the current version of the specific Flow in the user’s sandbox environment.
If the Flow’s Export property is set to True, the Flow will also be made available in the
LivePortal service catalogue on the Cortex Debug Server.

3.5.1.8 Commit Flow


Stores the user’s version of the Flow in the Master Repository as the master version; the
Flow is also saved in the user’s repository on the Cortex server. Other users with the
correct access permissions are able to load the Flow from the Master Repository into their
Cortex Studio client and make changes to it.

3.5.1.9 Get the Master Version of this Flow


Retrieves the master version of the current Flow; the retrieved flow will overwrite the
user’s version of the Flow being edited in Cortex Studio.
 Note: Administrators additionally have the ability to Publish master versions of
Flows from the Master Repository to one or more selected Cortex Servers that form
part of the customer’s Cortex platform i.e. to put a Flow into production use.

3.5.1.10 Delete
Deletes the Flow from the user’s repository and marked as deleted in the Master
Repository. If a Flow is marked as deleted in the Master Repository, it is no longer visible to
developers within Cortex Studio.

3.5.2 Main Display Area Toolbar (Debug Mode)


Debug Mode allows the user to test and debug Flows developed in Cortex Studio. Debug
Mode is automatically entered if the user selects the ‘Start an Execution’ icon or, if a Flow
is already executing, the ‘Exit edit mode and resume executions’ icon, in Edit Mode.
For more information on testing and debugging Flows, see Section 5.3.
The toolbar associated with Debug Mode enables the user to initiate an execution of the
current Flow, remove all breakpoints set in the current Flow, or switch back to Edit Mode,
see Figure 36.
 Note: Flows, object workspaces, and object parameters can viewed in Debug Mode;
however, the user must switch back to Edit Mode in order to make any changes.

Current Mode
Switch to Edit Mode (Debug)
Start an Execution

Remove All Breakpoints

Figure 36 – Main Display Area Toolbar (Debug Mode)

Cortex Ltd © 2015 All Rights Reserved Page 33


Cortex Studio V6 User Guide

 Note: Some icons may be greyed-out if that option is currently unavailable.

3.5.2.1 Switch to Edit Mode


Pauses any current executions of the Flow and switches to Edit Mode to allow modifications
to the Flow.

3.5.2.2 Start an Execution


Enters the Debug Mode and starts a new execution of the current Flow in the user’s private
sandbox environment within Cortex.

3.5.2.3 Remove all breakpoints


Removes all the breakpoints that have been set by the user in the selected Flow.
Breakpoints are used to temporarily halt flow execution when testing and debugging flows;
for information about breakpoints, see Section 5.3.2.

3.6 Workspace Window


A workspace window displays the workspace of an object. Workspaces provide the ‘canvas’
onto which a Flow can be formed by connecting Function Blocks together in a logical
sequence to perform a set of defined actions.

3.6.1 Workspace Window Toolbar


The Workspace Window toolbar contains the title of the workspace and enables a number
of actions to be performed on the workspace.

Workspace Title Zoom Out

Zoom In
1:1
Shrink Wrap
Close

Figure 37 – Workspace Window Toolbar

 Note: Some icons may be greyed-out if that option is currently unavailable.

3.6.1.1 Workspace Title


The workspace title shows the title assigned to that particular workspace, or, in the
instance of the top-level Flow workspace, the title of the Flow. The workspace title may
be edited, except for the top-level Flow workspace.
To edit the workspace title:
1. <Left-Click> the workspace title to reveal a text entry box.
2. Type the new workspace title into the text entry box.
3. <Left-Click> the ‘tick’ icon to save the new title, or the ‘cross’ icon to discard
any changes to the workspace title.

3.6.1.2 Zoom Out


Zooms-out from the workspace, making all the objects contained within it smaller, enabling
more objects contained in the workspace to be viewed in the same window size.

Cortex Ltd © 2015 All Rights Reserved Page 34


Cortex Studio V6 User Guide

3.6.1.3 1:1
Reverts the scaling of objects in the workspace to 1:1, i.e. the maximum object size.

3.6.1.4 Zoom In
Zooms-in to the workspace, making all the objects contained within it larger, enabling
better visibility of the objects contained in the workspace.

3.6.1.5 Shrink Wrap


Shrinks the size of the workspace so that it just encompasses all of the objects contained
within it, without moving any of the objects.

3.6.1.6 Close
Closes the workspace and any subordinate workspaces that are open.

3.7 Execution Viewer


The Execution Viewer enables the progress of all instances of the Flow’s executions to be
monitored simultaneously, see Figure 38.
The Execution Viewer opens automatically in Debug Mode; the Viewer Window can also be
opened or hidden manually.

Execution Viewer
Execution Viewer Hide/Unhide
Toolbar

{
List of current
executions

Selected execution
highlighted in blue
Figure 38 – Execution Viewer

To manually open the Execution Viewer:


 <Left-Click> the dark grey rectangle icon at the top of the hidden Execution
Viewer, see Figure 38, (visible at the bottom of the Main Display Area).
To manually hide the Execution Viewer:
 <Left-Click> the dark grey rectangle icon at the top of the Execution Viewer.
The Execution Viewer contains information about each executing instance of the currently
active Flow. The various instances of the current Flow can be ordered in the Execution
Viewer by selecting the down-arrow to the right of any column name.
When an instance of Flow is selected in the Execution Viewer, its corresponding Token will
be highlighted.
 Note: A Token is a system object that keeps track of the current state (function
block being executed, current value of variables, etc.) of an executing flow. The
Token is made visible for flow observation and debugging purposes. For more
information about the Token and debugging, see Section 5.3.

Cortex Ltd © 2015 All Rights Reserved Page 35


Cortex Studio V6 User Guide

To select a Flow instance in the Execution Viewer:


 <Left-Click> the row in the Execution Viewer corresponding to the Flow
instance; the selected Flow will be highlighted in light blue. Multiple Flows may
be selected by using <CTRL> + <Left Click>.
For more information about the Execution Viewer, see Section 5.3.1.2.

3.7.1 Execution Viewer Toolbar


The Execution Viewer Toolbar enables the user to perform a number of actions associated
with debugging a Flow, see Figure 39.

Stop Tracking
Start Tracking

Show in LivePortal
Go To

Continue the Execution


Pause the Execution
Step the Execution
End the Execution

Figure 39 – Execution Viewer Toolbar

 Note: Some icons may be greyed-out if that option is currently unavailable.

3.7.1.1 Continue the Execution


Continues the execution of the selected paused Flow. If multiple Flows have been
selected, all selected Flows will resume.
 Note: This icon will not be available if none of the selected Flows are currently
paused.

3.7.1.2 Pause the Execution


Pauses the execution of the selected running Flow. If multiple Flows have been selected,
all selected Flows will be paused.
 Note: This icon will not be available if none of the selected Flows are currently
running.

3.7.1.3 Step the Execution


Steps the execution of the selected paused Flow to execute the next Function Block and
pause again. If multiple Flows have been selected, all selected Flows will be stepped.
 Note: This icon will not be available if none of the selected Flows are currently
paused.

3.7.1.4 End the Execution


Terminates the execution of the selected Flow. If multiple Flows have been selected, all
selected Flows will be terminated.

3.7.1.5 Go To
Opens the workspace of the selected Flow, in which the Token, representing the current
point of execution, is located.

Cortex Ltd © 2015 All Rights Reserved Page 36


Cortex Studio V6 User Guide

 Note: This icon will not be available if multiple Flows have been selected.

3.7.1.6 Show in LivePortal


Opens a new web-browser window and displays the LivePortal web session associated with
the selected flow execution.

3.7.1.7 Start tracking


Forces Cortex Studio to automatically track the selected Token as it executes the Flow,
ensuring that the Token is always visible, even when calling Subtasks or other Flows
(synchronously).
 Note: Tracking is automatically enabled for the selected Token.
 Note: Only one Token can be tracked at any one time.

3.7.1.8 Stop tracking


Forces Cortex Studio to stop tracking the selected Token for that Flow instance until it is
re-enabled with ‘Start Tracking’.

3.8 Context Menus


States and Function Blocks on a workspace, and workspaces themselves, have context
sensitive menus to enable easy access to the most common functions for that object; see
Figure 40.
To access a context menu:
1 <Right-Click> on the object to reveal and expand its context menu.

2 <Left-Click> on the menu option to perform the required function.


 Note: The context menu options available on an object will vary dependent on the
object and the operating mode (Edit or Debug) or Cortex Studio.

Figure 40 – Example Context-Menu Options for a Workspace Object

3.8.1 State Context Menu Options

3.8.1.1 Copy
Copies the selected State or States, including all child objects, to a clipboard. This option
is only available in Edit Mode.
 Note: Copying a State duplicates all the objects contained within it. Therefore, all
aspects of the copied object should always be reviewed to ensure the correct
configuration and references.

3.8.1.2 Cut
Copies the selected State or States, including all child objects, to a clipboard, and deletes
the original selected States from the workspace. This option is only available in Edit Mode.

Cortex Ltd © 2015 All Rights Reserved Page 37


Cortex Studio V6 User Guide

3.8.1.3 Delete
Deletes the selected State or States, including any associated connections, from the
workspace. This option is only available in Edit Mode.

3.8.2 Function Block Context Menu Options

3.8.2.1 Copy
Copies the selected Function Block or Blocks, including all child objects in the case of a Sub
Flow Block, to a clipboard. This option is only available in Edit Mode.
 Note: Copying a Function Block duplicates all of its properties. Therefore, all
properties of the copied Function Block should always be reviewed to ensure the
correct configuration and references.

3.8.2.2 Cut
Copies the selected Function Block or Blocks, including all child objects in the case of a
Sub-Flow block, to a clipboard, and deletes the original selected objects from the
workspace. This option is only available in Edit Mode.

3.8.2.3 Delete
Deletes the selected Function Block or Blocks, including any associated connections, from
the workspace. This option is only available in Edit Mode.

3.8.2.4 Add Breakpoint


Inserts a breakpoint before the selected Function Block. This option is only available if the
Function Block does not already have a breakpoint set.

3.8.2.5 Remove Breakpoint


Removes a breakpoint before the selected Function Block. This option is only available if
the Function Block already has a breakpoint set.

3.8.2.6 Set Next Block to Execute


Moves the Token to the top of this Function Block. This option is only available in Debug
Mode and when a paused Flow instance is currently selected.
 Note: A Token is a system object that keeps track of the current state (function
block being executed, current value of variables, etc.) of an executing flow. The
Token is made visible for flow observation and debugging purposes. For more
information about the Token and debugging, see Section 5.3.

3.8.3 Workspace Context Menu Options

3.8.3.1 Add note


Adds a note object to the workspace. The note object’s text, font colour and background
may be configured using its properties, displayed in the Properties Window. This option is
only available in Edit Mode.
 Note: Note objects also have context menu options, enabling them to be copied
(Copy) or moved (Cut) to the clipboard.

3.8.3.2 Paste
Copies the contents of the clipboard to the workspace. This option is only available in Edit
Mode and when objects have been copied to the clipboard using the Copy or Cut context
menu options.

Cortex Ltd © 2015 All Rights Reserved Page 38


Cortex Studio V6 User Guide

4 Building an Automation Flow

4.1 Introduction
4.1.1 Overview of Creating a Flow
Flows are created using a graphical approach to generate a visual representation of the
flow. This approach makes it easier to understand the steps that make up a Flow and
reduces errors, and also serves as documentation of the process.
Each block has a specific purpose, and its appearance reflects its function. Although the
purpose of each block is fixed, the detail of its activity is not; each block has one or more
properties specific to its purpose that must be configured in order to achieve the desired
outcome. For example, the ‘Copy File’ block has two properties: one identifies which file
to copy, and the other identifies the destination of the copied file.

4.1.2 Flows

A Flow holds all the logic and other entities that make up a logical process; see Figure 41.
Each Flow has a sub-workspace that contains:
 A Flow starting point.
 One or more States that represent the high-level stages of the Flow and contain
the detailed logic that defines the Flow.
 A global Variables Store that holds the declaration of variables that are valid in
all of the States within this Flow. For more information on Variables, see
Section 2.1.8.3.
 A Default Error Handler that is executed whenever an unhandled error is
encountered in the Flow in any of the States within the Flow. For more
information on error handling, see Section 4.4.8.
 A Default UI Configuration object, used to define the default screen to be shown
on the LivePortal user interface when the flow is executing. For more
information on the Default UI Configuration and LivePortal, see Section 4.4.9.

Cortex Ltd © 2015 All Rights Reserved Page 39


Cortex Studio V6 User Guide

Flow Start

Default Error Handler


Global Variable Store

User Inferface Definition

States

Figure 41 – Organisation of a Flow Container

When the Flow is initiated, execution begins at the Flow Start block and enters the first
State within the Flow’s workspace, where the detailed logic is executed; see Section 4.1.3.
When the logic in the first State has completed execution, the Flow will then proceed to
the second State (if applicable) or the Flow will terminate normally if there are no further
States to execute.

4.1.3 Anatomy of a Flow


Figure 42 depicts the key features of a fictitious Flow within a State’s workspace.

Cortex Ltd © 2015 All Rights Reserved Page 40


Cortex Studio V6 User Guide

A
NOTE: Connector
with arrow showing
B direction of flow link
blocks together.

C
H
NOTE: Icon and
shape provides visual
representation of the
D block’s function.

F
J
NOTE: Junction
G indicating several
flows merging into
one.

K L

Figure 42 – Anatomy of a Flow

A Variables Store contains the declarations of variables that are only valid within
this State. Variables declared at the Flow level in a superior Variables Store are
valid in any of the States defined for this Flow.

B Start State block identifies the starting point of the Flow execution within this
State. Every State workspace has exactly one Start State block, which is
automatically included in the State’s workspace when the State is created.
 Note: Having more than one entry point on a workspace (by cloning or
adding another entry point from a palette) will result in an error.

C The first function block encountered in the execution of this Flow.


In this example, this function block is an ‘Arithmetical Operation’ activity block,
drawn from the Variable Blocks palette.

D Flow execution then proceeds to this function block from block ‘C’.
In this example, this function block is a ‘True/False Expression Evaluator’ flow
control block, drawn from the Branching Blocks palette. If the logical expression
is true, flow execution will continue downwards from the green-tick icon to block
‘E’; if the logical expression is false, flow execution will continue to the right from
the red-cross icon to block ‘F’.

Cortex Ltd © 2015 All Rights Reserved Page 41


Cortex Studio V6 User Guide

E Flow execution will continue to this function block if the logical expression
evaluated in block ‘D’ is true.
In this example, this function block is a ‘Subtask’ activity block, drawn from the
Flows and States palette. The Subtask block contains its own sequence of function
blocks, presented as a single block at this level.

F Flow execution will continue into this function block if the logical expression
evaluated in block ‘D’ is false.
In this example, this function block is a ‘Post to Operator Logbook’ activity block,
drawn from the Miscellaneous palette.

G Flow execution proceeds from block ‘E’ into block ‘G’.


In this example, this function block is an ‘End State’ block. Every State sub-
workspace has one End State block automatically included in the State’s sub-
workspace when the State is created. States may have more than one End State
block to pass the flow execution to alternative States as defined in the Flow’s sub-
workspace.

H The optional State Error Handler block identifies a common point within the
State’s sub-workspace for the flow execution to proceed if an error condition
occurs that has not been handled by a Local Error Handler.
If the State Error Handler block is not present in a State’s sub-workspace and an
error condition arises, execution will be passed to the Default Error Handler at the
Flow level. The State Error Handler block is drawn from the Error Handling
palette.

I The first function block encountered after an unhandled error condition has
occurred in this State’s sub-workspace.
In this example, this function block happens to be a ‘Pattern Match’ decision
block, drawn from the Branching Blocks palette. This Pattern Match block uses
Regex to search for a pattern of characters within a text string; for example, it
could search for the pattern ‘Error E4’ within the source text of an error message.
If the pattern is found, execution will continue downwards from the green-tick
icon to block ‘J’, otherwise execution will continue to the right from the red-cross
icon to block ‘L’.

J Flow execution passes to this function block if a Regex match was found in block
‘I’.
In this example, this function block is a ‘Set Variable’ function block, drawn from
the Variable Blocks palette.

K This End State block is executed immediately after block ‘F’ or block ‘J’, directing
the execution to a different State.
Additional End State blocks may be drawn from the Flows and States palette.

L This block is executed if there was no Regex match found in block ‘I’.
In this example, this block is an ‘End Flow’ block, drawn from the Flows and
States palette. The End Flow block immediately terminates execution of the
Flow.

Cortex Ltd © 2015 All Rights Reserved Page 42


Cortex Studio V6 User Guide

4.2 Working with Blocks and Palettes


Blocks are the key components used in constructing a Flow. Blocks are selected from a
palette and dragged onto a workspace using the computer’s mouse, and then connected
together to form the Flow.

4.2.1 Displaying the Toolbox


Whenever a workspace is visible on the main display window, the Toolbox is automatically
displayed.
An individual palette may be expanded to reveal its associated blocks by:
 <Left-Click> on the down arrow to the right of the palette name.
An individual palette may be collapsed to hide its associated blocks by:
 <Left-Click> on the up arrow to the right of the palette name.
All palettes may be expanded simultaneously to reveal all blocks by:
 <Left-Click> on the ‘Expand All’ icon at the right of the Palettes Window title
bar, see Figure 33.
All palettes may be collapsed to hide all blocks by:
 <Left-Click> on the ‘Collapse All’ icon at the right of the Palettes Window title
bar, see Figure 33.

4.2.2 Placing Blocks on a Workspace


To select a block and place it on a workspace:
 <left-Click> and <Drag> the required block from the palette to the desired
workspace; release the mouse button to place the selected block into the
workspace.

4.2.3 Selecting Blocks on a Workspace


Selected blocks are highlighted with a pale blue dashed-line.
To select a single block on a workspace:
 <Left-Click> the required block to select it.
To select multiple blocks:
1 <Left-Click> on the workspace and <Drag> the mouse to create a rectangle
that completely encompasses all the blocks to be selected.
2 Release the mouse button to select all the objects contained within the
dragged rectangle.
To select several, non-adjacent blocks:
1 <Left-Click> on the first block to select it.

2 Hold down the <Shift> key and <Left-Click> on the additional blocks to be
selected.
 Note: Individual selected blocks may be deselected by <Shift> and <Left-Click>
on the selected blocks.

4.2.4 Moving Blocks on a Workspace


To move a block on a workspace:

Cortex Ltd © 2015 All Rights Reserved Page 43


Cortex Studio V6 User Guide

 <Left-Click> the required block and <Drag> it to the desired position. Any
connections to the block will be automatically rerouted.
If blocks are moved out of the workspace area, the workspace will automatically re-size to
accommodate the moved block.

4.2.5 Duplicating Blocks


Blocks that have already been placed on a workspace may be duplicated to create an exact
replica of the original block, which can then be placed onto any target workspace.
To duplicate a block:
1 <Right-Click> on the block to be duplicated to reveal its context menu.

2 <Left-Click> the Copy context menu option to copy the block to the
clipboard.
3 <Right-Click> the mouse in the target workspace to reveal a context menu.

4 <Left-Click> Paste to place the copied block onto the workspace.


 Note: Duplicating a block copies the blocks entire configuration, including its
Property Values. The Property Values of a duplicated block should always be
manually checked to ensure the correct configuration for that block.

4.2.6 Deleting Blocks


To delete a single block, either:
1 Select an individual block,
2 Press the Delete key on the keyboard to delete the selected block and its
associated connection points.
Or
3 <Right-Click> on the selected block to reveal its context menu,
4 <Left-Click> the Delete context menu option to delete the selected block
and its associated connection points.
To delete multiple blocks:
5 Select a group of blocks,
6 Then either:
a.
i. <Right-Click> on any selected block to reveal its context menu,
ii. <Left-Click> the Delete context menu option to delete all the
selected blocks and associated connection points.
Or
b. Press the Delete key on the keyboard to delete the selected blocks and
associated connection points.

4.2.7 Connecting Blocks Together


Connections between blocks are made by joining the blocks’ connection points. Each block
has the necessary input and output connection points, denoted by a small circle on the
edge of a block.
Input connection points are always at the top of the block. Output connection points for
Activity blocks are located at the bottom of the block; Flow Control blocks usually have
additional output connection points on the side of the block.

Cortex Ltd © 2015 All Rights Reserved Page 44


Cortex Studio V6 User Guide

Activity blocks also have an additional ‘error-handling’ connection point on the right edge
of the block, denoted by a red circle, which is optionally used to divert the Flow execution
if any error is raised by the function block.
There are two methods to connect two sequential blocks together to form a logical flow of
activities; ‘Connect Forward’ or ‘Connect Back’.

4.2.7.1 Connect Forward


Connect Forward creates a connection from the first block’s output connection point to the
second block’s input connection point:
1 <Hover> the mouse pointer over the output connection point of the first
block; the outline of the output connection point will darken when the
connection process can be initiated.
2 <Drag> on the output connection point of the first block towards the second
block; any input connection point to which the connection can be made will
enlarge, see Figure 43.
3 The destination input connection point will glow blue when the dragged
output connection point is close, indicating that this connection can be made.
4 <Release> the mouse button to make the connection.

Figure 43 – Dragging Connection Down to Link Forward

4.2.7.2 Connect Backward


To Connect Backward, i.e. create a connection from the second block’s input connection
point back to the first block’s output connection point:
1 <Hover> the mouse pointer over the input connection point of the first block;
the outline of the input connection point will darken when the connection
process can be initiated.
2 <Drag> on the input connection point of the first block towards the second
block; any output connection point to which the connection can be made will
enlarge, see Figure 44.
3 The destination output connection point will glow blue when the dragged
input connection point is close, indicating that this connection can be made.
4 <Release> the mouse button to make the connection.

Cortex Ltd © 2015 All Rights Reserved Page 45


Cortex Studio V6 User Guide

Figure 44 – Dragging Connection Up to Link Backward

4.2.7.3 Multiple Connections


It is possible to connect the output connection points of multiple blocks to a single input
connection point as shown in Figure 45. In these situations, where more than one logic
path needs to join together, simply Connect Backward an output connection point on one
block to the input connection point on the target block where a connection already exists.

Figure 45 – Example flow Showing Multiple Routed Input Connections

4.2.7.4 Routing of Connections


Cortex Studio will automatically route the connection to avoid other objects on the
workspace.
In certain cases where there is limited space around objects the auto-routing algorithm may
fail to find a suitable connection path and will then directly connect the two connection
points with a diagonal line. Increasing the spacing between objects, triggering a re-route,
will normally resolve this issue.

Cortex Ltd © 2015 All Rights Reserved Page 46


Cortex Studio V6 User Guide

4.2.8 Deleting Connections


To delete a single connection between two blocks, either:
1 <Left-Click> on the connection to be deleted to select it.
2 Press the Delete key on the keyboard to delete the connection.
Or
1 <Right-Click> on the connection to reveal its context menu,
2 <Left-Click> the Delete context menu option to delete the connection.
To delete multiple connections:
1 Select the connections to be deleted,
2 Then either:
a.
i. <Right-Click> on any of the selected connections to reveal its
context menu,
ii. <Left-Click> the Delete context menu option to delete all the
selected connections.
Or
b. Press the Delete key on the keyboard to delete all the selected
connections.

4.2.9 Block Configuration


Each block has a number of properties that must be configured to ensure that the block
performs its function correctly; for example, the ‘Set Variable’ block has properties to
define which variable is to be set, and to what value; Figure 46 shows the Property Viewer
display of the properties of a ‘Set Variable’ block.
The properties of a block can be viewed and edited in the Property Viewer, which displays
the properties of the currently selected block. The Property Viewer is automatically
displayed at the right of the Main Display Area whenever a Flow is opened.

Figure 46 – Set Variable Block Properties Example

4.2.10 Property Configuration


Values may be assigned to the properties of a block in different ways dependent on the
type of the property value. There are two ways in which property values may be specified:
1 Manually entered as free-format characters.
2 Using a dedicated Property Editor Dialog.
 Note: The Property Editor Dialog is context-sensitive, and will vary dependent on
the type of property being modified.

Cortex Ltd © 2015 All Rights Reserved Page 47


Cortex Studio V6 User Guide

4.2.10.1 Property Types


A value of the correct type can be assigned explicitly, or the flow can dynamically assign a
value to certain properties from a variable at runtime.
If a variable is used to dynamically assign a value to a property, then it should typically be
of the correct type and ‘referenced directly’, using the special notation of the form
($)Variable_Name; however, in the case where a property value requires the type of Text,
then Integer, Float, Boolean or Text variables may be used if referenced as text (casted),
using the special notation of the form {{Variable_Name}}.
The different types of values that can be assigned to properties are:
 TRUTH-VALUE
 SYMBOL
 TEXT
 VALUE
 LIST
 STRUCTURE
 DATETIME
 TIMESPAN
TRUTH-VALUE
A Truth-Value is simply a Boolean type value, i.e., ‘true’ or ‘false’
SYMBOL
A symbol is a special type of text value, which is generally used as an item name, e.g. the
name of a Flow. A symbol can contain any combination of letters, characters, period (.),
underscore (_), and dash (-); however, no spaces or other punctuation are allowed, and it
must be prepended by a ($) character sequence.
Many Symbols are set to a default value and will need to be assigned a unique value at the
time when an object’s properties are configured.

Figure 47 – Integer Variable Declaration Block Properties

The example shown in Figure 47 depicts the properties associated with an Integer Variable
declaration block; the value for the Name property is preconfigured with the symbol
($)NO-NAME; this should be changed to a unique symbol to represent this variable.
TEXT
The value type of Text accepts free format text; however, care should be taken to ensure
that the text entered is relevant to the property. For example, the arithmetic operation to
be performed in the ‘Arithmetic Operation’ block, which is defined in the Arithmetical
Expression property, is entered as a text string. In this example, a character string, such as
‘1 + 1’, would be appropriate; however, a character string, such as ‘the cat sat on the
mat’, would be nonsensical.

Cortex Ltd © 2015 All Rights Reserved Page 48


Cortex Studio V6 User Guide

Figure 48 – Text Property Value Assignment

Figure 48 shows the properties of the ‘Arithmetical Operation’ function block. Both the
Description property (optional) and Arithmetical Expression property (mandatory) should
be assigned Text type values. The Description property can be completed using a free text
format; the Arithmetical Expression property should be completed using meaningful text to
represent the desired expression.
The value of a variable may also be used within any Text type property value by enclosing
the variable name in double braces, for example {{MY-VARIABLE-NAME}}.
Example 1:
The Text variable, MY-VARIABLE, has the current value “JOHN”
Property assignment: Hello {{MY-VARIABLE}}
Result: “Hello JOHN”
Example 2:
The Integer variable, I-INPUT, has the current value ‘4’
The Text variable, T-INPUT, has the current text value “7”
Property assignment: {{I-INPUT}} * 3 + {{T-INPUT}}
Result: “4 * 3 + 7”

Figure 49 – Text Property Value Assignment Using Variables

Text-based expressions may be either assigned directly to the property as described above,
or for more complex expressions involving variables, an Editor Dialog may be used.
VALUE
A Value is a literal value or a reference to a variable as the same type. For example, in the
‘Set Variable’ function block, if the target variable of the Save to property is of type
Integer, then the Parameter Value (i.e. Source) property must contain a literal value that is
a whole number (an integer) or reference a variable that is also of type Integer.
Table 1 details the variables types and literal values that may be used within a property of
type Value for each expected property type.
As is illustrated, a Text type target property can accept a wider range of input types,
provided the correct syntax is used, than, for example, an Integer type target.

Cortex Ltd © 2015 All Rights Reserved Page 49


Cortex Studio V6 User Guide

Property Type
Boolean Integer Float Quantity Text
ALLOWED ALLOWED ALLOWED ALLOWED ALLOWED
Values Integer Any numeric value Any numeric value Numeric values must be
Literal permitted: values only cast to Text using
(including (including
true, scientific scientific double inverted
false notation) notation) commas, e.g. “128”

ALLOWED by Casting
Variable Type Referenced in Property Value

NOT NOT Boolean variable must


Boolean ALLOWED NOT ALLOWED be cast to Text using
ALLOWED ALLOWED
double-braces, e.g.
{{Bool-Var}}
ALLOWED ALLOWED ALLOWED by Casting
NOT Integer value will Quantity variable Integer variable must be
Integer ALLOWED be automatically will assume the cast to Text using
ALLOWED
converted to Float properties of an double-braces, e.g.
Integer {{Int-Var}}

ALLOWED ALLOWED by Casting


NOT NOT Quantity variable Float variable must be
Float ALLOWED will assume the cast into Text using
ALLOWED ALLOWED
properties of a double-braces, e.g.
Float {{Float-Var}}

ALLOWED ALLOWED by Casting


NOT NOT Integer values will Quantity variable must
Quantity ALLOWED be cast to Text using
ALLOWED ALLOWED be automatically
converted to Float double-braces, e.g.
{{Qty-Var}}

Text NOT NOT NOT


NOT ALLOWED ALLOWED
ALLOWED ALLOWED ALLOWED

Table 1 – Allowed Assignment to Property Values of Type VALUE

For the other types, namely: LIST, STRUCTURE, DATATABLE, DATETIME and TIMESPAN,
whenever a property value is assigned, the type of the source must match the type of the
target value.

4.2.11 Property Editor Dialog


The Property Editor Dialog is a context-based helper that enables the user to easily edit an
object’s property, enabling complex property values to be entered and visualised.
The Property Editor Dialog is accessed by <Left-Click> the ellipsis to the right of the
property value field in the Property Viewer.
 Note: The actual Property Editor Dialog displayed will differ, based on the
expected value type of the property.
There are three main types of Property Editor Dialog:
1. Text Entry Editor Dialog, see Figure 50.
2. Data Entry Field Editor Dialog, see Figure 51.
3. Composite Variable Editor Dialog, see Figure 55.
 Note: Certain function blocks, may have a ‘specialised’ Property Editor Dialog to
enable the easy editing and visualisation of more complex tasks, e.g., the passing
of variables to and from Subtasks. The Property Editor Dialog for these tasks is
discussed in conjunction with the associated blocks in Section 4.4.

Cortex Ltd © 2015 All Rights Reserved Page 50


Cortex Studio V6 User Guide

4.2.11.1 Text Entry Property Editor Dialog


The Text Entry Property Editor Dialog allows free-format text to be entered. The dialog
displays the entered text on enumerated lines; however, the line numbers themselves do
not form part of the property value.

Figure 50 – Text Entry Editor Property Dialog

To enter text using the Text Entry Property Editor Dialog:


1 <Left-Click> the ellipsis to the right of the property value field in the
Property Viewer to open the Property Editor Dialog.
2 Enter text into Text Entry Property Editor Dialog. Pressing the <Return> key
on the keyboard will start a newline of text.
3 <Left-Click> OK to save the text to the property value and exit the Text
Entry Property Editor Dialog, or <Left-Click> Cancel to close Text Entry
Property Editor Dialog without saving any changes.

4.2.11.2 Data Entry Field Property Editor Dialog


The Data Entry Field Property Editor Dialog allows references to variables or symbols, or
literal values, to be assigned to a property value.
There are several variants of the Data Entry Field Property Editor Dialog.
Variant 1 – Variable Reference Only
This variant of Property Editor Dialog only allows references to declared variables (or
Symbols), or, in some instances, a literal Boolean values, to be assigned to a property.

Figure 51 – Data Entry Property Editor Dialog – Variable Reference Only

To assign a value to a property using the Data Entry Field Property Editor Dialog (Variant 1):
1 <Left-Click> the ellipsis to the right of the property value field to open the
Property Editor Dialog.

Cortex Ltd © 2015 All Rights Reserved Page 51


Cortex Studio V6 User Guide

2 If the data entry field contains an existing value, either modify that value
directly, or clear the contents of the data entry field to reveal a dropdown
menu of items to select.
The dropdown menu displays all the variables of a suitable type for the
property that are in scope; for more information on the scope of variables,
see Section 2.1.8.3. If the property accepts a Boolean value, the drop-down
list will also contain the Boolean literal vales of True and False.
If the mouse is hovered over a variable in the dropdown menu, the variable
description property, if set, will be displayed; see Figure 52 – Data Entry
Property Editor Dialog – Variable Description DisplayFigure 52.

Figure 52 – Data Entry Property Editor Dialog – Variable Description Display

3 <Left-Click> the required variable name or literal value from the drop-down
list.
4 <Left-Click> OK to save the property value and exit the Data Entry Field
Property Editor Dialog, or <Left-Click> Cancel to close Data Entry Field
Property Editor Dialog without saving any changes.
Variant 2 – Text and Variable Entry
This variant of Property Editor Dialog allows references to Text variables, or a Text value to
be formed from any combination of literal text, variables casted as text, or functions
casted as text.

Figure 53 – Data Entry Property Editor Dialog – Text and Variable Entry

To assign a value to a property using the Data Entry Field Property Editor Dialog (Variant 2):
1 <Left-Click> the ellipsis to the right of the property value field in the
Property Viewer to open the Property Editor Dialog. The Property Editor
Dialog will open with the ‘Reference an existing variable’ tab selected.
2 Enter the required data by either:

Cortex Ltd © 2015 All Rights Reserved Page 52


Cortex Studio V6 User Guide

a. Referencing an existing Text variable, using the ‘Reference an existing


variable’ tab:
i. If the data entry field contains an existing value, either modify that
value directly, or clear the contents of the data entry field to
reveal a dropdown menu of items to select.
The dropdown menu displays all the variables of a Text type that
are in scope; for more information on the scope of variables, see
Section 2.1.8.3.
ii. <Left-Click> the required variable name from the drop-down list.
Or:
b. Enter a Text value of any combination of literal text, or variables or
functions casted as Text:
i. <Left-Click> the Enter text value tab, see Figure 53.
ii. To enter a declared variable casted as text: <Double Left-Click>
the variable name in the Variables sub-tab. The name of the
variable, enclosed in the casting double-braces, will be inserted at
the cursor’s location.
iii. To enter the value of a built-in function casted as text, simply
<Double Left-Click> the function name in the Functions sub-tab.
The name of the function, enclosed in the casting double-braces,
will be inserted at the cursor’s location.
3 <Left-Click> OK to save the property value and exit the Data Entry Field
Property Editor Dialog, or <Left-Click> Cancel to close Data Entry Field
Property Editor Dialog without saving any changes.
Variant 3 – Date and Time Picker
This variant of Property Editor Dialog only allows a literal date and time to be assigned to a
property.

Figure 54 – Date and Time Picker

To assign a date and time to a property using the Data Entry Field Property Editor Dialog
(Variant 3):
1 <Left-Click> the ellipsis to the right of the property value field in the
Property Viewer to open the Property Editor Dialog.
2 If the data entry field contains an existing value, either modify that value
directly, or clear the contents of the data entry field to reveal the Date and
Time Picker, see Figure 54.
3 Select the required date and time.

Cortex Ltd © 2015 All Rights Reserved Page 53


Cortex Studio V6 User Guide

4 <Left-Click> OK to save the property value and exit the Data Entry Field
Property Editor Dialog, or <Left-Click> Cancel to close Data Entry Field
Property Editor Dialog without saving any changes.

4.2.11.3 Composite Variable Property Editor Dialog


The Composite Variable Property Editor Dialog enables List and Structure values to be
created or references to variables to be assigned to a property value.
Undo last action
Redo
Select view
Collapse All Fields
Expand All Fields

Actions Menu Icon

Dropdown List
of Actions

Figure 55 – Composite Variable Property Editor Dialog

To create a List or Structure value:


1 <Left-Click> the ellipsis the right of the property field to open the
Composite Variable Property Editor Dialog, see Figure 55. The editor will
open the Create list or, in the case of a Structure value, Create Structure tab,
in a ‘Tree’ view.
2 <Left-Click> the Action Menu Icon to the left of first element position to
reveal the actions menu.
3 <Left-Click> the Append menu option to add a value to the first element to
the Composite Variable.
4 Enter the required value into the yellow data entry field. In the case of List
variables, the index of the element will be assign automatically, starting at 0.
For a Structure variable, the element name (Text) should be entered in the
left field and the element value in the right.
 Note: By default, the element value will take on the type based on the value
entered.
 The value of True or False is interpreted to be a Boolean.
 An Integer or Float is interpreted to be a Quantity.
 Any other text is interpreted to be Text.
If it is necessary to change the type of an element:
1 <Left-Click> the Actions Menu Icon to the left of element to reveal the
actions menu.
2 <Left-Click> the down arrow to the right of the Type menu option to reveal
a list of value types.

Cortex Ltd © 2015 All Rights Reserved Page 54


Cortex Studio V6 User Guide

3 <Left-Click> the required type from the dropdown menu.

 Note: A new element of a specific type can be created by <Left-Click> the down
arrow to the right of the Append menu option and selecting the appropriate type
required.
To add an additional element at the end of a Composite value:
1 <Left-Click> the Actions Menu icon to the left of element to reveal the
Actions Menu.
2 <Left-Click> the Append menu option to add a value after the selected
element.
3 Type the required value in the entry field(s) of the newly created element.
To add an additional element before an existing element:
1 <Left-Click> the Actions Menu Icon to the left of element to reveal the
actions menu.
2 <Left-Click> the Insert menu option to add a value before to the selected
element.
3 Type the required value in the entry field of the newly created element.
To duplicate or remove an element:
1 <Left-Click> the Actions Menu Icon to the left of element to be duplicated
or removed to reveal the actions menu.
2 <Left-Click> the Duplicate (to duplicate) or Remove (to remove) menu
option to add or delete an element.
When the Composite value has been created:
1 <Left-Click> OK to save the text to the property value and exit the
Composite Variable Property Editor Dialog, or <Left-Click> Cancel to close
the Composite Variable Property Editor Dialog without saving any changes.

Figure 56 – Example List Variable in Property Editor Dialog

Cortex Ltd © 2015 All Rights Reserved Page 55


Cortex Studio V6 User Guide

Figure 57 – Example Structure Variable in Property Editor Dialog

To assign a Composite value to a property from an existing Composite variable:


1 <Left-Click> the ellipsis at the right of the property field to open the
Composite Variable Property Editor Dialog.
2 <Left-Click> the Reference an existing variable tab at the top of the
editor dialog.
3 <Left-Click> the required initialising variable from the list of Variables
displayed in the dropdown menu to enter it into the data entry field.
4 <Left-Click> OK to save the text to the property value and exit the
Composite Variable Property Editor Dialog, or <Left-Click> Cancel to close
Composite Variable Property Editor Dialog without saving any changes.

4.2.12 Adding Notes


It is recommended good practise for flow developers to annotate a flow with Notes to
summarise what each of the main areas of a Flow is meant to do. This will improve
maintainability of the Flow.
To create and populate a Note:
1 <Right-Click> on the workspace where the Note is to be inserted to reveal a
context menu.
2 <Left-Click> the Add note menu item to add a new Note object. The
Note’s properties will be displayed in the Property Viewer.
3 Set the Text property to the text to be displayed in the Note on the
workspace.
4 If required, the font colour of the Note may be changed by setting the Font
Colour property to one of the pre-set font colours using the property’s Editor
Dialog. The default font colour is Black.
5 If required, the background colour of the Note may be changed by setting the
Background Colour to one of the pre-set font colours using the property’s
Editor Dialog. The default background colour is White.
6 The size of the Note can be adjusted by dragging the left or right sliders of
the Note.
Figure 58 shows an example of two Notes, placed on a Flow’s top-level workspace; Notes
may be placed on any workspace.

Cortex Ltd © 2015 All Rights Reserved Page 56


Cortex Studio V6 User Guide

Figure 58 – Example of two Note Objects on a Workspace

4.3 Creating a New Flow


The various detailed activities and logic that constitute a process are contained within a
Flow, which must be first created.

4.3.1 Creating an Organisational Hierarchy


All flows must be organised within a hierarchical directory structure using container objects
called ‘Groups’.
A top-level Group or Groups should be present, previously created by an Admin user; Figure
59 shows the top-level Group ‘CORTEX’.
 Note: By default (i.e., on a new installation) the top-level list of Groups will be
empty. Admin users can create groups at that level, but other users cannot.

Figure 59 – Default Top-Level Group Container

To create a Group hierarchy:


1 <Left-Click> the Flows icon in the Menu Bar to display the top-level Group
CORTEX.
2 <Left-Click> the CORTEX Group name to open the CORTEX Group.

3 <Left-Click> the ‘+’ icon to the right of the Group name to reveal a drop-
down menu, see Figure 60.

Figure 60 – Default Contents of CORTEX Group Container

Cortex Ltd © 2015 All Rights Reserved Page 57


Cortex Studio V6 User Guide

4 <Left-Click> the Group item from the drop-down menu to create a new
Group under the current Group container. The user will be presented with a
New Group properties form, as shown in Figure 61.

Figure 61 – New Group Properties Form

5 Provide a name for the new Group in the Name field, and optionally provide a
description of the Group in the Description field.
6 If it is necessary, alter the permissions authorising which user-groups may edit
or view this Group. To alter the permissions, <Left-Click> the up-arrow to
the right of Permission Groups to expand a matrix of authorisation rights, and
select the appropriate authorisation.
Additional Groups may be added to the Group hierarchy by navigating to the Group in which
the new Group is to be created and following Steps 3 to 6 detailed above.

4.3.2 Creating a Flow


1 <Left-Click> the ‘Flows’ icon in the Navigation Menu on the left of the
screen to open the Group hierarchy.
2 <Left-Click> the relevant Group(s) to navigate to the required Group
container for the new Flow.
3 <Left-Click> the ‘+’ icon at the right of the Group’s title bar to reveal a
drop-down menu, see Figure 60.
4 <Left-Click> the Flow menu option to open the ‘Create a new Flow’
window.
5 Provide a name for the new Flow in the Name field, and optionally provide a
description of the Flow in the Description field.
 Note: The name of the Flow must not contain any spaces or special characters;
however, hyphens are permitted.
6 If it is necessary, alter the permissions authorising which user-groups may edit
or view this Flow. To alter the permissions, <Left-Click> the up-arrow to
the right of Permission Groups to expand a matrix of authorisation rights, and
select the appropriate authorisation.
7 <Left-Click> the OK button to confirm the name and description.

4.3.3 Adding States to a Flow


A new Flow is prepopulated with a Default Error Handler, a global Variables Container, a
Default UI Configuration object, together with the start of a flow, consisting of a Start Flow
object linked to a State object; see Figure 62.

Cortex Ltd © 2015 All Rights Reserved Page 58


Cortex Studio V6 User Guide

Figure 62 – Flow with Prepopulated Objects

1 <Left-Click> the down arrow icon to the right of the ‘Flow and States’
palette in the Palettes Window to reveal its associated blocks.
2 <Drag> the ‘State’ object from the Flows and States palette onto the Flows
workspace below the existing State.
3 Connect the new State to the existing States. See section 0 for details on how
to connect objects.

4.3.4 Declaring Variables


After creating the high-level states, the next logical step is usually to define the Global
Variables that will be used throughout the flow.
To declare a variable:
1 <Double Left-Click> on the Variable Store in which the variable is to be
defined to open its workspace. For Global Variables, open the Global
Variables Store on the Flow’s top-level workspace; for local Variables, open
the Variable Store on the State’s workspace.
2 Insert the appropriate Variable Definition block into the workspace by:
a. <Left-Click> the down arrow icon to the right of the ‘Variable Definition’
palette to expand it to reveal the Varible Definition blocks.
b. <Drag> the appropriate Variable Definition block onto the relevant
Variables Store workspace.
3 Set the Name property of the new variable (default: ($)NO-NAME) to an
appropriate name.
See Table 2 for further information about the properties associated with a variable.

4.3.5 Initialising Variables


All variables, except for a Table variable, may be given an initial value (initialised) at the
time of declaration. This is a more expedient method of giving a variable a ‘starting value’
than using function blocks to set an initial value during the execution of a Flow.
To initialise a variable at the time of declaration:
1 Set the Initial Value property of the variable to the required value using
literal text, or use the Property Editor Dialog, see Section 4.2.11, to enter a
value.

Cortex Ltd © 2015 All Rights Reserved Page 59


Cortex Studio V6 User Guide

 Note: Only Integer, Float, Quantity, Text, Boolean, Timespan, Value, Object, and
Any variable types support initialisation using literal values.
2 Set the Set-Initial-Value property to True, by either entering the literal value
‘True’ directly into the property value field or using the Property Editor Dialog
associated with this property.
3 Optionally set the Initial Variable property to True, using the method in Step
2 above.
See Table 2 for further information about the properties associated with a variable.

Properties of Variable Definitions

Property Name Requirement Description


Name Required Name by which to refer to the variable

Description Optional Free format text to describe the variable

Optional When set to true, the variable is automatically


Set Initial Value assigned the value entered in the Initial Value
Default: False property.

An informational value to indicate that an Initial-Value


should be passed into the flow for correct flow
Optional execution (e.g. when calling the flow from another
Initial Variable
Default: False flow).
 Note: This property is for future use.

Optional When set to true, the variable is made static, meaning


Static Variable
Default: False that it persists between flow executions.

The value the variable is assigned on execution. This


Initial Value Optional property is used in conjunction with the Set Initial
Value property.

Table 2 – Properties of Variable Definitions Blocks

4.4 Using Flow Blocks


4.4.1 Basic Activity Blocks

4.4.1.1 Simple Variable Manipulation


Simple variables can be manipulated using a variety of blocks drawn from the ‘Variable
Blocks’ palette and the ‘Text Manipulation’ palette.
Where a variable manipulation block writes information to a variable, it is important to
ensure that the destination variable, where the information is to be written, is of the
correct Type; for more information on variable Types, see Section 2.1.8.1.
Variable Manipulation
Blocks drawn from the ‘Variable Blocks’ palette have icons that are based on a lowercase,
italic letter ‘x’, with the exception of the ‘Arithmetic Operation’ block which has an icon of
a calculator, see Figure 63. The variable manipulation blocks perform basic functions with
simple variables, including: check that variable exists; set a variable; copy a variable; etc.,
except for the ‘Arithmetic Operation’ block, which can assign the result of complex
arithmetic operations to a variable.

Cortex Ltd © 2015 All Rights Reserved Page 60


Cortex Studio V6 User Guide

Figure 63 – Variable Blocks

Some of these blocks can only allow a single type of target variable, for example the
‘Convert Variable to Text’ function block; other blocks can store their results in a variety of
different variable types; see Table 1 for the allowed target variables types and property
value types.
 Note: Exceptions to Table 1 include the ‘Convert All Variables to Text’ and the
‘Convert Variable to Text’ function blocks, which always store their result in a Text
variable.
 Note: The ‘Delete Variable’ block simply removes any value from the variable; the
variable may be used later in the flow only after it has a value assigned to it, for
example, using the ‘Set Variable’ function block.
For details on the specific functions of these blocks and their individual properties, please
refer to the Cortex Block Reference Guide, available from the Help icon.
Text Manipulation
Text manipulation is undertaken using blocks drawn from the ‘Text Manipulation’ palette;
many of these blocks have icons that are based on an uppercase, italic letter ‘T’, others
have icons based on a square-bracketed ‘RX’ symbol to denote Regex functionality, see
Figure 64.
The text manipulation blocks perform basic functions with Text variables, including:
changing text to upper or lower case; text pattern matching using Regex; etc. For more
information on Regex, see Section 2.1.10.

Cortex Ltd © 2015 All Rights Reserved Page 61


Cortex Studio V6 User Guide

Figure 64 – Text Manipulation Blocks

For details on the specific functions of these blocks and their individual properties, please
refer to the Cortex Block Reference Guide, available from the Help icon.

4.4.1.2 Date & Time Manipulation


Date & Time manipulation is undertaken using blocks drawn from the ‘Date & Time’
palette; all of these blocks have icons that are based on a clock symbol, see Figure 65, and
perform basic functions with DateTime and Timespan variables.

Figure 65 – Date & Time Blocks

The ‘Create DateTime’ and ‘Create Timespan’ blocks assign values to DateTime and
Timespan variables respectively; the properties of these blocks allow each time element
(Day, Hour, Minute, etc.) to be assigned a value individually, either by entering a literal
value or by direct reference to an Integer type variable.

Cortex Ltd © 2015 All Rights Reserved Page 62


Cortex Studio V6 User Guide

Other DateTime and Timespan function blocks allow the manipulation of DateTime and
Timespan variables, including:
 Adding to, and subtracting from, the individual elements of DateTime and
Timespan variables either using a literal value or by direct reference to Integer,
Float or Quantity type variables.
 Creating a Timespan from the difference between two DateTime variables.
 Converting the values of DateTime and Timespan variables to, and from, other
Text type variables. For example, using the ‘DateTime to Text’ block with its
default conversion properties will yield a result similar to:
13/08/2014 02:00:01.
 Note: This result is very different to the result obtained by using the ‘Set Variable’
function block to assign the same DateTime variable to a Text value, which simply
converts the underlying DateTime structure into text:
structure (YEAR: 2014, MONTH: 8, DAY: 13, HOUR: 2, MINUTE: 0, SECOND:
1, MILLISECOND: 0)
For details on the specific functions of the ‘DateTime and Timespan blocks’ and their
individual properties, please refer to the Cortex Block Reference Guide, available from the
Help icon.

4.4.1.3 Composite Variable Manipulation


List Manipulation
Lists are a sequence of elements; although each element can be of a different variable
type, it is recommended that a list only contains elements of the same type. The
manipulation of Lists is undertaken using blocks, drawn from the ‘List Blocks’ palette; these
have icons that are based on a set of horizontal bars representing a list, see Figure 66.

Cortex Ltd © 2015 All Rights Reserved Page 63


Cortex Studio V6 User Guide

Figure 66 – Examples of List Blocks

Lists may be initialised when being declared, or they may be initialised during the flow
using the ‘Create List’, ‘Create from Delimited Text’ or ‘Create from File’ function blocks.
To initialise a List using the ‘Create List’ function block:
1 <Left-Click> the ellipsis at the right of the Initialisation Values property to
select the field to reveal the Property Editor Dialog.
2 Create the initialisation List or reference an existing List variable, see Section
4.2.11.3 for more information on the Property Editor Dialog.
To initialise a List using the ‘Create from Delimited Text’ function block:
1 Enter the delimited text, either literally or by direct reference to a Text
variable, into the Delimited Text property value field.
2 Ensure that the delimiter in the Delimiter property value field matches that
of the delimiters in the source text.
To initialise a List using the ‘Create from File’ function block:
1 Enter the source filename as text into the Source File property value field.
2 Ensure that the delimiter in the Delimiter property value field matches that
of the delimiters in the source file.
Lists may be manipulated in a number of different ways:
 Elements may be inserted in any position into an existing List (‘Insert Element’
block).

Cortex Ltd © 2015 All Rights Reserved Page 64


Cortex Studio V6 User Guide

 Elements may be removed from Lists, either by removing duplicate values


(‘Remove Duplicate Elements’ block), by removing a specific element (‘Remove
Element by Position’ block), or by removing elements with a specific value
(‘Remove Element by Value’ block).
 Two separate Lists may be joined into one List (‘Join Lists’ block).
 The values from two Lists may be combined into a single List (‘Combine Values
from Lists’ block).
 One List may be subtracted from another (‘Subtract Lists’ block).
 Sub-Lists may be extracted from a List (‘Extract Sublist’ and ‘Filter using Regex’
blocks).
 An element of a List may be modified (‘Set Element’ block).
All of these manipulations use the principle of taking a source List, performing the required
manipulation, and writing the result back into a destination or target List; this enables the
source List to remain unmodified and its modifications written into a separate List. If it is
not necessary to keep the source List after the manipulation is performed, the source List
can also be used as the destination List.
The following procedure provides an example of List manipulation using separate source
and destination Lists. This example demonstrates the configuration of the ‘Remove
Element by Position’ block, see Figure 67.
To remove a specific element from a List:
1 Set the Save To property to reference the destination List variable.
2 Set the List Variable Name property to reference the source List variable.
3 Set the Element Position property to reference the position in the source List
of the element to be removed, by either:
a. Using literal value.
Or,
b. Using a variable to identify the element to be removed.

Destination List (modified)


Source List (unmodified)
Element Reference

Figure 67 – Configuration of a List Function Block

Structure Manipulation
Structures are collections of named variables; each element of a Structure is independent
of other elements of the same Structure and can be of different variable types. The
manipulation of Structures is undertaken using blocks, drawn from the ‘Structure Blocks’
palette, that have icons that are based on three horizontal pairs representing the name-
value concept of each element of the Structure, see Figure 68.

Cortex Ltd © 2015 All Rights Reserved Page 65


Cortex Studio V6 User Guide

Figure 68 – Examples of Structure Blocks

Structures may be initialised when being declared, or they may be initialised during the
flow using the ‘Create Structure’, ‘Create from List’ or ‘Create from File’ blocks.
To initialise a Structure using the ‘Create Structure’ block:
1 <Left-Click> the ellipsis at the right of the Initialisation Values property to
select the field to reveal the Property Editor Dialog, see Section 4.2.11.
2 Create the initialisation Structure or reference an existing Structure variable.
To initialise a Structure using the ‘Create from Structure’ block:
1 Set the Save To property to reference the Structure to be created.
2 Set the Element Names property to assign the source List to be used to
initialise the Structure element names.
3 Set the Element Values property to assign the source List to be used to
initialise the Structure element values.
To initialise a Structure using the ‘Create from File’ block:
1 Set the Save To property to reference the Structure to be created.
2 Set the Source File property to reference the source file to be used to
initialise the Structure. The source file must be referenced by its full-path.
3 Set the Name Value Separator property to the correct separator character
used in the source file.
Structures may be manipulated in three different ways:
 A new element may be added or an existing element may be modified in an
existing Structure (‘Add or Modify Element’ block).
 An element may be removed from a Structure (‘Remove Element’ block).
 An element value may be retrieved from a Structure (‘Get Element Value’
block).
The ‘Add or Modify Element’ and ‘Remove Element’ blocks manipulate Structures using the
principle of taking a source Structure, performing the required manipulation, and writing
the result back into a destination or target Structure. This enables the source Structure to
remain unmodified and its modifications written into a separate Structure. If it is not
necessary to keep the source Structure after the manipulation is performed, the source
Structure can be used as the destination Structure.
The following procedure provides an example of Structure manipulation using separate
source and destination Structures. This example demonstrates the configuration of the ‘Add
or Modify Element’ block, see Figure 69.
To modify an existing element within a Structure:
1 Set the Save To property to reference the destination Structure variable.

Cortex Ltd © 2015 All Rights Reserved Page 66


Cortex Studio V6 User Guide

2 Set the Structure Variable Name property to reference the source Structure
variable.
3 Set the Element Name property to identify the element in the source
Structure to be modified.
4 Set the Element Value property to the new value for the named element.

Destination Structure (modified)


Source Structure (unmodified)
Name of element to be modified
New value for element

Figure 69 – Configuration of a Structure Function Block

Table Manipulation
Tables contain a number of fields, organised into a rectangular grid of rows and columns;
the fields in each row must be of the same type for any given column. Tables are most
often used as part of databases, with each row representing a separate record. The
manipulation of Tables is undertaken using blocks, drawn from the ‘Table Blocks’ palette,
that have icons that are based on a rectangular grid representing a table, see Figure 70.

Figure 70 – Examples of Table Blocks

Cortex Ltd © 2015 All Rights Reserved Page 67


Cortex Studio V6 User Guide

Unlike other types of variables, Tables cannot be initialised when they are declared; they
can only be created during the flow using the ‘Create Table’ or ‘Clone Table’ blocks drawn
from the ‘Table Blocks’ palette, or using the ‘Query DB’ block, drawn from the ‘Database
Blocks’ palette. For information on creating a Table from a database query, see Section
4.4.7.2.
To create a Table using the ‘Create Table’ function block:
1 Set the Save To property to reference the Table to be created.
2 Set the Columns property to a literal Structure or to reference a Structure
variable.
 Note: When using a Structure variable to define the columns, the Structure’s
elements have to be in the format ‘Column_Name:“Variable_Type”’; the values
entered as “Variable_Type” must only be variable types, e.g., “text”, “integer”,
etc.
3 If required, set the Primary-Key-Columns property to List value containing the
names of the columns to be Primary Keys.
 Note: The values within the Primary Keys column should be unique within each
row.
New columns and rows, complete with values, may be added to an existing Table using the
‘Insert Column’ and ‘Insert Row’ blocks respectively. When adding a column, the field
values are referenced as a List; when adding a row, the field values are referenced either
as a Structure, where the Structure element’s name corresponds to columns in the table, or
as a List. If a List is used, it will be assumed that the first element of the List matches the
first column; the second element matches the second column, etc.
Similarly, the values contained in a Table’s columns or rows may be extracted using ‘Get
Column’ and ‘Get Row’ blocks respectively. Values extracted from a Table’s column are
stored in a List variable, whereas values extracted from a Table’s row are stored in a
Structure variable.
Columns and Rows may be deleted from Tables using the ‘Delete Column’ and ‘Delete Row’
blocks respectively. These two function blocks use the concept of a source and a
destination Table, enabling the source Table to remain unaltered by the manipulation.
The Table’s columns may be renamed or their properties modified, e.g., change the
Primary Key columns, by using the ‘Rename Column’ and ‘Modify Table Properties’ blocks
respectively.
Tables may also be manipulated by subtracting one Table (e.g., Table A) from another
(e.g., Table B) to form a third Table using the ‘Subtract Table’ block. This function block
subtracts from one Table any records, or rows, that match the Primary Keys (if specified),
or whole record (if no Primary Keys are specified), that are contained in the subtrahend
Table (i.e., Table A). Tables may also be manipulated by combining two Tables that have
the same schema, or column structure, to form a third Table using the ‘Join Tables’ block.
The most powerful Table manipulations are those that query the Table to extract data,
similar to a database query. The Table palette contains three distinct function blocks to
query Table variables:
 ‘Get Row Value / Single Row Query’ block to retrieve the value from a single
field of the Table and store it in a simple variable.
 ‘Multi-row Simple Query’ block to retrieve the values in a column from all the
rows in the Table that have values in another column that match a particular
value, storing the result in a List variable.
 ‘Full Query’ block to retrieve all the rows in a Table where the values in a
particular column match a query string, and place a copy of the resultant rows
in another Table.

Cortex Ltd © 2015 All Rights Reserved Page 68


Cortex Studio V6 User Guide

Figure 71 shows an example configuration of the ‘Full Query’ function block acting upon a
source Table (MYTABLE) to query the column ‘USERAGE’ for values greater than 12 and
store any resultant rows in a second Table (RESULTSTABLE).
 Note: References to column names within a query string must be enclosed in single
braces; e.g., ‘{ColumnName}’.
The query strings allowed in a full query are:
 The comparative operators:
 Greater than (‘>’)
 Greater than or equal to (‘>=’)
 Less than (‘<’)
 Less than or equal to (‘<=’)
 Equal to (‘=’)
 Not Equal to (‘/=’)
For example: {USERAGE} > 12, or: {USERAGE} /= 12
 The simile operator ‘like’ in conjunction with text string. The text string must
be enclosed in single inverted commas and percentage signs, i.e., ‘%string%’.
For example: {USERNAME} like ‘%e%’, which will search for the letter ‘e’ in
the USERNAME fields; in the example shown in Figure 71, the result from such a
query would result in the two rows containing the UserNames of ‘Fred’ and
‘Dave’.
 The Boolean operators ‘AND’, ‘OR’ and ‘NOT()’, enabling complex queries to be
formed.
For example: {USERNAME} like ‘%e%’ AND NOT({USERAGE} > 12); in the
example shown in Figure 71, the result from such a query would result in the
row containing the UserName of Fred.

Figure 71 – Example of Full Query Function Block Action

4.4.2 Decision Branching


Most processes will perform different actions, dependent on logic that evaluates certain
criteria during the time of execution; for example, when entering an employee’s details
into an HR system, it may be necessary to take a different course of action if the
employee’s details have already been input into the system.
Decisions can be taken at any point in the flow, enabling a different sequence of activities
to be executed dependent on calculated values, user input or interaction with external
systems.

Cortex Ltd © 2015 All Rights Reserved Page 69


Cortex Studio V6 User Guide

There are five types of decision branches within Cortex:


1. Branching on the result of an expression
2. Branching on the occurrence of an Error Condition
3. Branching as the result of User Interaction.
4. Branching on the existence of certain objects or variables
5. Branching as a result of performing Loops
It is also possible to branch dependent on the status of a special type of object known as a
‘Semaphore’; for more information on Semaphores, see Section 2.1.11.

4.4.2.1 Branching on the Result of an Expression


Branching on the Result of Logical Expressions
The direction of execution of a Flow can be decided based on the result of a logical
expression that compares two or more elements, typically variables, to yield a result of
‘True’ or ‘False’. For example, the expression “4 is greater than 2”, written as 4 > 2, is
obviously ‘True’; whereas the expression “’Sam’ equals ‘John’”, written as ‘Sam’ =
‘John’, is obviously ‘False’. Using variables in the expressions, instead of fixed strings or
numbers, enables the Flow to execute different activities dependent on the value of the
variables at the time the Flow execution undertakes the comparison. For more information
about logical expressions, see Section 2.1.9.
Branching on the Result of a Regex (Regular Expression) Match
A Regex is a sequence of characters that forms a search pattern. Branching decisions can
be made by searching for a particular sequence of characters within some source text, and
then executing different activities dependent on whether a match was found or not. For
example, Regex could be used to identify the word ‘crash’ in a news article or any of its
derivatives, e.g. ‘crashed’, ‘crashes’, ‘crashing’, etc., and execute different activities if a
match is found. For more information on Regex, see Section 2.1.10.
Expression branching blocks can be found in the ‘Branching Blocks’ palette.
 Note: The ‘Pattern Match’ (using Regex) blocks are duplicated in the ‘Text
Manipulation’ palette.
The simple flow control function blocks in the ‘Branching Blocks’ palette have two outputs
to direct the execution of the Flow in one of the two directions. However, the 4-Way, 6-
Way & 8-Way Pattern Match blocks have 4, 6 and 8 outputs respectively, whereas the ‘Free
Semaphore’ and ‘Check Semaphore with Queue’ blocks only have one output (see Section
2.1.11 for information on semaphores). Each output connection point of a flow control
block must link to a function block.
See Figure 72 for example of Flows that branch as a result of a logical expression and that
branch as a result of a Regex pattern match.

Figure 72 – Logical Expression Branch and Regex Expression Branch Examples

Cortex Ltd © 2015 All Rights Reserved Page 70


Cortex Studio V6 User Guide

4.4.2.2 Branching on the Occurrence of an Error Condition


Errors typically occur when interacting with external systems; for example, an error may
occur if the network connecting the Cortex server to an external database is temporarily
unavailable. Cortex can handle errors in several different ways by branching to a specific
set of activities should an error occur. For more information on error handling, see Section
4.4.8.

4.4.2.3 Branching due to User Interaction


There are many occasions where flows need to interact with users, either to obtain
information, e.g., the quantity of items requested to be purchased, or to perform different
activities dependent on which button a LivePortal user clicks, e.g. the activities required to
store information entered on a web page would be different to those required if the user
cancelled the storage process. For more information on User Interaction, see Section
4.4.9.

4.4.2.4 Branching on the Existence of Objects or Variables


For a flow to process information, or perform an activity on an object, it is necessary that
the information or object exists. Cortex provides a selection of decision blocks to
determine if the information or object exists or not, and then execute different activities
accordingly.
 Note: The ‘Check Variable Exists’ blocks are duplicated in the ‘Variable Blocks’
palette.

4.4.2.5 Loops
Loops are a special class of branching block in that they combine elements of a logical
expression decision block with other activities to enable the easy creation of a logic flow
that loops repeatedly until a certain condition is met.
For Loops
‘For Loops’ use a counter variable that is automatically set to the value contained in the
block’s Start-Index property at the initial execution of the loop. During each successive
execution of the loop, the value referenced in the Increment property is added to the
counter variable. The loop will exit when the counter variable is equal to the value
contained in the End-index property. Any of these properties may be assigned a value
contained within a variable, so that the number of times the loop is executed is dependent
on calculations performed in the flow during execution.
 Note: The counter must be an Integer type variable.
 Note: The Increment property can have a negative value.
See Figure 73 for an example of a ‘For Loop’ block used in a flow.

Figure 73 – Example Use of ‘Loop’ Block

Cortex Ltd © 2015 All Rights Reserved Page 71


Cortex Studio V6 User Guide

For Each Loops


‘For Each Loops’ are a special type of loop used exclusively for sequentially processing all
the elements contained in a List or rows in a Table. Each time the loop executes, a
successive element of the List, or row of the Table, will be extracted and assigned to the
looping variable. The loop will exit after the last item in the List, or row in the Table, has
been processed.
 Note: The looping variable must be a Structure type variable that contains an
Integer variable (to hold the index or current position within the list being
processed) and another variable to hold the current element of the list being
processed that matches that of the list type if known, or of type Value if not. For
example, if the List is a list of Quantity Variables, then the looping variable must
be Structure type variable containing an Integer variable and a Quantity variable.
In order to process each element of the List or Table, it is necessary to reference the
members of the looping variable Structure explicitly by name whilst inside the loop. For
example, if the looping structure variable is named ‘LOOPVAR’, which contains an Integer
variable ‘INDEX’ and a value collection variable ‘VALUE’ (of the correct type), then the
current index of the List of Table being processed can be accessed using <LOOPVAR.INDEX>
and the current looping value can be accessed using <LOOPVAR.VALUE>.
See Figure 74 for an example of a ‘For Loop’ block used in a Flow.

Figure 74 – Example Use of ‘For Loop’ Block

4.4.3 Semaphores
Semaphores are special objects that can only be accessed using Semaphore function blocks.
The only actions that can be performed with Semaphores are to ‘Check and Set’ the
Semaphore, and ‘Clear’ the Semaphore.
At the beginning of the activity to be protected, the Semaphore must first be checked to
ensure that no other instance of the flow has already set the Semaphore and is executing
the protected activities. If the Semaphore is clear, it should then be immediately set to
signal that this part of the flow is now protected; if the Semaphore is set, then either the
Flow execution should take a different path (to avoid the protected area) or this instance
of the Flow is queued in order to gain access to the protected area once the existing user
has left this part of the Flow and cleared the Semaphore.
The action of checking and setting the Semaphore is undertaken in a single function block.
At the end of the protected activity, the Semaphore must be cleared to allow other
instances of the Flow to use the protected area.
Cortex can not only provide exclusive access to a protected activity (i.e., only one instance
is allowed to execute the activity at once), but it can also provide restrictive access to a
protected area, i.e., it can limit the number of simultaneous executions within a protected
area; this is useful when external systems can only handle a certain number of
simultaneous connections.
 Note: More than one Semaphore can exist within the same Flow; each Semaphore is
referred to by the name set in the Semaphore Name property.

Cortex Ltd © 2015 All Rights Reserved Page 72


Cortex Studio V6 User Guide

 Note: The Semaphore is automatically created; it does not have to be declared in a


Variables Store.
See Figure 75 for example of Flows using the ‘Check Semaphore’ block and the ‘Check
Semaphore with Queue’ block.

Figure 75 – Example Use of ‘Check Semaphore’ and ‘Check Semaphore with Queue’

4.4.4 Subtasks
For larger or more complex flows, the use of Subtasks should be considered. A Subtask is a
collection of logic, encapsulated within a single block; however, any given Subtask may be
referenced multiple times within a Flow, or indeed in different Flows, thereby removing
the need to replicate the same logic in several different places. See Figure 77 for an
example of re-using Subtasks.
The activities performed by a Subtask are defined in a Subtask object, defined in a similar
way to a Flow; however, when this Subtask is subsequently invoked within a Flow, the
actual Subtask is referenced by a separate ‘Execute Subtask’ block, see Figure 76.

Figure 76 – ‘Execute Subtask’ Function Block

A Subtask has global scope within the Cortex system, and hence must have a unique name;
any Subtask may be called from any Flow, allowing the re-use of common logic between
Flows.
Subtasks may also be recursive, i.e. it is possible to put an ‘Execute Subtask’ block within
its own Subtask definition so that an execution of the Subtask will cause another execution
of the same Subtask, and so on.
 Note: If Subtasks are nested in this way, the Subtask should contain logic to
prevent the Subtask invoking the execution of itself continuously, otherwise the
intended purpose of the Flow will not be achieved and the Cortex server will
eventually run out of memory.
An ‘Execute Subtask’ block, in common with all function blocks, may be cloned; cloning will
replicate all the Properties of the original, i.e., the clone will refer to the same Subtask
definition as the original. Therefore, it is necessary to check the Properties of the cloned
object to ensure that appropriate property values are set.

Cortex Ltd © 2015 All Rights Reserved Page 73


Cortex Studio V6 User Guide

Figure 77 – Re-using Subtasks

Variables may be passed to the Subtask for each instance of use, and its results passed back
to the calling flow. It is also possible to use global or local variables defined in the Flow
executing (or calling) the Subtask within the Subtask itself. However, care must be taken
when doing this as the different Flows invoking the subtask may not have the same
variables defined.
 Note: Recommended practice is to pass variables into the subtask at the point
where it is executed.
To create a Subtask:
1 <Left-Click> on the Flows icon in the Menu Bar, to reveal the group
organisation of any existing Flows.
2 Navigate through the group hierarchy to the desired group in which to define
the Subtask.
3 <Left-Click> on the ‘+’ icon on the Group Title Bar to reveal a dropdown list
of actions.
4 <Left-Click> on Subtask to create a new Subtask.
 Note: The variables that will be used to receive values passed to the Subtask flow,
and the variables that will be used to pass values back from the Subtask flow, must
be declared in the Subtask’s Variables Store. For more information on declaring
variables, see Section 4.3.4.
Link the main Flow’s ‘Execute Subtask’ block to the predefined Subtask flow and map the
variables to be passed:
 Note: Before any variables can be mapped, they must be declared in the
appropriate Variables Store. For more information on declaring variables, see
Section 4.3.4.
1 <Left-Click> on the ellipsis to the right of Subtask-Name or Variables-To-
Pass property of the ‘Execute Subtask’ block to open the dedicated Property
Editor Dialog, see Figure 78.

Cortex Ltd © 2015 All Rights Reserved Page 74


Cortex Studio V6 User Guide

Figure 78 – Execute Subtask Dedicated Property Editor Dialog

 Note: Selecting the dedicated Property Editor Dialog from the Variables-To-Return
property will activate the Property Editor Dialog, defaulting to the ‘Map Output’
tab. The ‘Execute Subtask’ block must be associated with a predefined Subtask,
using the ‘Map Inputs’ tab before any variables can be mapped.
2 <Left-Click> the To: field to reveal a list of available Subtasks, and select
the appropriate Subtask definition to link with this ‘Execute Subtask’ block.
To pass values to a Subtask:
1 Ensure the Map Input tab on the Property Dialog Editor is selected.
2 <Left-Click> the Add button to insert a new set of ‘value/variable to
variable’ mapping fields.
3 Enter the value or variable name to be passed to the Subtask using the
Property Editor Dialog activated by the ellipsis to the right of the left-most
field.
4 Enter the variable declared in the Subtask flow that will be used to receive
the passed value into the right-most field.
5 Add any additional values or variables to be passed to the Subtask by
following Steps 2 to 4; see Figure 79.
 Note: The Flow variable and its corresponding Subtask variable must be of the same
Type.

Figure 79 – Example of Map Inputs Dedicated Property Editor Dialog

To return values from a Subtask:


1 Ensure the Map Output tab on the Property Dialog Editor is selected.
2 <Left-Click> the Add button to insert a new set of ‘value/variable to
variable’ mapping fields.
3 Enter the value or variable name to be passed from the Subtask using the
Property Editor Dialog activated by the ellipsis to the right of the left-most
field.

Cortex Ltd © 2015 All Rights Reserved Page 75


Cortex Studio V6 User Guide

4 Enter the variable declared in the main Flow that will be used to receive the
passed value into the right-most field.
5 Add any additional values or variables to be passed from the Subtask by
following Steps 2 to 4; see Figure 80.
 Note: The Subtask variable and the corresponding Flow variable must be of the
same Type.

Figure 80 – Example of Map Outputs Dedicated Property Editor Dialog

4.4.5 Wireless Blocks


For large, complex Flows, the complexity of the connections linking all the blocks together
may reduce the overall visibility and understanding of the Flow as a whole. In such
circumstances, it may be desirable to utilise ‘wireless’ blocks to enable areas of the Flow
to be interconnected without using visible connection points, see Figure 81.
Flow execution jumps from a coloured Wireless Sender block to a Wireless Receiver block of
the same colour on the same workspace.

Wireless
Receivers

Flow execution jumps from


Blue Wireless Sender to Flow execution jumps
Blue Wireless Receiver from Red Wireless Sender
to Red Wireless Receiver

Wireless
Senders
Figure 81 – Wireless Senders and Receivers used in a Flow

Cortex Ltd © 2015 All Rights Reserved Page 76


Cortex Studio V6 User Guide

Wireless Sender and Receiver blocks are drawn from the ‘Miscellaneous’ palette, see Figure
82.

Wireless Sender Wireless Receiver


Block Block
Figure 82 – Wireless Senders and Receivers Blocks

Both the Wireless Sender and Wireless Receiver blocks each have two properties:
 A mandatory Link Colour property, which defines the colour associated with this
block. The colour chosen must be from a defined list of colours, which are
accessible through the Property Editor Dialog.
 An optional Description property, which can be assigned free format literal
text.
 Note: There must be only one Wireless Receiver block of any given colour on a
workspace, otherwise Flow execution will fail.

4.4.6 Accessing External Systems


External systems may be accessed using external interaction function blocks. Cortex Studio
provides a range of built-in interaction blocks to undertake basic networking functions,
interact with the underlying operating system of Cortex server, and communicate with
external databases; Cortex also supports a range of interfaces to interact with 3 rd party
systems.

4.4.6.1 Using Interface Function Blocks


For Interface function blocks to correctly interact with external systems, it is necessary for
the external system to be functioning correctly and be accessible from the Interface
Service. These prerequisites are usually outside the control of the developer and, if not
met, are likely to cause Input/Output (I/O) errors when the flow is executed.
To aid the developer, all Interface blocks contain additional properties to:
 Simulate data received from an external system for testing and debugging
purposes. For more information on testing and debugging Interface blocks, see
Section 5.2.1.
 Enable multiple retries in connecting to an external system should the function
block fail to connect on the first attempt or there is an error in communicating
with the external system.
Figure 83 shows an example Interface function block and its properties, highlighting those
properties relating to interface simulation and multiple retries due to communication
errors.

4.4.6.2 Handling Errors When Accessing External Systems


If an error occurs within an API block, the API call can be automatically retried a number of
times before an error is raised to the calling Flow. Which errors cause automatic retries
and how many retries are attempted are defined within the block’s properties.
For further information on Error Handling, see Section 4.4.8.

Cortex Ltd © 2015 All Rights Reserved Page 77


Cortex Studio V6 User Guide

Interface Retries
Properties

Interface Simulation
Properties

Figure 83 – Additional Properties of an Interface Block

4.4.6.3 Interface Simulation Properties


Every Interface block has two simulation properties that enable it to emulate data being
received from an external system.
Simulate-Call: When this property is set to True, the value of the Simulated-Result
property will be stored in the block’s target variable without Cortex attempting to
communicate with the external system. When this property is set to False, the function
block attempts to receive data from the external system and the value of the Simulated-
Result property is ignored.
Simulated-Result: The data to be emulated as being received from this external
interaction should either be entered as text or reference a value stored in an appropriate
variable. The data in the Simulated-Result property is only used if the Simulate-Call
property is set to True.
 Note: It is necessary to make sure that the simulated result entered in the
Simulated-Result property is in the same format as would be returned from a real
interaction. It may be necessary to refer to the system administrator or specific
Interface Module documentation.
Interface Retries Properties
Every interface block has three properties that enable the interface block to attempt to
exchange data with an external system multiple times before raising an error.
Api-Call-Retries: This property determines the number of times the interface block will
retry the data exchange with the external system before raising an error. The interface
block will only attempt a retry if the error received from the underlying subsystem matches
the error filter defined in the Api-Call-Retry-Errors property.
If the maximum number of retries has been attempted, or if the error message received
from the underlying subsystem does not match the error filter definition, the block will
raise an error, which can then be handled by a variety of error handling techniques. See
Section 4.4.8 for more information on handling errors.
Api-Call-Wait-Retry-Seconds: This property determines the period, in seconds, that the
interface will wait before attempting to retry to exchange information with the external
system.
Api-Call-Retry-Errors: This property defines the error filter for attempting data exchange
retries. If any text in the received error message from the underlying subsystem matches
one of the text strings defined in this property, the function block will retry the data
exchange for a maximum number of times as defined in the Api-Call-Retries property.
The default error filter defined in this property is (“*”), meaning that all error messages
will be matched; however, the error filter can be changed to match one or more sequences
of characters (i.e., a partial match) in the received error message.
 Note: The string text matched with this property is case sensitive.

Cortex Ltd © 2015 All Rights Reserved Page 78


Cortex Studio V6 User Guide

To define a custom list of text strings to match error messages received from the
underlying subsystem:
 Set the Api-Call-Retry-Errors property to a List of the required text strings to
partially match any error messages received.

4.4.7 Database Interaction


A range of 3rd party databases may be accessed within the Flow execution using pre-
installed database activity function blocks. Interfacing with external databases consists of
three phases:
1. Connect to external database.
2. Perform a database query to exchange data between the Flow and the external
database.
3. Close the connection to the external database.
 Note: Cortex can support multiple simultaneous external database connections,
including multiple connections to the same database.

4.4.7.1 Connect to an External Database


To connect to an external database, various parameters are sent from the interface to
identify the server and database, and provide user authentication, in the form of a
‘connection string’. In return, the database sends a unique session identifier, which must
be used in any database queries and when finally closing the database connection.
To create a connection to an external database, the ‘Open Connection’ block should be
used from the ‘Database Blocks’ palette. In addition to the Interface Retries properties
and the Interface Simulation properties normally found on external activity function blocks
(see Section 4.4.6.1), the ‘Open Connection’ block also has four properties that are specific
to connecting to an external database; see Figure 84.
Parameter-To-Store-Results
The Parameter-To-Store-Results property must reference a Structure type variable. After
the database has authenticated the user, the unique session identifier for this connection is
stored in this variable for use in other database function blocks using the same connection.
Database-Type
The Database-Type property uses a Text value to identify the type of database to which a
connection is being established. The permitted options for this property are:
 “SQL” (default), “SQLSERVER”: connects to Microsoft SQL Server databases.
 “ORACLE”: Connects to an Oracle database using the Oracle client drivers
(required to access resilient clusters of Oracle servers).
 “ORACLEDIRECT”, “ORADIRECT”: Connects to an Oracle database directly
without requiring the Oracle client drivers.
 “ODBC”: Any data source defined in the server ODBC data sources.
 “OLEDB”, “OLE DB”: Any OLE compliant database.
Connection-String
The Connection-String property defines the server, database, user credentials, and possibly
other parameters required by the database. For example, the connection string to
establish a connection to Microsoft SQL Server 2012 using standard security would be:
Server=myServerName; Database=myDataBase; User Id=myUsername;
Password=myPassword;
An extensive list of connection strings that can be used to connect to a wide variety of
databases can be found at: http://www.connectionstrings.com

Cortex Ltd © 2015 All Rights Reserved Page 79


Cortex Studio V6 User Guide

Command-Timeout
The Command-Timeout property defines the amount of time the function block will wait
for a response from the external database before an error is raised. If the function times-
out, then connection retries will be attempted in accordance with the Interface Retry
Properties, see Section 4.4.6.1.
In common with all API blocks, the database interaction blocks provide a third, dedicated
error-handling connection point on the right edge of the block to enable additional logic to
be followed to handle the error.

Interface Retries
Properties

Interface Simulation
Properties

Database Specific
Properties
Figure 84 – Database Open Connection Properties

4.4.7.2 Perform Query with the External Database


The ‘Database Query’, ‘Execute Scalar Query’ and ‘Execute Stored Procedure’ function
blocks, drawn from the ‘Database Blocks’ palette, can be used to perform native database
queries to read and write information from/to the external database.
 Note: Any queries performed on the database must use the unique session
identifier obtained when the connection to the database was first established using
the ‘Open Connection’ block. For more information, see Section 4.4.7.1.
In addition to the Interface Retries properties and the Interface Simulation properties
normally found on external activity function blocks (see Section 4.4.6.1), the function
blocks that perform database queries also have two common properties that are specific to
performing a database query; see Figure 85.
Db-Connection-Parameter
The Db-Connection-Parameter property identifies the Structure variable that contains the
unique session identifier obtained using the ‘Open Connection’ function block.
Parameter-To-Store-Results
The Parameter-To-Store-Results property identifies the variable (see note below) in which
the results from the database query are to be stored. The ‘Database Query’ block will
return a Table type if the Convert-To-Structure property is set to False, or it will return a
Structure type if the Convert-To-Structure property is set to True. The ‘Execute Scalar
Query’ block will return a single value, the type of value will depend on the specifics of the
query and the table(s) being queried; therefore, a matching type of variable or a value type
variable must be used.
 Note: If the database query performs an INSERT, UPDATE or DELETE function on the
external database the text string “NULL” will be returned. In this instance, the
Parameter-To-Store-Results property must be assigned a Text type variable.
The ‘Database Query’ and ‘Execute Scalar Query’ blocks also have a Query property:
Query
The Query property contains the database query or data manipulation operations,
expressed in the native language of the external database and entered as Text.
Whereas, the ‘Execute Stored Procedure’ function block has two additional properties to
invoke the stored procedure in the external database, namely:

Cortex Ltd © 2015 All Rights Reserved Page 80


Cortex Studio V6 User Guide

Stored-Procedure-Name
The Stored-Procedure-Name property contains the name of the stored procedure to be
executed in the external database.
Arguments-Parameter
The Arguments-Parameter property contains any arguments, not already contained in the
Stored-Procedure-Name property, that are to be passed to the stored procedure when it is
executed.

Interface Retries
Properties

Interface Simulation
Properties

Database Specific
Properties
Figure 85 – Query Database Properties

4.4.7.3 Close Connection to the External Database


The ‘Close Connection’ function block is used to close the session with an external
database.
 Note: It is important to close database connections immediately after use; failing
to close a connection can ultimately prevent other people and systems from
connecting to a database.
 Note: The ‘Close Connection’ block must use the unique session identifier obtained
when the connection to the database was first established using the ‘Open
Connection’ block. For more information, see Section 4.4.7.1.
In addition to the Interface Retries properties and the Interface Simulation properties
normally found on external activity function blocks (see Section 4.4.6.1), the ‘Close
Connection’ function block has one property that is specific to the database; see Figure 86.
Db-Connection-Parameter
The Db-Connection-Parameter property identifies the Structure variable that contains the
unique session identifier, obtained using the ‘Open Connection’ function block, to identify
the database session to be closed.

Interface Retries
Properties
Interface Simulation
Properties

Database Specific
Properties
Figure 86 – Database Close Connection Properties

4.4.8 Error Handling


Errors can occur during Flow execution for a variety of reasons; there may be an error in
the logic of the flow; for example, the Flow attempts to use a variable before it has been

Cortex Ltd © 2015 All Rights Reserved Page 81


Cortex Studio V6 User Guide

set, or interaction with an external system may fail if the external system is unavailable at
that time.
In either of these examples the Flow cannot continue its execution and an error condition is
raised. Cortex supports a number of ways in which these error conditions can be handled
to ensure that the overall flow can still complete in one way or another, or if the error is so
severe that the process cannot complete, allow compensatory actions to be taken such as
sending failure notifications to the appropriate people.

4.4.8.1 Automatic Retries


All block activities that involve interaction with external components or systems can be
configured to retry the activity automatically after a configured delay period for a
configurable number of times when there is an error in interacting with the external system
before generating an error in the flow. For example, if a network issue prevents a file from
being copied to a network drive, an automatic retry after 10 minutes may complete
successfully as the network issue might have been resolved by then.

4.4.8.2 Block Error Handling


Errors can be handled at the function block level. ‘Local Error Handler’ blocks are special
kinds of Flow control blocks that divert the execution to a different set of blocks when an
error occurs. By attaching a Local Error Handler block to a function block, any errors
incurred whilst executing the function block will be caught and cause the Flow below the
Local Error Handler block to be executed to perform remedial actions.
 Note: The Local Error Handler block only catches errors associated with the block
to which it is attached.
Local Error Handler blocks are structured in that multiple Local Error Handler blocks may
be connected together and associated with a single function block; each configured to
handle different sets of error conditions. For example, the error condition “Source file
does not exist” may be handled differently to the error condition “insufficient privileges to
copy file”.

Figure 87 – Block Error Handlers

The ‘Block Error Handler’ intercepts textual error messages from the process generating
the error and parses the error message. If any of the error text matches any of the
elements stored in the Errors-Handled-By-This-Block List property, Flow execution will
proceed from the bottom of the block, otherwise Flow execution will proceed from the
right of the block. By default, each ‘Block Error Handler’ is configured to handle all errors.

Cortex Ltd © 2015 All Rights Reserved Page 82


Cortex Studio V6 User Guide

The ‘Block Error Handler’ can also store the error message in a Text variable for subsequent
testing and processing.

Block Error Handler Configuration


Errors-Handled-By-This-Block Property Description
[“*”] Handles all errors
[“insufficient privileges”] Handles errors with the character string
“insufficient privileges” contained within in the
error message.
[“bad error”,”good error”] Handles errors with either the character strings
“bad error” or “good error” contained within the
error message.

Table 3 – Block Error Handler Configuration

To configure a ‘Block Error Handler’ to trap and handle a particular error:


1 Set the Errors-Handled-By-This-Block property to a List value, the elements
of which contain the text to perform a partial match, see Table 3.
 Note: The text match performed is case sensitive.
2 Optionally set the property field Copy-Error-Message-To-Variable to a Text
variable to store the error message for subsequent processing.

4.4.8.3 Flow State Error Handling


A ‘State Error Handler’ block may be placed on the State workspace to handle all error
conditions that occur in the State or any of the workspaces under the State, irrespective if
the workspace belongs to a State or a Subtask, that have not been handled by Local Error
Handlers. The ‘State Error Handler’ block will therefore be a common point of execution
for all unhandled errors that occur within that State, regardless of which function block
encountered the error condition, see Figure 88.
 Note: The ‘State Error Handler’ block will not catch any errors that have been
successfully handled by any ‘Local Error Handlers’.

State Error Handler


entry point

Figure 88 – State Error Handler

Cortex Ltd © 2015 All Rights Reserved Page 83


Cortex Studio V6 User Guide

4.4.8.4 Default Error Handling


A ‘Default Error Handler’ in the Flow’s top-level workspace will catch and handle any errors
that occur anywhere within the Flow that have not been successfully handled by a ‘State
Error Handler’ or ‘Local Error Handler’. The ‘Default Error Handler’ will therefore be a
common point of next execution for all unhandled errors regardless of where in the Flow an
error originated, see Figure 89.
Typically, the actions undertaken within the ‘Default Error Handler’ are:
 Close any open connections to databases and other systems.
 Raise an incident in a support desk system.
 Send an email notification to a support team.

Figure 89 – Default Error Handler

4.4.8.5 Error Functions


Cortex contains a number of built-in error functions that can be useful when handling
errors. These are:
 f_api-error
 f_api-error-history
 f_api-failures
 f_error
 f_error-history
 f_error-raw
These error functions provide textual information about the errors that have occurred and
can be copied to variables, parsed and processed in logic to control the Flow execution or
report helpful information to the user, e.g., via LivePortal, or to the support department,
e.g., via email.

Cortex Ltd © 2015 All Rights Reserved Page 84


Cortex Studio V6 User Guide

For more information on these and other built-in functions, see Appendix 7.5.

4.4.8.6 Signalling an Error Condition


In exceptional circumstances, it may be necessary for a particular Flow to generate an
error condition that should be handled by error handlers specific to the main Flow. Cortex
provides for this eventuality with the ‘Signal Error’ block within the ‘Error Handling’
palette; see Figure 90 for a Flow example using the ‘Signal Error’ block.

Signal Error Block


Causes the Flow to jump to the
State Error Handler if present;
if not the Flow will jump to the
Default Error Handler

Figure 90 – Example Use of Signal Error Block

To signal an error condition:


 Set the Error-Message property to an appropriate text error message. This
message can then be parsed by an error handling block.
 Note: The ‘Error Signalling’ block does not have any output connection points; it
will always cause the Flow to jump to an error handling block or the ‘Default Error
Handler’.

4.4.9 LivePortal and Human Interaction


Many automation systems are run as ‘black box’ processes, i.e. there is no human input to
provide additional information or to change its behaviour once the Flow has started.
Typically, a manually initiated flow would be started by a user accessing LivePortal and
selecting the appropriate flow from the service catalogue. As people are an integral part
of many business processes, Cortex has been designed to allow a Flow execution to interact
with people when required.

4.4.9.1 Exporting Flows to LivePortal


Any Flow may be exported to LivePortal to be listed in the service catalogue; however, the
Flow developer needs to specify which Flows are to be exported. By default, none of the
flows are marked for export to LivePortal.
To specify which flows are to be exported to LivePortal:
1 Open the Flow to be exported to LivePortal.
2 <Left-Click> the Flow’s top-level workspace to reveal the Flow’s ‘LivePortal
Properties’ in the Property Viewer.
3 Set the Export property value to True.
4 Set the Display Name property to the name to be displayed in LivePortal for
this Flow.

Cortex Ltd © 2015 All Rights Reserved Page 85


Cortex Studio V6 User Guide

 Note: The name displayed in LivePortal can contain spaces and other non-
alphanumeric characters.
5 Set the Export-Description property to free format text that will be
displayed in LivePortal. The description can contain HTML formatting tags.
6 Optionally, set the Access Control property to a valid Access Control Entry
(ACE) in order to restrict access to predefined LivePortal users.
 Note: If the Access Control property is not set, all LivePortal users will have access
to execute the Flow.
 Note: The Cortex system administrator should provide details of the Access Control
Entries that have been set up for the specific Cortex installation. These are
typically configured to map to Active Directory security groups in order to control
access.
The Flow will automatically be exported into the LivePortal’s service catalogue on the
Cortex Debug Server when it is ‘deployed’ by the Flow Developer (provided that its Export
property is set to True).
 Note: The action of Publishing the service request (Flow) to a Cortex Production
Server and the associated export to LivePortal can only be undertaken by an Admin
user.
 Note: Flows will be organised in the same hierarchy as they are located in the
Group structure, and with the same Group names, defined within Cortex Studio.

4.4.9.2 LivePortal Service Catalogue


The service catalogue is simply a list of service requests or Flows that a particular user can
browse and initiate. Microsoft Active Directory security settings may be used to restrict
access to different subsets of the service catalogue, thereby providing granular control to
different user groups.
The service catalogue is displayed in a hierarchical tree-structure; see Figure 91, and is
automatically created to be identical to that defined by the Group hierarchical structure in
Cortex Studio. See Section 2.1 for more information on the organisational group hierarchy.

Service Catalogue

Selected Service
Selected Service
Description
Figure 91 – LivePortal Service Catalogue

To initiate a flow from LivePortal:


1 Open the LivePortal website using a web browser; the actual address for the
website should be provided by your system administrator.

Cortex Ltd © 2015 All Rights Reserved Page 86


Cortex Studio V6 User Guide

2 <Left-Click> the Start button at the lower right of the LivePortal home
screen to open the LivePortal Service Catalogue.
3 <Left-Click> the ‘+’ mark to the left of the service catalogue tree structure
to expand the tree to reveal the available Flows.
 Note: The Flows visible and hence available to use are dependent on the user’s
Active Directory authorisation rights.
4 <Left-Click> the required flow to select it. The selected flow’s description
will appear to the right of the screen.
5 <Left-Click> either of the two Start buttons to initiate the selected Flow.
When the Flow has been started, the LivePortal user will be presented with the Flow’s
default web screen, see Figure 92, as defined in the ‘Default UI Configuration’ object. The
contents of the ‘Default UI Configuration’ object can be modified by the flow developer to
present a different default web screen, including the addition of additional ‘steps’ to the
Progress Display and other elements to be displayed.

Web part rendered


from Cortex system
installation

Flow Progress
Display (Default)
Progress Indicator
Web part rendered from Device (Default)
flow’s default User
Interface Definition Abort Button
(Default)

Figure 92 – LivePortal Flow Default Screen (Default Web Controls)

To provide user interaction, the Flow can present the LivePortal user with additional web
pages and forms to enable the display of information and data to be entered that can be
processed by the flow logic. For further information, see Section 4.4.10.

4.4.9.3 Flow Progress Display


As the flow execution progresses, successive steps will be highlighted to inform the
LivePortal user of the flow progress; see Figure 93. The Flow Progress Display may be
extended to include additional steps.

Cortex Ltd © 2015 All Rights Reserved Page 87


Cortex Studio V6 User Guide

Execution Progress Highlighted ‘state’


Display modified to shows flow progress
five ‘states’

Figure 93 – LivePortal Flow Progress Display

To modify the Flow Progress Display to show multiple ‘steps’:


1 Open the Flow’s ‘Default UI Configuration’ object, located in the Flow’s top-
level workspace to reveal its workspace; see Figure 94.
2 <Left-Click> the Progress Display Configuration object, located towards
the bottom of the workspace to select it and display its properties in the
Property Viewer.
3 Set the Steps property to a List of steps to be displayed in the LivePortal
webpages associated with this Flow.
 Note: The List value must be a literal List; a reference to a List variable is not
permitted.
4 Set the Current-Step property to the first element of the List value contained
in the Steps property.
5 Set the Visible property to True.

Progress Indicator Device


web control (default)

User Control Buttons


web control (default)
Flow Progress Display
web control (default)

Figure 94 – Default UI Configuration object’s Workspace

The current ‘step’ of the Progress Display can be incremented (or selected non-
incrementally) to highlight to the LivePortal user the progress of the flow execution by
using the ‘Update Progress’ block, drawn from the ‘LivePortal Blocks’ palette.

Cortex Ltd © 2015 All Rights Reserved Page 88


Cortex Studio V6 User Guide

To configure the ‘Update Progress’ block to highlight a particular ‘step’:


 Set the Current-Step property to the name of the desired ‘step’ to highlight
exactly as it was entered in the Steps property of the Progress Display
Configuration object of the ‘Default UI Configuration’ object.
 Note: The ‘step’ name entered in the Current-Step property must exactly match
one of the ‘step’ names entered in the Steps property of the Progress Display
Configuration object, otherwise the ‘step’ will not be shown on the LivePortal
user’s screen.

4.4.9.4 Terminate LivePortal Session


Normally a LivePortal user will continue to see the user interfaces associated with a Flow
execution until that execution ends, at which time the user will be returned to the service
catalogue screen. However, it is possible for the Flow to terminate the LivePortal session
and interaction with the user whilst still continuing with the Flow execution. This can be
achieved using the ‘Delete Thread in UI’ block, drawn from the ‘LivePortal Blocks’ palette.
When the session is terminated in this way, the LivePortal user is returned back to the
LivePortal Service Catalogue web page.

4.4.9.5 Using Custom Web-forms


Custom web-forms can be used to present the LivePortal user with different sets of
information and allow the user to enter data, which can be subsequently processed by the
Flow execution.
Custom web-forms can be presented to the LivePortal user at any time using the ‘User
Interaction’ block, drawn from the ‘LivePortal Blocks’ palette. The flow developer can
populate each custom form with a variety of LivePortal controls to enable the display of
information and to obtain data from the LivePortal user; see Section 4.4.10 for information
on using LivePortal controls. Figure 95 shows the elements of the web page presentation to
the LivePortal user using the default layout of the ‘User Interaction’ function block.

Display part rendered from


Cortex system installation
Display part rendered from
User Interface Definition

Display part rendered


from User Interaction
block (default)

Figure 95 – User Interaction Web-form (default)

The default layout of the ‘User Interaction’ block includes three buttons: ‘Back’, ‘Cancel’
and ‘Next’; Flow execution may be controlled, based on which of these buttons was
clicked, using the ‘UI Navigation with Timeout’ control, drawn from the ‘LivePortal Blocks’
palette. If the LivePortal user clicks on ‘Next’, data entered the web-form is submitted
back to the Cortex server.
The Timeout Seconds property of the ‘User Interaction’ block specifies the time allowed
before the web-form is automatically cancelled, causing the ‘UI Navigation with Timeout’

Cortex Ltd © 2015 All Rights Reserved Page 89


Cortex Studio V6 User Guide

block to execute a different Flow path. An example of the use of the ‘UI Navigation with
Timeout’ control block in conjunction with the ‘User Interaction’ function block is shown in
Figure 96.

‘User Interaction’
function block

‘UI Navigation with


Timeout’ control block

‘Update Progress’
function block

‘Delete Thread in
UI’ function block
“Terminate
LivePortal
Session”

Figure 96 – Example of ‘User Interaction’ and ‘UI Navigation with Timeout’ blocks

4.4.10 Web-form User Interaction


Data exchange with the user is achieved using a ‘User Interaction’ block. When the Flow
execution encounters a ‘User Interaction’ block, the Flow execution pauses until the user
submits the required information and clicks one of the ‘Next’, ‘Cancel’ or ‘Back navigation
buttons on the web-form, or the web-form times-out.
Data exchange is undertaken using one, or a combination of, web controls, drawn from the
‘LivePortal Control’ palette. These controls are:
 Label – Displays simple text label.
 Text Box – Allows collection of text data in a single box.
 Button – Displays an additional button on web-form.
 Listbox (single or multi-select) – Displays a list of options from which the
LivePortal user can select a single or multiple items.
 Dropdown List – Displays a dropdown list of options from which the LivePortal
user can select a single item.
 Checkbox – Displays a checkbox part that the LivePortal user can check or
uncheck.
 Calendar – Displays a fully navigable calendar to enable the selection of a
specific date.
 Calendar Extender – Extends a Text Box control to drop-down a fully navigable
calendar to enable the entry of a specific date into the Text Box.
 Grid – Displays a grid of information from a Table variable. The grid can be
filtered and sorted, and a single row can be selected, by the LivePortal user.
 Double Grid – Displays a grid of information from a Table variable. The
LivePortal user can filter and sort the grid, and select rows to be copied to a
second grid; thereby creating a second table by selecting a set of rows from a
source table.
 Tree Selector – Displays a table of hierarchical objects as a navigable tree.
Branches of the tree may be expanded and collapsed by the LivePortal user, and

Cortex Ltd © 2015 All Rights Reserved Page 90


Cortex Studio V6 User Guide

the lowest element in the tree structure may be selected to return a structure
of all elements in that branch.
 Literal – Can contain any HTML markup that can be used to enhance the format
of the presented web-form, display images, play animation, use 3rd party
controls, etc.
 HTML Button – Enables the execution of JavaScript code when clicked by the
LivePortal user.
 Custom Script – Provides an object to contain JavaScript that can be attached to
a web control object, for example, an HTML Button.
 Repeat Section (Start) – Marks the beginning of a section of LivePortal controls
that are to be repeated, e.g., a series of Text boxes where the properties of
each box differ in accordance with the elements of a List variable.
 Repeat Section (End) – Marks the end of a section of LivePortal controls that are
to be repeated.
For a more detailed explanation on the use of the LivePortal controls and how data is
displayed and extracted from the submitted web-forms, see Section 4.4.10.2.

4.4.10.1 Default Display


The default web page that is displayed to the LivePortal user is defined in the ‘Default UI
Configuration’ object, located in the Flow’s top-level workspace. The default web page is
displayed to the LivePortal user when:
 A Flow is initiated from LivePortal before a Custom Form is displayed to the
LivePortal user, or
 The LivePortal user has submitted a Custom Form, e.g., by clicking ‘Next’ on the
Custom Form, but before the next Custom Form is displayed.
Although it is possible to use LivePortal controls on the Default Display, the display is read-
only and controls should not be used to gather information from the LivePortal user;
information should be gathered from the Custom Form.

4.4.10.2 Custom Forms


Custom Forms are generated whenever a ‘User Interaction’ block is encountered in the
Flow execution. The layout and contents of the form displayed to the LivePortal user are
defined within the ‘User Interaction’ block’s workspace.
Initially, the workspace contains a Navigation Control, consisting of three buttons, of which
only two are initially visible: ‘Abort’ and ‘OK’; see Figure 97. It is not possible to delete
the Navigation Control; however, it is possible to ‘rename’ any button, or make one or
more of the buttons inactive or invisible to the LivePortal user.

Cortex Ltd © 2015 All Rights Reserved Page 91


Cortex Studio V6 User Guide

Figure 97 – User Interaction Function Block Workspace

 Note: By default, the Navigation Control is not displayed in the LivePortal rendered
web page. To make any of the buttons visible to the LivePortal user, the
Navigation Control must be set to be visible.
To make the Navigation Control (and any associated visible buttons) visible on the rendered
LivePortal web page:
1 <Left-Click> the Seq Block Navigation Config object to select it and display
its properties in the Property Viewer.
2 Set the Visible property to True.
To rename a Navigation Control button or make it inactive or invisible:
1 <Left-Click> the Seq Block Navigation Config object to select it and display
its properties in the Property Viewer.
2 To hide a button, e.g., the ‘Back’ button, set the Back-Button-Visible
property to False.
3 To disable a button, e.g., the ‘Back’ button, set the Back-Button-Enabled
property to False.
4 To change the label of a button, e.g., the ‘Back’ button label, modify the text
contained in the Back-Button-Label property.
 Note: The ‘Cancel’ button and the ‘Next’ buttons may be modified similarly.
Additional LivePortal controls may be added to the User Interaction block’s workspace by
simply placing the appropriate control from the ‘LivePortal Controls’ palette in the desired
location on the workspace in a similar way to placing function blocks onto a workspace.
 Note: The LivePortal controls are not connected to each other using block
connection points. LivePortal controls do not define an order of execution; they
define the position of web controls on the web page.
Figure 98 shows an example of three different LivePortal Controls that have been placed
and configured on a ‘User Interaction’ workspace:
1. Dropdown box
2. HTML Literal to improve the layout of the rendered web page. In this instance,
the HTML tag ‘<br/>’ has been used to insert a line break.
3. Checkbox

Cortex Ltd © 2015 All Rights Reserved Page 92


Cortex Studio V6 User Guide

 Note: The formatting of text in the workspace is not representative of the rendered
web-form; see Appendix 7.6.

Figure 98 – Example of LivePortal Controls Placed on User Interaction Workspace

Figure 99 shows how the example above is rendered in the web-form viewed by the
LivePortal user.
Note that the title text of the LivePortal controls is left justified, and that the text
associated with the Checkbox controls is automatically left-justified and wrapped, as the
forms use a flow layout as opposed to fixed layout, i.e.:
 All rows of controls will start at the same position on the left side of the screen;
 Controls placed next to each other will be displayed next to each other as long
as the browser window is wide enough. If the browser window is too small, the
controls will wrap and be displayed on the next line;
 Empty space between ‘rows’ of controls are ignored; rows are placed directly
beneath each other. To force empty space, use an HTML literal control
containing one or more HTML ‘<br/>’ (line break) tags to force one or more
empty lines.
LivePortal controls are configured in a similar way to the function blocks using the Property
Viewer.

Figure 99 – Example of LivePortal Controls Rendered in Web Browser

Cortex Ltd © 2015 All Rights Reserved Page 93


Cortex Studio V6 User Guide

4.4.10.3 Updating Progress Display


The Progress Display object is displayed within web-forms to denote the current stage in
the flow execution. This object is derived from the ‘Default UI Configuration’ object; see
Section 4.4.9.3 on how to update the Progress Display.

4.4.11 Data Exchange between Cortex and LivePortal


Data is exchanged with the LivePortal user either by direct reference to a declared
variable, or by implied reference to a declared variable using a fixed naming convention.
 Direct reference to a variable is used when sending data from Cortex to the
web-form or to initialise the form. It is undertaken in a similar way to
referencing variables with function blocks by referencing the variable name in
the LivePortal control’s property.
 Implied reference to a variable is used only when the web-form has been
submitted and the form contents are returned to Cortex; data from the
submitted form is automatically copied into the variable, which has to be of the
correct type for the data and adhere to the correct naming convention.
The naming convention is based on the format
<Control_Name>.<Property_Group_Name>.
For example, if a Textbox control was named FIRSTNAME (by setting the
control’s _name property to ‘FIRSTNAME’), then a Text type variable named
<FIRSTNAME.TEXT> would need to be declared to receive the text entered and
submitted in the web-form.
 Note: The Save-In-Parameters property of the relevant property group must be set
to True to enable data to be transferred to the implied variable.
 Note: The Save-In-Parameters property is only shown in the Cortex Studio Property
Editor for the property groups where this setting is relevant.

4.4.11.1 Common Properties used in LivePortal Controls


Each control has a variety of properties used to configure different aspects of the control’s
behaviour. Most of the LivePortal controls are rendered as visible objects within the
LivePortal web page and share common properties that define their: name, size, tooltip
displayed, etc. These common properties are identified in Table 4.

Cortex Ltd © 2015 All Rights Reserved Page 94


Cortex Studio V6 User Guide

Common LivePortal Control Properties


Property Name Description Use Property Value
[Main Properties] Uniquely identifies the control on A valid Symbol as literal
Mandatory
_NAME the specific web page. text
[Main Properties]
Displayed title of the control. Optional Literal text
Title
[Tooltip] The mouse-over text for this Literal text or
Optional
Property-Value control {{Text_variable}}

[Width] Defines the width of the displayed


Optional Literal integer
Property-Value control in pixels
[Height] Defines the height of the displayed
Optional Literal integer
Property-Value control in pixels

[Visible] Makes the control visible in Literal Boolean


Mandatory
Property-Value LivePortal (Default: True)

[Enabled] Enables use of the control in Literal Boolean


Mandatory
Property-Value LivePortal (Default: True)
[CSS Class] Defines the appearance of the
Optional See Appendix 7.6.3.
Property-Value control in LivePortal

Table 4 – Common Control Properties

Most controls have additional properties that need to be set (although some are optional).
The key properties for each specific control are listed in the subsequent sections.

4.4.11.2 Data Entry Validation


There are a number of ways to validate the data that the user has entered on the
LivePortal web-form before the form is submitted back to the Cortex server. These are
Required, Range and Regex validation.

Required Data Entry Validation


A LivePortal user can be required to enter data into any LivePortal Control before the web-
form is submitted. If data is not entered into all of the data-required controls and an
attempt is made to submit the form, the LivePortal user will be presented with an error
message.
To require the user to supply data into a LivePortal Control:
1 Set the control’s Is-Required property in the ‘Main Properties’ group to True.
2 Set the control’s Property-Value property in the ‘Property Validator – Error
Message’ group to a literal text message to be displayed if no data is entered
in this control by the LivePortal user.
Range and Regex Data Validation
Data entered into a LivePortal control by a user can be validated to ensure that it is:
a. of the correct type (e.g., Integer, Text, etc.) and has a value within a
defined range, or
b. matches a RegEx pattern.
Allowable data-types for range validation are:
 Currency
 Date
 Double (i.e. Float)

Cortex Ltd © 2015 All Rights Reserved Page 95


Cortex Studio V6 User Guide

 Integer
 String
To ensure that the data entered is of the correct type and falls within a specified range,
the following properties should be set:

Range Validation Properties


Property Name Description Set Value to: Default Value
[Main Properties] Enables validation of the entered RANGE NONE
Validation value.
[Range Validator –
The minimum allowable value that can
Minimum Value] <min_value> “”
be submitted in this control.
Property-Value
[Range Validator –
The maximum allowable value that can
Maximum Value] <max_value> “”
be submitted in this control.
Property-Value

Currency,
[Range Validator – Date,
The data type of the value to be
Range Data Type] Double, “”
validated.
Property-Value Integer, or
String

[Range Validator –
The error message to be displayed if
Error Message] <text> “”
validation fails.
Property-Value

Table 5 – Range Validation Properties

To ensure that the data entered matches a RegEx validator, the following properties should
be set:

Regex Validation Properties


Property Name Description Set Value to: Default Value
[Main Properties] Enables validation of the entered REGEX NONE
Validation value.
A Regex expression to check against
[Regex Validator –
submitted value, see note below. For
Expression] <Regex_expression> “”
more information on Regex
Property-Value
expressions, see Appendix 7.4.
[Regex Validator –
The error message to be displayed if
Error Message] <text> “”
validation fails.
Property-Value

Table 6 – Regex Validation Properties

 Note: The regular expression syntax that has to be used here is standard C# .NET
regular expression syntax, rather than Cortex regular expression syntax. The reason
is simply that this expression will be evaluated within the LivePortal web server.

4.4.11.3 Label Control


A Label control is a textual display-only control; no information can be accepted from the
user.
Figure 100 shows the appearance of the Label control on the User Interaction workspace,
together with an example Properties Grid, to demonstrate its rendering in LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 96


Cortex Studio V6 User Guide

Displayed as...

Label Label
LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 100 – Label LivePortal Control

Table 7 identifies the key properties required to configure the Label control, in addition to
any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Label control key Properties


Property Name Description Use Property Value
[Text] Literal text or
Text to be displayed as label Mandatory
Property-Value {{Text_variable}}

Table 7 – Label Control Key Properties

4.4.11.4 Textbox Control


The Textbox control displays a single text box and associated label; the text box can
display a ‘default’ value if required. Data entered into the text box by the LivePortal user
can be accessed using an implied variable.
Figure 101 shows the appearance of the Textbox control on the User Interaction workspace,
together with an example Properties Grid, to demonstrate its rendering in LivePortal.
 Note: The relative position of the Textbox label in the workspace is immaterial as
the label will always be rendered in LivePortal to the left of the Textbox as shown.

Cortex Ltd © 2015 All Rights Reserved Page 97


Cortex Studio V6 User Guide

Displayed as...

Textbox Textbox
LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 101 – Textbox LivePortal Control

Table 8 identifies the key properties required to configure the Textbox control in addition
to any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Textbox control key Properties


Property Name Description Use Property Value
[Text] Initial text to be displayed Literal text or
Optional
Property-Value within the Textbox {{Text_variable}}

Save entered text in implied


variable.
[Text] Literal Boolean
If set to True, user entered Mandatory
Save-In-Parameters (Default: False)
text saved in implied Text
variable: <_Name>.Text

Singleline (Default)
= Single line of text

[Textmode] Defines how the text is Multiline =


Optional Dynamically resizable
Property-Value displayed
multiple-line textbox
Password = Single line
of obscured characters

Table 8 – Textbox Control Key Properties

4.4.11.5 Button Control


The Button control displays a single grey button that, when pressed, will cause the web-
form to be submitted. Which button was pressed can be determined within the Flow from
the built-in function f_last-ui-event or by assigning a Text variable to the
Parameter-To-Store-Results property of the User Interaction block.
Figure 102 shows the appearance of the Button control on the User Interaction workspace,
together with example properties, to demonstrate its rendering in LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 98


Cortex Studio V6 User Guide

Displayed as...

Button Button
LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 102 – Button LivePortal Control

Table 9 identifies the key properties required to configure the Button control in addition to
any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Button control key Properties


Property Name Description Use Property Value
Saves all currently entered data Literal boolean
[Main Properties]
on form before proceeding to Mandatory
Saves-State (Default: True)
next function block.
[Text]
Text to be displayed on Button Optional Literal text
Property-Value

Table 9 – Button Control Key Properties

4.4.11.6 Listbox Control


The Listbox control displays a list of options that can be selected by the LivePortal user.
Optionally, a list of values (contained in the Item-Values-Parameter property), which are
not displayed to the user, can be associated with the list of displayed options (contained in
the Item-Texts-Parameter property).
The control can either allow a single item selection or multi-item selection; multi-item
selection is achieved by holding down the <Ctrl> key when making the selection. If the
item list exceeds Listbox rendered control, scroll bars are automatically provided. Items
selected in the list box by the LivePortal user, and their associated non-displayed values,
can be accessed using implied variables.
Figure 103 shows the appearance of the Listbox control on the ‘User Interaction’
workspace, together with an example Properties Grid, to demonstrate its rendering in
LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 99


Cortex Studio V6 User Guide

Displayed as...

Listbox Listbox
LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 103 – Listbox LivePortal Control

Table 10 identifies the key properties required to configure the Listbox control in addition
to any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Listbox control key Properties


Property Name Description Use Property Value
Literal text, either:
[Selection Mode] Determine if user can select a
Optional Single or Multiple
Parameter-Value single item or multiple items
(Default: Multiple)

If set True, saves selected item


[Items] texts and associated values into Literal boolean
implied List variables: Mandatory
Save-In-Parameters (Default: True)
<_Name>.SelectedTexts
<_Name>.SelectedValues>
[Items] List of Text items to be
Mandatory List variable
Item-Texts-Parameter displayed
[Items] List of values associated with
Mandatory List variable
Item-Values-Parameter text items that are displayed
[Items] List of items that will be
Optional List variable
Items-Selected-Parameter displayed as selected

Table 10 – Listbox Control Key Properties

4.4.11.7 Dropdown List Control


The Dropdown List control displays a list of options as a dropdown selection, of which one
item can be selected by the LivePortal user. Optionally, a list of values (contained in the

Cortex Ltd © 2015 All Rights Reserved Page 100


Cortex Studio V6 User Guide

Item-Values-Parameter property), which are not displayed to the user, can be associated
with the list of displayed options (contained in the Item-Texts-Parameter property).
Items selected in the list box by the LivePortal user, and their associated non-displayed
values, can be accessed using implied variables.
Figure 104 shows the appearance of the Dropdown List control on the ‘User Interaction’
workspace, together with example properties, to demonstrate its rendering in LivePortal.

Displayed as...

Dropdown Dropdown
LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 104 – Dropdown List LivePortal Control

Table 11 identifies the key properties required to configure the Dropdown List control in
addition to any common properties shown in Table 4. For a full list of all the properties
that are available to customise the behaviour of this control, please refer to the Cortex
Block Reference Guide, available from the Help icon.

Dropdown List control key Properties


Property Name Description Use Property Value
If set True, saves selected item
[Items] texts and associated values into Literal boolean
implied List variables: Mandatory
Save-In-Parameters (Default: True)
<_Name>.SelectedTexts
<_Name>.SelectedValues>
[Items] List variable containing a list of
Mandatory List variable
Item-Texts-Parameter Text items to be displayed
List variable containing a list of
[Items]
values associated with items Mandatory List variable
Item-Values-Parameter
that are displayed
Text variable containing the
[Items]
item to be displayed as initially Optional Text variable
Items-Selected-Parameter
selected

Table 11 – Dropdown List Control Key Properties

4.4.11.8 Checkbox Control


The Checkbox control displays a checkbox that can checked or unchecked by the LivePortal
user. The status of the checkbox can be accessed using implied variables.

Cortex Ltd © 2015 All Rights Reserved Page 101


Cortex Studio V6 User Guide

Figure 105 shows the appearance of the Checkbox control on the ‘User Interaction’
workspace, together with example properties, to demonstrate its rendering in LivePortal.

Displayed as...

Checkbox Checkbox
LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 105 – Checkbox LivePortal Control

Table 12 identifies the key properties required to configure the Checkbox control in
addition to any common properties shown in Table 4. For a full list of all the properties
that are available to customise the behaviour of this control, please refer to the Cortex
Block Reference Guide, available from the Help icon.

Checkbox control key Properties


Property Name Description Use Property Value
If set True, saves user input
[Checked] into an implied Boolean Literal boolean
Mandatory
Save-In-Parameters variable: (Default: True)
<_Name>.Checked

Table 12 – Checkbox Control Implied Variables

4.4.11.9 Calendar Control


The Calendar control displays a fully navigable calendar from which a single date can be
selected by the LivePortal user. The date selected can be accessed using an implied
variable.
Figure 106 shows the appearance of the Calendar control on the User Interaction
workspace, together with example properties, to demonstrate its rendering in LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 102


Cortex Studio V6 User Guide

Displayed as...

Calendar
LivePortal Control Calendar
as displayed in User LivePortal Control
Interaction Block as displayed in
LivePortal

Figure 106 – Calendar LivePortal Control

Table 13 identifies the key properties required to configure the Calendar control in addition
to any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Calendar control key Properties


Property Name Description Use Property Value
If set True, saves user input Literal boolean
[Selecteddate]
into an implied Text variable: Mandatory
Save-In-Parameters (Default: True)
<_Name>.SelectedDate
Literal text of date
[Dateformat] Format in which to store the
Optional format, e.g.,
Property-Value selected date
dd/MM/yy

Table 13 – Calendar Control Implied Variables

4.4.11.10 Calendar Extender Control


The Calendar Extender control provides a dropdown, fully navigable calendar to aid date
entry by the LivePortal user into an associated text box. The value returned to the Cortex
server is stored in the associated text box’s implied variable.
Figure 107 shows the appearance of the Calendar Extender control, used in conjunction
with a Textbox control, on the User Interaction workspace, together with example
properties, to demonstrate its rendering in LivePortal.
 Note: The Textbox control that is to be associated with a Calendar Extender
control has to be placed onto the workspace as a specific, separate action.

Cortex Ltd © 2015 All Rights Reserved Page 103


Cortex Studio V6 User Guide

Displayed as...

Select Textbox

Calendar Extender Calendar Extender


LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 107 – Calendar Extender LivePortal Control

Table 14 identifies the key properties required to configure the Calendar Extender control
in addition to any common properties shown in Table 4. For a full list of all the properties
that are available to customise the behaviour of this control, please refer to the Cortex
Block Reference Guide, available from the Help icon.

Calendar Extender control key Properties


Property Name Description Use Property Value
[Targetcontrolid] Identifier of the associated Literal text of
Mandatory
Property-Value Textbox control <_Name> of Textbox
Literal text of date
[Dateformat] Format in which to store the
Optional format, e.g.,
Property-Value selected date
dd/MM/yy

Table 14 – Calendar Extender Control Key Properties

 Note: The selected value from the Calendar Extender control will be placed into
the associated Textbox control and returned to the Cortex server in the implied
variable of the associated Textbox control.

4.4.11.11 Grid Control


The Grid control displays a grid or table of items that can be sorted and filtered by the
LivePortal user. A single row or multiple Rows within the grid may be selected by the
LivePortal user. The selected row, or rows, can be accessed using implied variables.
The grid can also be used to enter new data rows into the data table, which will then be
returned back to the Flow.
Figure 108 shows the appearance of the Grid control on the User Interaction workspace,
together with example properties, to demonstrate its rendering in LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 104


Cortex Studio V6 User Guide

Grıd
LivePortal Control
as displayed in User
Interaction Block

Displayed as...

Grıd
LivePortal Control
as displayed in
LivePortal

Figure 108 – Grid LivePortal Control

Table 15 identifies the key properties required to configure the Grid control in addition to
any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Cortex Ltd © 2015 All Rights Reserved Page 105


Cortex Studio V6 User Guide

Grid control key Properties


Property Name Description Use Property Value
[Main Properties] The Table variable from which the
Mandatory Table variable
Data-Table-Variable grid contents is sourced
Determines the type of implied
variable to which the selected data
will be stored.
True = List variable
[Main Properties] Literal boolean
False = Table variable Mandatory
Convert-Return-Data-To-Seq (Default: True)
Data returned in a List of
Structures (one Structure per
selected row) or a table:
<_Name>-Selection

[Allow Sorting] Allows the LivePortal user to sort Literal boolean


Mandatory
Property-Value the grid contents (Default: True)
Allows the LivePortal user to select Literal boolean
[Allow Multi Row Selection]
multiple, disjoint rows using the Mandatory
Property-Value (Default: True)
Ctrl key

[Allow Column Filtering] Allows the LivePortal user to filter Literal boolean
Mandatory
Property-Value grid based on column contents (Default: True)

Table 15 – Grid Control Key Properties

In addition to customising the grid behaviour using the properties on the grid, it is also
possible to influence the behaviour from the column settings of the input data table
variable, as detailed below:
Primary key columns: Users will not be able to enter new rows into the grid with a
duplicate combination of primary key values.
Nullable Columns: To indicate that when a new row is entered into the grid, the user need
not provide a value for this specific column.
Read Only columns: To indicate that the user should not be able to edit a value in this
specific column.

4.4.11.12 Double Grid Control


The Double Grid control displays two grids; the left grid is the ‘source’ grid, which displays
the content of a Table variable and that can be sorted and filtered by the LivePortal user.
Rows from the ‘source’ grid may be selected by the LivePortal user and copied into the
right grid, which acts as a ‘destination’ grid.
 Note: Both grids must have the same schema, i.e., the same columns, nullable
columns and primary key columns otherwise an error will be signalled.
Figure 109 shows the appearance of the Double Grid control on the ‘User Interaction’
workspace, together with example properties, to demonstrate its rendering in LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 106


Cortex Studio V6 User Guide

Double Grıd
LivePortal Control
as displayed in User
Interaction Block

Displayed as...

Double Grıd
LivePortal Control
as displayed in
LivePortal

Figure 109 – Double Grid LivePortal Control

Table 16 identifies the key properties required to configure the Double Grid control in
addition to any common properties shown in Table 4. For a full list of all the properties
that are available to customise the behaviour of this control, please refer to the Cortex
Block Reference Guide, available from the Help icon.

Cortex Ltd © 2015 All Rights Reserved Page 107


Cortex Studio V6 User Guide

Double Grid control key Properties


Property Name Description Use Property Value
[Main Properties] The Table variable that is used
Mandatory Table variable
Data-Table-Variable as the ‘source’
A Table variable used to store
[Main Properties]
the rows transferred to the Mandatory Table variable
Parameter-To-Store-Results
‘destination’ grid
An empty Table variable, used
as a temporarily store for rows
transferred to the ‘destination’
[Main Properties]
grid. Must be formatted with Mandatory Table variable
Selected-Data-Table-Variable
the same columns as the
‘source’ Data-Table-Variable
table.

Table 16 – Double Grid Control Key Properties

4.4.11.13 Tree Selector Control


The Tree Selector control displays the contents of a table as a tree of items. Fields that
share a common value between the rows are merged as branches towards the root. The
LivePortal user can select an item from the lowest level in the tree; the structure
associated with the selected item can be accessed using an implied variable.
Figure 110 shows a sample dataset, stored in a Table variable, that could be used in
conjunction with the Tree Selector control. The ‘Root Node’ of the displayed tree is
defined in the Tree Selector’s properties, with the multiple levels of branches, twigs and
leaves being drawn from the data-table.
Using the sample dataset, the first column of the table (‘Branch’) forms ‘Level 2’ of the
tree; the second column (‘Twig’) forms ‘Level 3’; and the third column (‘Leaf’) forms
‘Level 4’.
 Note: The naming of the columns in the data-table is unimportant as the Tree
Selector control only parses the data fields.
The rendered output of the Tree Selector control using this sample dataset is shown in
Figure 111.
 Note: The elements at any given level in the tree correspond to the order of the
values within the source data-table; however, the ordering in the data-table does
not have to be consecutive.
For example, referring to Figure 110, ‘Twig 1’ appears in row 1, therefore, it will
be displayed as the first element at the ‘twig’ level; the first instance of ‘Twig 2’
appears in row 3, and will be displayed as the second element at the ‘twig’ level.
Note that ‘Twig 1’ re-appears after ‘Twig 2’ in row 4; this has no effect on the tree
ordering as ‘Twig1’ was initially defined in row 1.

Figure 110 – Sample Dataset for Tree Selector Control

Cortex Ltd © 2015 All Rights Reserved Page 108


Cortex Studio V6 User Guide

Displayed as...

Tree Selector
LivePortal Control
as displayed in User
Interaction Block

Tree Selector
LivePortal Control
as displayed in
LivePortal

Figure 111 – Tree Selector LivePortal Control

Table 17 identifies the key properties required to configure the Tree Selector control in
addition to any common properties shown in Table 4. For a full list of all the properties
that are available to customise the behaviour of this control, please refer to the Cortex
Block Reference Guide, available from the Help icon.

Tree Selector control key Properties


Property Name Description Use Property Value
The contents of a Table
[Main Properties]
variable to be displayed as a Mandatory Table variable
Data-Table-Variable
tree
Text to be displayed adjacent
[Root Node Text]
to the ‘root node’, see Figure Optional Literal text
Property-Value
111.
Requires the LivePortal user
to make a selection.
[Requires Selection] If set to True, data will be Literal boolean
Mandatory
Property-Value stored in the implied (Default: True)
Structure variable:
<_Name>-Selection
The number of levels of the
tree that are initially to be
shown expanded.
[Levels To Expand] Integer
 Note: The value of this Mandatory
Property-Value (Default: 0)
property should not
exceed the possible
levels of the tree.

Table 17 – Tree Selector Control Key Properties

4.4.11.14 Literal Control


The Literal control enables the insertion of HTML elements, such as line breaks and images,
into the rendered web-form displayed to the LivePortal user.

Cortex Ltd © 2015 All Rights Reserved Page 109


Cortex Studio V6 User Guide

Figure 112 shows the appearance of the Literal control on the ‘User Interaction’ workspace,
together with example properties, to demonstrate its rendering in LivePortal.

Displayed as...

HTML Literal HTML Literal


LivePortal Control LivePortal Control
as displayed in User as displayed in
Interaction Block LivePortal

Figure 112 – Literal LivePortal Control

Table 18 identifies the key properties required to configure the Literal control in addition
to any common properties shown in Table 4. For a full list of all the properties that are
available to customise the behaviour of this control, please refer to the Cortex Block
Reference Guide, available from the Help icon.

Literal control key Properties


Property Name Description Use Property Value
[Text] Literal text, or
HTML text to be inserted. Mandatory
Property-Value {{Text_Var}}

Table 18 – HTML Literal Control Key Properties

4.4.11.15 HTML Button Control


The HTML Button control displays to the LivePortal user a button that can also contain some
JavaScript. When the LivePortal user clicks this control, the associated JavaScript will be
executed; however, unlike the other Button LivePortal Control, clicking the HTML Button
does not cause data to be sent back to Cortex Server, nor does it cause the Token to
progress through the flow, the action defined in the JavaScript is typically executed on the
web browser, for example to show or hide some other controls on the page.
Figure 113 shows the appearance of the HTML Button control on the ‘User Interaction’
workspace, together with example properties, to demonstrate its rendering in LivePortal.

Cortex Ltd © 2015 All Rights Reserved Page 110


Cortex Studio V6 User Guide

Displayed as...

HTML Button
LivePortal Control HTML Button
as displayed in User LivePortal Control
Interaction Block as displayed in
LivePortal

Figure 113 – HTML Button LivePortal Control

Table 19 identifies the key properties required to configure the HTML Button control in
addition to any common properties shown in Table 4.

HTML Button control key Properties


Property Name Description Use Property Value
[Text]
Text displayed on button Optional Literal text
Property-Value
The JavaScript to be executed
[Onclick event]
when the HTML Button is Mandatory JavaScript
Property-Value
clicked

Table 19 – HTML Button Control Key Properties

4.4.11.16 Custom Script Control


The Custom Script control object contains JavaScript and should be attached to another
LivePortal control, e.g., a Checkbox control. When the LivePortal user raises an event, for
example, clicking on the Checkbox, the JavaScript in the attached Custom Script control is
executed.
The Custom Script control is connected to another LivePortal control by dragging the
connection point at the left of the Custom Script to the connection point of the LivePortal
control to which it is to be associated.
Figure 114 shows the appearance of the Custom Script control, connected to an Checkbox,
on the User Interaction workspace, together with example properties, to demonstrate that
only the attached Checkbox is rendered; not the Custom Script control.

Displayed as...

Custom Script
LivePortal Control Custom Script
(attached to Checkbox LivePortal Control
Control) as displayed in Is not displayed in
User Interaction Block LivePortal

Figure 114 – Custom Script LivePortal Control

Cortex Ltd © 2015 All Rights Reserved Page 111


Cortex Studio V6 User Guide

Table 20 identifies the key properties required to configure the Custom Script control in
addition to any common properties shown in Table 4. For a full list of all the properties
that are available to customise the behaviour of this control, please refer to the Cortex
Block Reference Guide, available from the Help icon.

Custom Script control key Properties


Property Name Description Use Property Value
The name of the JavaScript
[Main Properties]
event which will trigger the Mandatory onClick
Event-Name
script

[Main Properties] A value indicating if this script Literal boolean


Mandatory
Event-Enabled is enabled. (Default: True)
[Main Properties]
The JavaScript to be executed Mandatory JavaScript
Script-Body
Determines whether the script
runs when the LivePortal page
is loaded, as well as whenever
[Main Properties] the event occurs. Literal boolean
Mandatory
Run-On-Page-Load (Default: True)
If True, the script will run on
page load, if False it will
not.

Table 20 – Custom Script Control Key Properties

For further information and for more detail on the properties of LivePortal controls, refer
to the Cortex Block Reference Guide, available through the Help icon.

Cortex Ltd © 2015 All Rights Reserved Page 112


Cortex Studio V6 User Guide

5 Testing and Debugging

5.1 Overview
The flow should be fully tested to ensure correct operation and avoid errors. Typically,
there are normally three sources of errors:
1. I/O errors, which unexpectedly occur when interacting to external systems, for
example, a communications error with the external system, or reception of
unexpected information, including users entering invalid information via
LivePortal.
2. Logical errors, where a mistake has been made in the construction of a flow; for
example, the failure to declare a variable before use.
3. Semantic errors, caused by the developed logic not representing the intended
outcome.

5.1.1 I/O Errors


When designing a flow, I/O errors should be considered as part of the overall design, and
should be handled using the various error handling facilities built into Cortex Studio. For
more information on error handling, see Section 4.4.8.

5.1.2 Logical Errors


Logical errors will cause the Flow to error when executed. All possible routes through the
Flow should be fully tested before deployment.
The Errors tab on the Token properties, available when Cortex Studio is in Debug Mode, can
be helpful in identifying logical errors when they occur.

5.1.3 Semantic Errors


Semantic errors can only be identified by thorough testing, ideally using a well-defined
process and a broad range of test vectors. Identified semantic problems should then be
eliminated by debugging the flow and making the necessary amendments to the Flow.

5.2 Testing
The amount of testing that is undertaken depends on how critical the Flow is to the
business’ success. Flows that are business critical should be thoroughly tested with a wide
range of possible inputs to test every eventuality within the Flow.
 Note: It is essential that the level of testing required is identified and documented
before embarking the testing process itself.
Testing can be undertaken either in a ‘live’ environment, where Cortex is connected to any
3rd party systems with which the Flow is required to interact, or in a ‘simulated’
environment, where data received from 3rd party systems is simulated within the system.

5.2.1 Simulated 3rd Party Systems’ Interaction


All external interaction function blocks, except those related to LivePortal, can be
configured to simulate a result as if the 3rd party systems had transmitted data to Cortex.
 Note: Only one value can be simulated in each external activity function block. If
it is necessary to use a range of test vectors, for example, read from a file, it will
be necessary to construct the necessary logic before the external interaction block
and then use dynamic, runtime generated simulation values.
See Section 4.4.6.3 for more information on how to simulate interaction with 3 rd party
systems.

Cortex Ltd © 2015 All Rights Reserved Page 113


Cortex Studio V6 User Guide

5.3 Debugging
Cortex Studio provides a powerful set of tools to enable the effective debugging of Flows
should an error be detected in the testing phase.

5.3.1 Observation of Flow Execution


The execution of a Flow may be dynamically observed within Cortex Studio, with a visible
Token identifying each block being executed, or from the Execution Viewer, which provides
real-time textual information about all the simultaneous execution instances of the Flow.

5.3.1.1 Observation of Flow Execution using the Token


When the Flow is executed in Debug Mode, the current point of execution is marked with a
Token, which is delayed at each function block by 0.3 seconds to enable its easy
observation.
It is possible for a single Flow to have multiple executions running simultaneously,
analogous to multiple cars using the same road network but with each car following a
different route. When multiple executions of the same Flow are running simultaneously,
multiple tokens may be visible, with each Token representing the current point of a single
Flow execution.
However, only a single instance of the Flow will be automatically tracked with new
workspaces being automatically opened as the Token progresses through the Flow. A
different instance of the Flow can be tracked by <Double Left-Click> on the Flow
instance in the Execution Viewer.

‘Token’ marking current


point of flow execution

Figure 115 – Token Marking Current Point of Flow Execution

In addition to visually showing the current point of execution, the Token also contains the
‘current state’ associated with the specific Flow execution.

5.3.1.2 Observation of Flow Execution with the Flow Execution Display Window
Observation of the flow execution from the Execution Viewer enables the execution
progress of all executions of the flow to be monitored simultaneously.
The Execution Viewer is automatically displayed at the bottom of the Main Display Area
when Debug Mode is entered, and can be minimised or expanded by <Left-Click> on the
dark grey handle at the top of the Execution Viewer.

Cortex Ltd © 2015 All Rights Reserved Page 114


Cortex Studio V6 User Guide

Figure 116 – Execution Viewer

In the example of the Execution Viewer shown in Figure 116, two simultaneous executions
of the Flow can been seen. The upper Flow instance is currently paused at a breakpoint in
the workspace ‘State-1’ prior to executing a ‘Set Variable’ function block; the lower is
currently in the process of executing a ‘Get Element’ function block in workspace ‘State-1’.

5.3.1.3 Initiate Debugging of the Flow


To enter Debug Mode and automatically display the Execution Viewer:
 <Left-Click> the ‘Start an execution’ icon on the Main Display Area Toolbar.

5.3.2 Tracking
During debug, the Token is automatically ‘tracked’ as it progresses through the Flow, with
workspaces that the Token enters being automatically opened to make the Token visible.
 Note: Only one instance of the Flow can be tracked at any one time.

5.3.2.1 Select an alternative Flow Instance to Track


To select an alternative Flow instance to Track:
 <Double Left-Click> the Flow instance to be tracked in the Executions
Viewer.

5.3.2.2 Turn Tracking Off


To turn off tracking of a Flow:
 <Left-Click> the Stop Tracking icon in the Executions Viewer Toolbar.

5.3.2.3 Turn Tracking On


To turn on tracking of a Flow:
 <Left-Click> the Start Tracking icon in the Executions Viewer Toolbar.

5.3.3 Breakpoints
A breakpoint can be set before any function block, which will pause the Flow execution at
the breakpoint, above the block to be executed next.

‘Token’ marking current


point of flow execution
Breakpoint indicator
Next function block to
be executed

Figure 117 – Token at Breakpoint

Cortex Ltd © 2015 All Rights Reserved Page 115


Cortex Studio V6 User Guide

With the Flow execution paused at the breakpoint, it is possible to examine all of the
variables that have been assigned a value, review the error history associated with the
current execution of the flow, and identify any errors associated with interfaces to 3 rd
party systems.
Once all the debugging checks have been completed at this point, the Token may be:
 ‘Stepped’ to execute the next function block and paused again, or
 Resumed to run continuously, or until the next breakpoint is encountered.
See Section 5.3.3.4 for more information about continuing the execution of the flow.

5.3.3.1 View Variable Values


The Token holds the current values for all variables that are currently in scope. Any of the
variables can be viewed in ‘native’ form, which is particularly useful for examining the
structure and values of composite type variables.
 Note: Only those variables which have been assigned a value will be visible on the
Token.
To view the variables that have been assigned a value:
1 <Left-Click> on the Token to select it, or <Left-Click> an execution
instance in the Execution Viewer to select its associated Token. The
execution information associated with that instance of Flow will be displayed
in place of the Property Viewer; see Figure 118.
2 The Variables tab, enabling the display of variables is selected by default.
If the Variables tab is not selected, <Left-Click> the Variables tab to show
the values currently assigned to variables within the Flow.
3 <Left-Click> a displayed variable to select it and display its contents in the
variable-contents window, below the displayed variables; see Figure 118. This
is particularly useful for displaying the contents of composite type variables.

Figure 118 – Execution Information – Display Variables (List and Table variable examples)

Cortex Ltd © 2015 All Rights Reserved Page 116


Cortex Studio V6 User Guide

5.3.3.2 View Errors Associated with the Flow


To view a list of errors that resulted in retries and errors handled within the flow:
1 <Left-Click> on the Token to select it, or <Left-Click> an execution
instance in the Execution Viewer to select its associated Token. The
execution information associated with that instance of Flow will be displayed
in place of the Property Viewer; see Figure 118.
2 <Left-Click> the Errors tab to show a list of unhandled errors that have
occurred; see Figure 119
 Note: Errors associated with Interfaces are NOT displayed in the Errors tab. Errors
associated with Interfaces are displayed under the API Errors tab, see Section
5.3.3.3.

Figure 119 – Execution Information – Errors

5.3.3.3 View Interface Errors


To view a list of errors associated with this flow that have occurred within interface
function blocks:
1 <Left-Click> on the Token to select it, or <Left-Click> an execution
instance in the Execution Viewer to select its associated Token. The
execution information associated with that instance of Flow will be displayed
in place of the Property Viewer; see Figure 118.
2 <Left-Click> the API Errors tab to show a list of errors that have occurred
within Interface function blocks; see Figure 120.

Cortex Ltd © 2015 All Rights Reserved Page 117


Cortex Studio V6 User Guide

Figure 120 – Execution Information – API Errors

5.3.3.4 View LivePortal Screen


If the flow has been initiated from a method other than using the LivePortal service
catalogue, for example, from within Cortex Studio, when the flow tries to execute a ‘User
Interaction’ function block, it is necessary to create a LivePortal session for user
interaction with this instance of the Flow.
LivePortal interaction can be achieved by:
Either:
1 <Left-Click> on the Flow instance in the Executions Viewer to select it.

2 <Left-Click> on the ‘Show in LivePortal’ icon, see Figure 39, to open a web
browser and instantiate a LivePortal session.
Or:
1 Open the LivePortal website using a web browser.
2 <Left-Click> the My Running Requests hyperlink on LivePortal’s main menu
bar to open the current flow executions display associated with the logged on
LivePortal user.
3 <Left-Click> the View hyperlink at the left of the Flow instance to establish
a session with it.

5.3.4 Flow Execution Actions after a Breakpoint

5.3.4.1 Single step execution


From a paused state the user can single-step the execution, meaning that the execution
engine will execute the next block and then pause execution again. This allows the
verification of the activity each individual block undertakes.

Cortex Ltd © 2015 All Rights Reserved Page 118


Cortex Studio V6 User Guide

Single Stepping Using the Debug Window


To single step the execution through the next function block and pause again using the
Debug window:
1 <Left-Click> on the Flow instance in the Executions Viewer to select it.

2 <Left-Click> the Step the execution icon, see Figure 39, to execute the
current block and pause at the next block

5.3.4.2 Continue Executing the Flow


Flow execution can be resumed at full-speed until the next breakpoint is encountered or
until the Flow terminates.
To continue execution of the Flow:
1 <Left-Click> on the Flow instance in the Executions Viewer to select it.

2 <Left-Click> the Continue the execution icon, see Figure 39, to continue
the execution.

5.3.4.3 Cancel Flow Execution


If required, the Flow execution can be cancelled at any time.
To cancel an execution instance:
1 <Left-Click> the flow instance in the Execution Viewer to select it. If
required, additional Flow instances may be simultaneously selected by holding
down the <CRTL> key.
2 <Left-Click> the End the execution icon to cancel the selected Flow
instance or instances.

Cortex Ltd © 2015 All Rights Reserved Page 119


Cortex Studio V6 User Guide

6 Helpful Tips and Troubleshooting

6.1 Helpful Tips


6.1.1 Developing a Flow

6.1.1.1 When debugging, use a State Error Handler


When debugging a particular area of the flow, it is helpful to temporarily place a ‘State
Error Handler’, drawn from the Error Handling palette, onto the workspace currently being
debugged. When single-stepping through the flow, any errors that are encountered will
keep the Token within the current State, stepping to the ‘State Error Handler’ rather than
jumping to the flows ‘Default Error Handler’.
If a breakpoint is inserted on the ‘State Error Handler’, then the flow will pause at this
point if the flow is executed and an unhandled error occurs within this State. This ensures
that all State Local variables remain intact on the Token for examination and allows the
offending step to be fixed. For more information on the ‘State Error Handler’, refer to
Section 4.4.8.3.

6.1.1.2 If the workspace becomes too crowded, use a Subtask


It is very easy for the workspace to become crowded when developing complex flows. To
simplify the visual appearance of the flow, use Subtasks to group function blocks that
relate to a single task. For more information on Subtasks, see Section 4.4.4Error!
Reference source not found..

6.1.1.3 When using Interface blocks, always consider errors


Irrespective of the amount of testing undertaken to remove logical semantic errors, there is
always the possibility of I/O errors occurring due to external systems beyond the control of
Cortex. Therefore, the logic around each Interface block should include sufficient error
handling to trap unexpected errors and enable the flow to proceed in a controlled way. For
more information on error handling, see Section 4.4.8.

6.2 Troubleshooting
6.2.1 Testing and Executing a Flow

6.2.1.1 Flow terminates with an error


There can be a number of reasons why a flow terminates with an error. To determine and
remedy the error:
1 Examine the errors listed in the Error tab associated with the Token to
determine the cause of the error. Most common causes of errors include:
 Function blocks or State objects not connected
 Assigning the wrong type of value to a variable. For example,
assigning a character string to an Integer variable.
 Assigning a value to a variable that has not been declared.
 I/O errors associated with the use of Interface blocks.

6.2.1.2 Flow does not terminate


The most common cause why a Flow never completes is that the Flow is paused at a
breakpoint that has not been removed. Use the Executions Viewer to check the status of

Cortex Ltd © 2015 All Rights Reserved Page 120


Cortex Studio V6 User Guide

the flow and determine if it is paused at a breakpoint. For further information about the
Executions Viewer, see Section 5.3.1.2.

6.2.1.3 The Token disappears


The most likely cause of the Token disappearing when executing or debugging a flow is that
an error has occurred and the Token has jumped to the Default Error Handler in the Flow’s
top-level workspace due to an unhandled error.
 Note: It may be useful to add a breakpoint to the Default Error Handler when
debugging to ‘catch’ the Token and allow the review of variables and error
messages associated with the flow.
For more information on the Default Error Handler, see Section 4.4.8.4.

6.2.1.4 The Token is lost


In large and more complex flows using multiple States, it is easy to lose track of the
location of the Token, especially if it pauses at one of many breakpoints. Use the
Executions Viewer to identify the token’s location and navigate to it. For more
information, see Section 5.3.1.

6.2.1.5 Unexpected data is received from external system causing an error


I/O errors are the most common type of error in any well-designed and tested flow.
Unfortunately, there is little the Flow can do to prevent unexpected data from an external
system; however, the Flow design should have a strategy for dealing with such events.
Elements of an I/O handling strategy should include:
 Use the interface blocks to validate, where possible, input data, especially from
LivePortal web-forms.
 Check the timeout and retry properties of the Interface function blocks to
ensure that they are appropriate for the external system being used. For more
information on timeout and retry properties of Interface function block, see
Sections 4.4.6.1 and 4.4.8.1.
 Ensure that the Interface function block has an attached Local Error Handler
block to process errors from the Interface block. For more information on block
error handling using the Local Error Handler, see Section 4.4.8.2.
 Consider using a State Error Handler to process unhandled errors from the Local
Error Handler. For more information on the State Error Handler, see Section
4.4.8.3.
 Use the Default Error Handler to ensure a graceful recovery from any unhandled
errors. For more information on the Default Error Handler, see Section 4.4.8.4.

6.2.1.6 The flow is not visible in the LivePortal service catalogue


The flow has not been correctly exported to the LivePortal service catalogue, or the
correct access control has not been set, i.e., the user has not been assigned to a security
group that has access to the flow. See Section 4.4.9.1 for information on how to export a
flow to the LivePortal service catalogue.

6.2.1.7 A variable is not providing the expected value


Before a variable can be used as a source of data for the first time it must be ‘initialised’
correctly. This is achieved by using an appropriate function block, e.g., the ‘Set Variable’
block, or by initialising the variable at the time of its declaration.
To initialise a variable within its declaration, not only does its Initial Value property have
to be set to the required value, but the Set Initial Value property has to be set to True.

Cortex Ltd © 2015 All Rights Reserved Page 121


Cortex Studio V6 User Guide

For more information about declaring variables and variable block’s properties, see Section
4.3.4.
Another cause of variables providing unexpected values is that they are being referenced
incorrectly within the function block. Cortex provides two methods to reference a
variable, either directly, i.e. the variable’s data is used in its native form, by using the
syntax($)VariableName, or by using its contents as text, by using the syntax
{{VariableName}}.

6.2.1.8 The LivePortal browser window has been accidently closed


If the LivePortal browser window has been accidently closed, it is possible to restore the
LivePortal session by:
1 Open the LivePortal website using a web browser.
2 <Left-Click> the My Running Requests hyperlink on LivePortal’s main menu
bar to open the current flow executions display associated with that
LivePortal user.
3 <Left-Click> the View hyperlink at the left of the flow instance that is to be
monitored or requires interaction to re-open the LivePortal session with that
flow.

Cortex Ltd © 2015 All Rights Reserved Page 122


Cortex Studio V6 User Guide

7 Appendices

7.1 Appendix 1: Process Design Procedure


There are a number of aspects of implementing an automated business process flow that
should be clearly understood before embarking on using Cortex Studio. One of the most
important aspects is having a process to ensure the objectives of the automation will be
fully met.
Each business will have different requirements, processes and procedures for adopting new
methods of working. A typical, example procedure is detailed below:
1. Project Request
2. Planning
a. Set Goals
b. Identify Stakeholders
c. Knowledge Capture
d. Process Design
e. Documentation
f. Sign Off
3. Develop the Automation Flow
4. Test
5. Release
6. Continuous Improvement

7.1.1 Project Request


The business need should drive the requirement for automation. The business need should
be clearly understood as it drives the rationale for automating the process. Typical
business needs would include:
 Reducing the numbers of errors incurred in performing a process
 Reducing the time to deliver a business outcome
 Reducing the cost of a process
It is important that there should be a formal agreement with the business to ensure
commitment from both sides of the organisation.

7.1.2 Planning
The planning stage is important to ensure that the project’s goals are clearly defined, the
stakeholders are ‘bought-in’, relevant information is made available, and the end results
meet the goals to everyone’s satisfaction.

7.1.2.1 Set Goals


Goals should be set that determine each of the outcomes of the automation process and set
the metrics that will define its successful completion. If the goals are not clearly defined
at the beginning of the project, then it will not be clear when the automation process has
been completed and the project is likely to suffer from ‘creeping elegance’.

7.1.2.2 Identify Stakeholders


It is important to identify the key people that are impacted by the automation process, for
example, the business customers who initiated the project, users, operators, third-party
system owners, project managers, etc. These people will:

Cortex Ltd © 2015 All Rights Reserved Page 123


Cortex Studio V6 User Guide

 Define the process


 Benefit from the outcomes of the automation process
 Help drive the implementation of the automated process
 Ensure that the project achieves the defined goals

7.1.2.3 Knowledge Capture


To implement business process automation, it is imperative that the process is fully
understood. If the project is automating an existing, manual process, then the existing
process can be examined to capture the necessary actions, decisions and external
interactions, possibly with a view to improve the process itself.
If a new process is being devised, then it is necessary to identify and capture the inputs
that affect the process flow, the actions of the process and the interfaces with external
systems.

7.1.2.4 Process Design


Once all the information is available about the processes’ interactions and the outcomes
from the process, the process itself can be designed. The process should take into account
all eventualities, including what happens during error conditions, e.g., if a third-party
database is unavailable during the processing of a flow, what action should be taken.

7.1.2.5 Documentation
After the process has been designed, documentation should be created that captures the
flow design, the necessary information exchanges between external systems and any
necessary procedures that should be followed.

7.1.2.6 Sign-Off
With the goal identified, the process designed and the documentation completed, the
project should be signed-off with the stakeholders to ensure that the project does not
change over time due to informal enhancements.

7.1.3 Develop the Automation Flow


The process is implemented using the Cortex Studio.

7.1.4 Test
After implementing the process flow using Cortex Studio, the Flow should be thoroughly
tested to ensure that it meets the agreed goals and is free from errors. The initial testing
of the flow can be achieved within Cortex Studio.

7.1.5 Release
Having ensured that the automated process works as designed and is free from errors, the
automated flow can then be released into the production environment.

7.1.6 Continuous Improvement


An automated process operating in a production environment should be subject to
continuous improvement. This would involve gathering feedback from the users of the
process, the business that commissioned the project, and other stakeholders to identify
errors that need correction or process improvements that could enhance the performance
for the process to achieve greater business benefits or user satisfaction.

Cortex Ltd © 2015 All Rights Reserved Page 124


Cortex Studio V6 User Guide

7.2 Appendix 2: Variables and Variable Types


7.2.1 Simple Variables

7.2.1.1 Text Variables


Values
A Text variable can hold a maximum of 1,000,000 (one million) characters.
Declaration
Text variables must be declared in a Variables Store before they can be used. Declaring a
variable does not assign a value to the variable (unless it is ‘Initialised’ at the same time);
it simply creates the variable that is then available for use.
Initialisation
Text variables may be initialised when the Text variable is declared, or it may be assigned
an initial value using the ‘Set Variable’ block from the Variable Blocks palette.

7.2.1.2 Integer Variables


Values
An Integer variable can hold any whole number value between -536,870,912 (-229) and
+536,870,911 (229-1).
Casting and Automatic Conversion
Integer variables may be ‘cast’ to a string representation by using the double-brace
operator, for example: {{<IntegerVariable>}}
Text variables that hold a representation of an integer value may be ‘cast’ into an Integer
variable using the ‘Arithmetic Operation’ function block, which accepts Text type
operands.
Declaration
Integer variables must be declared in a Variables Store before they can be used. Declaring
a variable does not assign a value to the variable (unless it is ‘Initialised’ at the same
time); it simply creates the variable that is then available for use.
Initialisation
Integer variables may be initialised when the Integer variable is declared, or it may be
assigned an initial value using the ‘Set Variable’ block from the Variable Blocks palette.

7.2.1.3 Float Variables


Values
A Float variable holds a decimal number between 2.22 x 10-308 and 1.79 x 10308 in
accordance with ANSI/IEEE Standard 745-1985 (Binary-64). This defines the Float variable
to have a 52-bit fraction, 11-bit exponent and 1-bit sign, allowing for a precision of
approximately 15 decimal digits.
Casting and Automatic Conversion
Float variables may be ‘cast’ to a string representation by using the double-brace operator,
for example: {{<FloatVariable>}}
Integer variables can be automatically converted to a Float type.
Text variables that hold a representation of a Float type value, including scientific
representations, such as 1.234E23, may be ‘cast’ into a Float variable using the ‘Arithmetic
Operation’ function block, which accepts Text type operands.

Cortex Ltd © 2015 All Rights Reserved Page 125


Cortex Studio V6 User Guide

Declaration
Float variables must be declared in a Variables Store before they can be used. Declaring a
variable does not assign a value to the variable (unless it is ‘Initialised’ at the same time);
it simply creates the variable that is then available for use.
Initialisation
Float variables may be initialised when the Float variable is declared, or it may be assigned
an initial value using the ‘Set Variable’ block from the Variable Blocks palette.

7.2.1.4 Boolean Variables


Values
A Boolean variable holds the logical value of either ‘True’ or ‘False’.
Casting and Automatic Conversion
Boolean variables may be ‘cast’ to a string representation (“true” or “false”) by using the
double-brace operator, for example: {{<BooleanVariable>}}
Declaration
Boolean variables must be declared in a Variables Store before they can be used. Declaring
a variable does not assign a value to the variable (unless it is ‘Initialised’ at the same
time); it simply creates the variable that is then available for use.
Initialisation
Boolean variables may be initialised when the Boolean variable is declared, or it may be
assigned an initial value using the ‘Set Variable’ block from the Variable Blocks palette.

7.2.1.5 DateTime Variables


Values
A DateTime variable holds a single date and time value in the format of: Year; Month; Day;
Hour; Minute; Second; and Millisecond.
The minimum value a DateTime variable can assume is 17 years prior to the current date
and its maximum value is 17 years in the future of the current date, with a resolution of
one millisecond.
In reality, DateTime variables are a specialised type of Structure Variable and are best
manipulated using the Date and Time functions blocks. For more information on Structure
Variables, see Section 7.2.2.2.
Declaration
DateTime variables must be declared in a Variables Store before they can be used.
Declaring a variable does not assign a value to the variable (unless it is ‘Initialised’ at the
same time); it simply creates the variable that is then available for use.
Initialisation
DateTime variables may be initialised when the DateTime variable is declared using the
dedicated Property Editor Dialog, see Section 4.2.11, (initialising variable to a precision of
one second). Alternatively, a DateTime variable may be assigned an initial value using the
‘Create Datetime’ block from the Date and Time palette.

7.2.1.6 Timespan Variables


Values
A Timespan variable can assume a maximum value of 1.79 x 10308 seconds (representing a
number of years far in excess of the age of the universe) and a minimum value of one
millisecond.
Although a Timespan variable is stored as a special type of Float variable, it is best
manipulated using the Date and Time function blocks.

Cortex Ltd © 2015 All Rights Reserved Page 126


Cortex Studio V6 User Guide

Declaration
Timespan variables must be declared in a Variables Store before they can be used.
Declaring a variable does not assign a value to the variable (unless it is ‘Initialised’ at the
same time); it simply creates the variable that is then available for use.
Initialisation
Timespan variables may be initialised when the Timespan variable is declared by entering
the required initialisation value in seconds; the initialisation value can contain up to three
decimal places to accommodate spans involving milliseconds. Alternatively, a Timespan
variable may be assigned an initial value using the ‘Create Timespan’ block from the Date
and Time palette.

7.2.1.7 Object Variables


An Object Variable can hold an instance of an underlying Cortex server object; this variable
type is for ‘advanced use’ only.
Declaration
Object variables must be declared in a Variables Store before they can be used. Declaring
a variable does not assign a value to the variable, it simply creates the variable that is then
available for use.
 It is not possible to ‘Initialise’ an Object variable at the time of its Declaration.
Initialisation
Object variables cannot be initialised at the time of declaration; Object variables can only
be defined and populated using the ‘Create Object’ block from the Object Manipulation
and Relation Blocks palette.

7.2.2 Composite Variables

7.2.2.1 List Variables


A List Variable holds an ordered collection of other variables, which may be of differing
types. It is possible to have a List contained within a List within another List; a practice
known as ‘nesting’.
Values
The elements within a List variable can assume the values associated with the element’s
type. For example, if an element of a List was an Integer, then that element can hold any
value that can be contained within an Integer variable.
Referencing
The List variable as a whole may be referenced directly by using the ($) symbol, i.e.,
($)<ListVariable>
A single element in the List variable is referenced by its position (Index) within the List.
The first element in the List has Index = 0; the nth element has Index = (n-1). For example,
the third element of a List would be referenced directly as ($)<ListVariable>[2] or cast
into a Text type by {{<ListVariable>[2]}}
Declaration
List variables must be declared in a Variables Store before they can be used. Declaring a
variable does not assign a value to the variable (unless it is ‘Initialised’ at the same time);
it simply creates the variable that is then available for use.
Initialisation
The elements of List variables may be initialised when the List is declared, or created using
the ‘Create List’ bock from the List Manipulation palette.

Cortex Ltd © 2015 All Rights Reserved Page 127


Cortex Studio V6 User Guide

7.2.2.2 Structure Variables


A Structure variable holds a collection of variables, with each element consisting of a Name
and Value pair. A corollary of this is that every element within a single Structure must
have a different name.
Values
The value of the elements within a Structure variable can assume the values associated
with that element’s type. For example, if an element of a Structure was a Float, then that
element can hold any value that can be contained within a Float variable.
Referencing
The Structure variable as a whole may be referenced directly by using the ($) symbol, i.e.,
($)<StructureVariable>
Individual elements of the Structure variable are accessed by using a reference that
combines the Structure name and the element name, separated by a period or full-stop, in
the format <structure-name>.<element-name>. For example, an element entitled ‘Age’,
contained within a Structure named ‘Employee’ would be directly referenced as
($)Employee.Age or cast into a Text type by {{Employee.Age}}.
Declaration
Structure variables must be declared in a Variables Store before they can be used.
Declaring a variable does not assign a value to the variable (unless it is ‘Initialised’ at the
same time); it simply creates the variable that is then available for use.
Initialisation
The elements of a Structure variable may be defined when the Structure variable is
declared, or it may be created using the ‘Create Structure’ block from the Structure
Manipulation palette. Individual elements of a Structure variable may also be defined and
assigned a value from a pre-defined file, again using blocks from the Structure Manipulation
palette.

7.2.2.3 Table Variables


A Table variable is similar to a List of identical Structures; however, columns within the
Table variable can be assigned some special properties:
 Primary-Key-Columns (Optional)
The Primary-Key-Columns property identifies which columns will be used to hold
the Primary Keys. Primary Keys are used to uniquely identify each row in a
Table, and as such, the combination of the values in the Primary Key columns
must be unique.
 Nullable Columns (Optional)
The Nullable Columns property identifies which columns may hold a null value,
i.e. not contain a value.
 Read Only Columns (Optional)
The Read Only Columns property identifies which columns contains values that
cannot be overwritten, i.e., the values are read-only.
Values
The elements within a Table variable can assume the values associated with the column’s
type. For example, if a column was defined to be of an Integer type, then that column can
hold values that can be contained within an Integer variable.
Referencing
The Table variable as a whole may be referenced directly by using the ($) symbol, i.e.,
($)<TableVariable>
Single values within the Fields of the Table variable should be accessed and manipulated
using function blocks from the Table Blocks palette.

Cortex Ltd © 2015 All Rights Reserved Page 128


Cortex Studio V6 User Guide

Declaration
Table variables must be declared in either a Variables Store before they can be used.
Declaring a variable does not assign a value to the variable; it simply creates the variable
that is then available for use.
 Note: It is not, at present, possible to ‘Initialise’ a Table variable at the time of its
Declaration.
Initialisation
Table variables cannot be initialised at the time of declaration. Table variables can only be
initialised by either using the ‘Create Table’ function block and populated using blocks
from the Table Blocks palette, or defined and populated using the ‘Query DB’ block from
the Database Block palette to query an external database to bulk load multiple records into
a Table variable.
Each Record within a Table is inserted, deleted or modified, one at a time, using Blocks
from the Table Blocks palette. If required, columns may be added or removed at any time
during the execution of a flow using blocks from the Table Blocks palette.
Blocks are available to query a single value (Field) within a Table, complete Records
(Rows), create a List of column values and even create a new Table based on a composite
query acting upon the source Table. For further information on Table manipulation, see
Section 4.4.1.3.

7.2.3 Multi-Type Variables

7.2.3.1 Quantity Variables


A Quantity variable can hold either an Integer value (see Integer Variable) or a Float value
(see Float Variable).
Values
A Quantity variable will assume the minimum and maximum values of the type of value
assigned to it. For example, if a Quantity variable was assigned the value 231, it would
assume the type of Integer and be constrained to the values that can be stored in an
Integer variable; however, if the same Quantity variable was assigned the value 31.2, it
would assume the type of Float and be constrained to the values that can be stored in a
Float variable.
 Note: A Quantity variable will always assume either an Integer or Float type
dependent on the value stored within the Quantity variable. Therefore care should
be taken when using a Quantity variable as the source variable in a function block,
as its type will vary dependent on the value that it holds.
Casting and Automatic Conversion
Quantity variables may be ‘cast’ to a string representation by using the double-brace
operator, for example: {{<QuantityVariable>}}
A Quantity variable holding an Integer value, and therefore assuming the characteristics of
an Integer, can be automatically converted to a Float type.
Declaration
Quantity variables must be declared in a Variables Store before they can be used.
Declaring a variable does not assign a value to the variable (unless it is ‘Initialised’ at the
same time); it simply creates the variable that is then available for use.
Initialisation
Quantity variables may be initialised when the Quantity variable is declared, or it may be
assigned an initial value using the ‘Set Variable’ block from the Variable Blocks palette.

Cortex Ltd © 2015 All Rights Reserved Page 129


Cortex Studio V6 User Guide

7.2.3.2 Value Variables


A Value variable can hold any of the simple or complex variable types, except for an Object
variable; i.e. Integer, Float, Text, Boolean, List, Structure, DateTime or Timespan.
Values
A Value variable will assume the characteristics of the type of value assigned to it. For
example, if a Value variable was assigned the value 231, it would assume the type of
Integer and be constrained to the values that can be stored in an Integer variable; however,
if the same Value variable was assigned the value ‘some text’, it would assume the type of
Text and be constrained to the values that can be stored in a Text variable.
 Note: A Value variable will always assume the type of either: Integer, Float, Text,
Boolean, List, Structure, DateTime or Timespan, dependent on the value stored
within the Value variable. Therefore care should be taken when using a Value
variable as the source variable in a function block, as its type will vary dependent
on the value that it holds.
Casting and Automatic Conversion
Value variables may be ‘casted’ to a string representation by using the double-brace
operator, for example: {{<ValueVariable>}}; however, care should be taken if the Value
variable contains a type other than Integer, Float, Text or Boolean.
A Value variable holding an Integer value, and therefore assuming the characteristics of an
Integer, can be automatically converted to a Float type.
Declaration
Value variables must be declared in a Variables Store before they can be used. Declaring a
variable does not assign a value to the variable (unless it is ‘Initialised’ at the same time);
it simply creates the variable that is then available for use.
Initialisation
Value variables may be initialised when the Value variable is declared, or it may be
assigned an initial value using the appropriate function block for the type of value being
assigned.

7.2.3.3 Any Variables


An Any variable can hold any information type, including data relating to an Object
variable.
Values
An Any variable will assume the characteristics of the type of value assigned to it. For
example, if an Any variable was assigned the value 231, it would assume the type of Integer
and be constrained to the values that can be stored in an Integer variable; however, if the
same Any variable was assigned the value ‘some text’, it would assume the type of Text
and be constrained to the values that can be stored in a Text variable.
 Note: An Any variable will always assume the type of either: Integer, Float, Text,
Boolean, List, Structure, DateTime, Timespan, or Object, dependent on the value
stored within the Any variable. Therefore care should be taken when using an Any
variable as the source variable in a function block, as its type will vary dependent
on the value that it holds.
Casting and Automatic Conversion
An Any variable may be ‘cast’ to a string representation by using the double-brace
operator, for example: {{<AnyVariable>}}; however, care should be taken if the Any
variable contains a type other than Integer, Float, Text or Boolean.
An Any variable holding an Integer value, and therefore assuming the characteristics of an
Integer, can be automatically converted to a Float type.

Cortex Ltd © 2015 All Rights Reserved Page 130


Cortex Studio V6 User Guide

Declaration
All Any variables must be declared in a Variables Store before they can be used. Declaring
a variable does not assign a value to the variable (unless it is ‘Initialised’ at the same
time); it simply creates the variable that is then available for use.
 Note: It is not possible to ‘Initialise’ an Any variable with an Object type value at
the time of its Declaration.
Initialisation
An Any variable may be initialised when the Any variable is declared (except for assigning
an Object type value), or it may be assigned an initial value using the appropriate function
block for the type of value being assigned.

Cortex Ltd © 2015 All Rights Reserved Page 131


Cortex Studio V6 User Guide

7.3 Appendix 3: Expressions Detail


7.3.1 Logical Expressions
A logical expression can consist of variables or functions of the types: Logical, Integer,
Float, Quantity or Text, including the individual elements contained within a List or
Structure.
Logical Variables
Logical variables can be compared to other Logical variables, logical expressions, or the
logical values True or False.
For example, using a Logical variable named is-administrator, the logical expression can
take the form of:
{{is-administrator}} = true
In this example, if is-administrator contains the Boolean value of True, then the above
expression will evaluate to True. As a Logical variable can only contain the values True or
Talse, the logical expression can be shortened to simply:
{{is-administrator}}
Text Variables
Text variables can be compared to other Text variables or explicit character strings. In
comparisons involving text values, the Text variables and any explicit character strings
must be enclosed in single inverted commas (‘’) to differentiate them from other data
types.
For example, using a Text variable named username, the logical expression can take the
form of:
‘{{username}}’= ‘admin’
In this example, if username contains the text string ‘admin’, then the above expression
will evaluate to True.
A logical expression used to compare two Text variables (in this case testing that the two
variables are not equal) would take the form of:
‘{{username}}’ /= ‘{{entered-name}}’
In this example, if username contains the text string ‘admin’, and entered-name contains
the text string ‘John’, then the above expression will also evaluate to True as the two Text
variables are not equal.
Quantities/Integers/Floats
Quantities, Integer and Float variables may be compared to other variables of type
Quantity, Integer or Float. Although this may seem counter intuitive to be able to compare
two numeric variables of differing types, Cortex allows this type of construct.
For example, using an Integer variable named number-of-connections, the logical
expression can take the form of:
{{number-of-connections}} > 100
In this example, if number-of-connections contains the value of 150, the above
expression will evaluate to True.
An arithmetic expression may also be used to form a logical expression involving numeric
variables, for example:
({{number-of-connections}} / 2) >= 100
In this example, if number-of-connections contains the value of 150, the above
expression will evaluate to False.

Cortex Ltd © 2015 All Rights Reserved Page 132


Cortex Studio V6 User Guide

For any of the variable types, more complex expressions may be formed using the Boolean
operators: AND, OR or NOT. For example, the following expression checks to ensure that the
variable username is neither ‘admin’ nor ‘root’; i.e. if username is either ‘admin’ or
‘root’, the expression will evaluate to False:
(‘{{username}}’ /= ‘admin’) AND (‘{{username}}’ /= ‘root’)
Finally, here is an example of an expression which evaluates to True if the ‘username’ is
not ‘rafa’, the user is an administrator, and the number of connections divided by two is
not greater or equal to 100; if any of these conditions is not met, then the expression will
evaluate to False:
(‘{{username}}’ /= ‘rafa’) AND {{is-administrator}} AND NOT(({{number-of
connections}} /2) >= 100)

Operators that can be used in logical expressions

Operator Description

OR Logical OR

AND Logical AND

NOT Logical NOT

= Is equal to

/= Is not equal to

> Is greater than

>= Is greater or equal to

< Is less than

<= Is less than or equal to

Table 21 – Operators for Logical Expressions

Cortex Ltd © 2015 All Rights Reserved Page 133


Cortex Studio V6 User Guide

7.4 Appendix 4: Regex Detail


7.4.1 Regular Expressions (Regex)
A Regular Expression (Regex) provides a concise and flexible mechanism to match or
identify specific characters or patterns of characters. Regex is formed using a simple string
of literal and special text characters to undertake complex pattern matching.
This section provides detail on the syntax that needs to be used for general expressions
within Cortex flows.

7.4.1.1 Simple Character String Match


The first occurrence of a simple, literal character string may be matched explicitly using
the character string itself. In the examples below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: is
Match: “This is an equation: 1+1=2”
Note that Regex is case sensitive. For example,
Source text: “This is an equation: 1+1=2”
Regex: t
Match: “This is an equation: 1+1=2”

7.4.1.2 Match the Start of a String


To match a character string only to the start of the source text, use the carat (^) symbol.
In the examples below, the matching text is highlighted in red.
Example 1:
Source text: “This is an equation: 1+1=2”
Regex: ^is
Match: No match
Example 2:
Source text: “This is an equation: 1+1=2”
Regex: ^Thi
Match: “This is an equation: 1+1=2”

7.4.1.3 Group Characters to Match


Although a simple match of literal characters may be achieved by simply using the
character string itself, see Section 7.4.1.1, the characters may be grouped into a single
instance by using brackets. In simple circumstances, the grouping of characters will yield
an identical result as the ungrouped character string; however, more complex matches may
require operations to be performed on the whole group of characters rather than just a
single character. This is analogous to simple mathematics where brackets are used to
denote the precedence of operations, i.e., 2+3*2=8, whereas (2+3)*2=10.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: (hi)
Match: “This is an equation: 1+1=2”

7.4.1.4 Match a Single Character to a Range of Characters


To match the first occurrence of a single character from within a range of alphabetic
characters, separate the range of characters with a hyphen and enclose the expression in
braces, i.e. to match within the character range ‘a’ to ‘i’ use {a-i}.

Cortex Ltd © 2015 All Rights Reserved Page 134


Cortex Studio V6 User Guide

In the example below, the matching text is highlighted in red:


Source text: “This is an equation: 1+1=2”
Regex: {a-i}
Match: “This is an equation: 1+1=2”

7.4.1.5 Match a Single Character to a Not a Range of Characters


To match the first occurrence of a single character to one not within a range of alphabetic
characters, prefix the first character of the range within the braces with the carat (^)
symbol, i.e. to match a character not within the character range ‘a’ to ‘i’ use {^a-i}.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: {^a-i}
Match: “This is an equation: 1+1=2”

7.4.1.6 Match to a Lowercase Character


To match the first occurrence of a lowercase character, extend the range of alphabetic
characters, see Section 7.4.1.4, to match to include all of the lowercase characters, i.e. to
match within the character range ‘a’ to ‘z’ using {a-z}.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: {a-z}
Match: “This is an equation: 1+1=2”

7.4.1.7 Match to an Uppercase Character


To match the first occurrence of an uppercase character, extend the range of alphabetic
characters, see Section 7.4.1.4, to match to include all of the uppercase characters, i.e. to
match within the character range ‘A’ to ‘Z’ using {A-Z}.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: {A-Z}
Match: “This is an equation: 1+1=2”

7.4.1.8 Match to an Alphabetic Character


The first occurrence of a single alphabetic character, regardless of case, in the source text
may be identified by using the reserved keyword <alphabetic>.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: <alphabetic>
Match: “This is an equation: 1+1=2”

7.4.1.9 Match to a Numeric Character


The first occurrence of a single numeric character in the source text may be identified by
using the reserved keyword <numeric>.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: <numeric>
Match: “This is an equation: 1+1=2”

Cortex Ltd © 2015 All Rights Reserved Page 135


Cortex Studio V6 User Guide

7.4.1.10 Match to an Alphanumeric Character


The first occurrence of a single numeric character or alphabetic character (regardless of
case) in the source text may be identified by using the reserved keyword <alphanumeric>.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: <alphanumeric>
Match: “This is an equation: 1+1=2”

7.4.1.11 Match to Whitespace


To match the first occurrence of whitespace or a carriage return, use the reserved keyword
<whitespace>.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: s<whitespace>a
Match: “This is an equation: 1+1=2”

7.4.1.12 Match to Any Single Character


To match the first occurrence of any character, including whitespace, use the reserved full
stop or period (.) symbol.
In the example below, the matching text is highlighted in red:
Source text: “This is an equation: 1+1=2”
Regex: e..a
Match: “This is an equation: 1+1=2”

7.4.1.13 Match to Zero or More Occurrences


To match the first occurrence of zero or more contiguous instances of an expression, use
the asterisk (*) symbol; this symbol must follow the matching expression. In the examples
below, the matching text is highlighted in red.
Example 1:
Source text: “This is an equation: 1+1=2”
Regex: Th<whitespace>*is
Match: “This is an equation: 1+1=2”
Example 2:
Source text: “This is an equation: 1+1=2”
Regex: is<whitespace>*
Match: “This is an equation: 1+1=2”
Example 3:
Source text: “This is an equation: 1+1=2”
Regex: (is<whitespace>)*
Match: “This is an equation: 1+1=2”

7.4.1.14 Match to One or More Occurrences


To match the first occurrence of one or more contiguous instances of an expression, use the
plus (+) symbol; this symbol must follow the matching expression. In the examples below,
the matching text is highlighted in red.

Cortex Ltd © 2015 All Rights Reserved Page 136


Cortex Studio V6 User Guide

Example 1:
Source text: “This is an equation: 1+1=2”
Regex: Th<whitespace>+is
Match: No match
Example 2:
Source text: “This is an equation: 1+1=2”
Regex: (is<whitespace>)+
Match: “This is an equation: 1+1=2”

7.4.1.15 Match to Zero or One Occurrences


To match the first occurrence of zero or one instances of an expression, use the question
mark (?) symbol; this symbol must follow the matching expression. In the examples below,
the matching text is highlighted in red.
Example 1:
Source text: “This is an equation: 1+1=2”
Regex: Th<whitespace>?is
Match: “This is an equation: 1+1=2”
Example 2:
Source text: “This is an equation: 1+1=2”
Regex: (is<whitespace>)?
Match: “This is an equation: 1+1=2”

7.4.1.16 Match to One Expression or Another


To match the first occurrence of one expression or another expression, use the vertical bar
(|) symbol to denote the logical OR operation between the two expressions. The use of the
logical OR may be extended to three or more alternatives. In the examples below, the
matching text is highlighted in red.
Example 1:
Source text: “This is an equation: 1+1=2”
Regex: (an)|(is)
Match: “This is an equation: 1+1=2”
Example 2:
Source text: “This is an equation: 1+1=2”
Regex: a(t|n|s)
Match: “This is an equation: 1+1=2”

7.4.1.17 Match Special or Reserved Characters


To match a special or reserved character in a literal character string, the special character
must be ‘escaped’ by prefixing it with the reserved backslash (\) character. In the
examples below, the matching text is highlighted in red.
Example 1:
Source text: “This is an equation: 1+1=2”
Regex: 1+
Match: “This is an equation: 1+1=2”
Example 2:
Source text: “This is an equation: 1+1=2”
Regex: 1\+
Match: “This is an equation: 1+1=2”

Cortex Ltd © 2015 All Rights Reserved Page 137


Cortex Studio V6 User Guide

7.4.1.18 Reserved Regex Characters


There are certain, reserved characters that cannot be used directly for literal character
matching in a Regex as they have special meanings; in order to match with one of these
reserved characters, it is necessary to prefix the reserved character with the backslash (\)
symbol. See Table 22 for a list of all reserved Regex characters.

Reserved Regex Characters


Reserved Name Description Literal
Symbol Usage

\ Backslash Used to prefix reserved Regex characters for literal usage. \\


Carat Used to match with the start of the source text, see
^ Section 7.4.1.2, or to negate a range of characters, see \^
Section 7.4.1.5.
Open bracket Used to denote the start of a grouping of characters, see
( Section 7.4.1.3.
\(
Closed Used to denote the end of a grouping of characters, see
) bracket Section 7.4.1.3.
\)

{ Open brace Used to denote the start of a range, see Section 7.4.1.4. \{
Plus sign Used after an expression to denote a match of one or more
+ contiguous instances, see Section 7.4.1.14.
\+
Asterisk Used after an expression to denote a match of zero or
* more contiguous instances, see Section 7.4.1.13.
\*
Question mark Used after an expression to denote a match of zero or one
? instances, see Section 7.4.1.15.
\?
Full stop or
. period
\.

Table 22 – Reserved Regex Characters

Cortex Ltd © 2015 All Rights Reserved Page 138


Cortex Studio V6 User Guide

7.5 Appendix 6: Built-in Functions


Cortex has a number of built-in functions, which can be used within the Flow to obtain
information about the Flow execution’s environment. The output from all of these
functions can be assigned as text to a Text variable, which may be subsequently processed
within the flow.

Function name Description Example


Most recent interface error
f_api-error encountered. Blank if most recent
interface interaction was error-free.

f_API-Error-History Full history of interface errors for this


flow instance.
F_API-Failures
f_Assigned-To Not currently used.

f_Call-Stack The ‘path’ to the current Token


location.
f_Day-of-the-Month Numeric day of the month. 15
f_Day-of-the-Week Name of the day of the week. WEDNESDAY
URL to interact with this instance http://cortex-
of the flow execution via server/LivePortalSite/viewexe
f_Execution-Url
LivePortal. cution.aspx?threadid=1585e1a
6bca011e2bc9a0050b64c04c7

f_Error The last error message; only available


after executing an error handler.
14 May 2013 4:25:37 p.m.:
Full history of errors for this Block Type: HTTP-
f_Error-History
execution, including interface errors SIMPLESOAPREQUEST-BLOCK,
ID=1042,

Raw text of the most recent error The remote server returned an
f_Error-Raw without context information, e.g., error: (500) Internal Server
date, time, function block etc. Error.
f_Export-Name Export name for the current flow. ‘Add new Employee’
f_Get-Date-Time Date & time in abbreviated format. 15-Dec-2013 17:57:32

f_Get-Date-Time-ms Date & time in abbreviated format, 15-Dec-2013 17:57:32:365


including milliseconds.
f_Hour The current hour (0 to 23). 17
f_Initiator Name of the initiator of the flow. LEONM

f_Last-UI-Event Identifies the last event on the most btnNavigationNext


recent UI custom web-form.
f_Long-Date Current date in long format. 15 December 2013
f_Long-Date-Time Current date and time in long format. 15 December 2013 17:57:32
f_Minute Current minute (0 to 59). 57

f_Month Current month number in two-digit 05


format.

Cortex Ltd © 2015 All Rights Reserved Page 139


Cortex Studio V6 User Guide

Function name Description Example


The total number of elapsed seconds 436506
since system start-up. This can be used
f_Now for elapsed time calculations in flows,
but in most cases the use of DateTime
and Timespan variables would be
preferable.
f_Owner Not currently used.

f_Reference Reference for the flow as set when the


flow was launched.
f_Second Current second (0 to 59). 32

f_Sequence-Name Internal name configured for the flow ADD-NEW-EMPLOYEE


being executed.
f_Short-Date Current date in short format. 15/05/2013
f_Short-Date-Time Current date and time in short format. 15/05/2013 17:57:32

f_State-Name Name of the State currently being TEST-1


executed.
f_Time Current time in 24hr format. 17:57:32
An execution of ADD-NEW-
f_Title Title of the flow execution. EMPLOYEE started at 14 May
2013 3:09:20 p.m.
f_Year Current year. 2013

Table 23 – Cortex Built-in Functions

Cortex Ltd © 2015 All Rights Reserved Page 140


Cortex Studio V6 User Guide

7.6 Appendix 7: Using HTML within LivePortal


7.6.1 Placement of LivePortal Controls
LivePortal Controls, placed on the workspace, are processed in order from left to right, and
from top to bottom; the actual position of the control on the workspace does not affect
how it is displayed on the LivePortal user’s browser.
Two LivePortal Controls, placed on the workspace one above the other, will be displayed to
the user as two controls, one directly above the other, no matter how much space was left
between the controls on the workspace; see Figure 121.

Figure 121 – LivePortal Controls Displayed as Vertically Adjacent

The Navigation Control Button block is always displayed at the bottom of the web-form, no
matter where it’s placed relative to LivePortal controls on the workspace; see Figure 122.

Cortex Ltd © 2015 All Rights Reserved Page 141


Cortex Studio V6 User Guide

Figure 122 – Navigation Control Button Block is Always Displayed at the Bottom

 Note: Although the Block Navigation Control buttons may be place anywhere on the
worksheet, it is recommended that they place at the bottom of the worksheet to
improve the visibility of the layout.
Two LivePortal controls, placed side by side on the workspace will be displayed to the
LivePortal user as directly adjacent to each other, separated by a single space; see Figure
123. If a single control is too wide to be displayed on the user’s browser, a scroll bar will
automatically be displayed to enable the use to scroll to view the whole control.

Cortex Ltd © 2015 All Rights Reserved Page 142


Cortex Studio V6 User Guide

Figure 123 – LivePortal Controls are Always Displayed as Horizontally Adjacent

 Note: If the Title property is used on horizontally adjacent controls, all the text of
the Title properties will appear together, before the actual controls themselves;
see Figure 124.

Figure 124 – Text in Title Properties of Adjacent Controls is Always Displayed at the Left

In order to label controls that are to be displayed horizontally adjacent to each other, do
not use the control’s Title property, but instead insert a Label control before each control;
See Figure 125.

Cortex Ltd © 2015 All Rights Reserved Page 143


Cortex Studio V6 User Guide

Figure 125 – Use Label Controls in Place of Text in Title Properties

Controls need not to be placed directly aligned with each other to form an adjacency, nor
does there have to be clear space between the controls (i.e., the controls can overlap), for
the controls to be displayed correctly; see Figure 126.

Figure 126 – Controls Not Aligned will be Displayed Correctly

 Note: It is recommended and good practice that the controls are laid out in a tidy
and organised fashion on the workspace in order to enable easy visibility of the
intended layout of the rendered display.
If the web page displayed to the user is not wide enough to display all the horizontally
adjacent controls on a single line, then the controls will wrap onto the next line; see Figure
127.

Cortex Ltd © 2015 All Rights Reserved Page 144


Cortex Studio V6 User Guide

Figure 127 – Text will be Wrapped if Controls Exceed Display Page Width

7.6.2 Using Inline HTML Tags in LivePortal Controls


HTML tags may be used inline within the Property-Value property field of the ‘Text’
property group of the Label and Literal LivePortal controls; HTML tags may also be used
within the Title property of other LivePortal controls. For example, the Title property of a
Textbox control can be bolded by inserting the relevant HTML tags around the text, e.g.,
<b>Some bold text</b>. See Figure 128 for an example of using inline HTML tags within
the Title property of Textbox controls.
 Note: Inline HTML tags should not be used within the Property-Value property field
of the ‘Text’ property group of any control other that the Label and Literal
controls.

Cortex Ltd © 2015 All Rights Reserved Page 145


Cortex Studio V6 User Guide

Figure 128 – Inline HTML Tags in Textbox Title Property

Multiple HTML tags may be inserted within a relevant field, for example, if the Property-
Value property of the ‘Text’ group properties of a Label control was set to:
<b style=”color:Red;”>This text is bold</b><br/><i style=”color:blue;”>This
text is italicised.</i>,
The resultant rendered web-form would be displayed as shown in Figure 129.

Cortex Ltd © 2015 All Rights Reserved Page 146


Cortex Studio V6 User Guide

Figure 129 – Multiple Inline HTML Tags in a Label Control

However, where empty tags, e.g. <br/>, are used, or if the inline formatting covers a
number of sequential elements, e.g. using the <div></div> tags, then the use of the Literal
control should be preferred. For example, the Literal control is used to format the
following example to make the workspace layout more representative of the LivePortal
displayed web-page, see Figure 130.

Cortex Ltd © 2015 All Rights Reserved Page 147


Cortex Studio V6 User Guide

Figure 130 – Use of Literal Controls

 Note: The Literal is regarded at an element within the web-page and inherently
introduces a line-break. Using a line-break tag (<br/>) within the Literal causes
two line breaks (one inherently, and one from the explicit HTML tag), see Figure
130.
It is not possible to format the appearance of the controls themselves using inline HTML
tags. To format the actual controls themselves, Cascading Style Sheet (CSS) Classes should
be used.

7.6.3 Using Cascaded Style Sheets


LivePortal controls can be formatted using CSS classes, which are defined in an external
CSS file, with default location on the Cortex Application Server in:
C:\Program Files (x86)\Innovise\Cortex LivePortal\Site\Styles\FormStyles.css
A CSS class is applied to the LivePortal control by specifying the CSS class in the Property-
Value property of the ‘Css class’ property group of the control. The applied CSS class only
affects the LivePortal control itself; it does not affect the Title property of the control.
Figure 131 shows the same CSS class applied to both a Label control and a Textbox control;
note that the displayed text in the Title property of the Textbox control is not affected by
the CSS styling applied to the control.
If it is necessary to apply the CSS class to the text in the Title property, this must be done
explicitly using inline HTML tag; for example, <div class=”css_class”>Text in
title</div>. where ‘css_class’ is the name of the required CSS class to be applied.

Cortex Ltd © 2015 All Rights Reserved Page 148


Cortex Studio V6 User Guide

Figure 131 – CSS Class Applied to Label and HTML Literal Controls

Table 24 below details the behaviour and precedence of the CSS class and inline HTML tags
applied to various LivePortal control properties.
 Note: that the Label and Literal controls have different behaviour characteristics to
each other and the other LivePortal controls.

Highest Lowest
Precedence Precedence

HTML Tags HTML tags on


LivePortal Control in Control Properties CSS Class workspace
outside Control

Additive & Additive &


Label Overrides lower Overrides lower precedence Affected
precedence formatting formatting

Additive &
Literal Overrides lower Not Affected Affected
precedence formatting

Additive & Not Affected by CSS class in


Other LivePortal Controls Property-Value property
Overrides lower Affected
(Title property) precedence formatting CSS class should be
referenced inline in Title

Other LivePortal Controls Not Affected &


Not Affected Affected
(not Title property) Not Recommended

Table 24 – CSS Classes and HTML Tag Behaviour and Precedence

Figure 132 and Figure 133 show the behaviour and precedence of workspace section
formatting, CSS classes applied to LivePortal controls and inline HTML Tags; Figure 132

Cortex Ltd © 2015 All Rights Reserved Page 149


Cortex Studio V6 User Guide

shows the layout in the workspace of a ‘User Interaction’ block; Figure 133 shows how the
rendered web-form is formatted.

Label: No CSS class formatting


 Applies section formatting to label text

HTML Literal: CSS class formatting


 Ignores CSS class formatting but applies
section formatting to label text

Label: CSS class & inline HTML formatting


 CSS class formatting overrides section
formatting, but is overridden by inline HTML
tags

Textbox: CSS class & inline HTML formatting


 Title property follows section formatting and is
unaffected by CSS class; inline HTML tags
override section formatting
 Textbox ignores section formatting but follows
CSS class formatting

Textbox: CSS & inline Class and HTML formatting


 Title property formatting overridden by inline
CSS class formatting; inline HTML tags override
section formatting
 Textbox follows CSS class formatting and
ignores inline HTML tags

Figure 132 – CSS Classes and HTML Tag Behaviour and Precedence on Workspace

Label: No CSS class formatting


 Applies section formatting to label text

HTML Literal: CSS class formatting


 Ignores CSS class formatting but applies
Font Colour: Green; Font Weight: Normal

section formatting to label text

Label: CSS class & inline HTML formatting


 CSS class formatting overrides section
formatting, but is overridden by inline HTML
tags

Textbox: CSS class & inline HTML formatting


Section formatting:

 Title property follows section formatting and is


unaffected by CSS class; inline HTML tags
override section formatting
 Textbox ignores section formatting but follows
CSS class formatting

Textbox: CSS & inline Class and HTML formatting


 Title property formatting overridden by inline
CSS class formatting; inline HTML tags override
section formatting
 Textbox follows CSS class formatting and
ignores inline HTML tags

Figure 133 – CSS Classes and HTML Tag Behaviour and Precedence on Web-Form

Cortex Ltd © 2015 All Rights Reserved Page 150


Cortex Studio V6 User Guide

8 Index

1:1 ............................................................................................................ 35
Activity blocks ........................................................................................ 14, 60
Add Breakpoint ............................................................................................ 38
Add note .................................................................................................... 38
Any variable .......................................................................................... 21, 130
Automation .................................................................................................. 8
Block configuration ....................................................................................... 47
Block error handling ...................................................................................... 82
Block Icon ................................................................................................... 15
Blocks ........................................................................................................ 14
Boolean variable ................................................................................ 18, 50, 126
Breakpoints ............................................................................................... 115
Button control.............................................................................................. 98
Button Control ............................................................................................. 98
Calendar Control ........................................................................................ 102
Calendar Extender Control ............................................................................ 103
Cancel flow execution .................................................................................. 119
Cascaded Style Sheets .................................................................................. 147
Checkbox Control ........................................................................................ 101
Clone.................................................................................................... 37, 38
Close ......................................................................................................... 35
Close Flow .................................................................................................. 29
Collapse All ................................................................................................. 31
Commit Flow ............................................................................................... 33
Composite variable ................................................................................... 19, 63
Connect Backward......................................................................................... 45
Connect Forward .......................................................................................... 45
Connecting blocks ......................................................................................... 44
Connection-String ......................................................................................... 79
Context menus ............................................................................................. 37
Continue flow execution ........................................................................... 36, 119
Cortex ........................................................................................................ 8
Cortex Gateway ............................................................................................. 9
Cortex Gateway User Interface ......................................................................... 25
Cortex Studio ............................................................................................9, 25
Cortex Studio User Interface ............................................................................ 27
Current user ................................................................................................ 28
Custom form................................................................................................ 91
Custom Script Control .................................................................................. 111
Custom web-form ......................................................................................... 89
Cut ...................................................................................................... 37, 38
Data entry validation ..................................................................................... 95
Database .................................................................................................... 79
DateTime variable ......................................................................... 18, 62, 63, 126
Debug Mode ................................................................................................ 33
Debugging ........................................................................................... 113, 114

Cortex Ltd © 2015 All Rights Reserved Page 151


Cortex Studio V6 User Guide

Decision branching ........................................................................................ 69


Decision making palettes ................................................................................ 17
Declaring variables ................................................................................... 21, 59
Default Error Handler .......................................................................12, 39, 42, 84
Default form ................................................................................................ 91
Default UI Configuration ............................................................................ 12, 39
Delete .........................................................................................33, 38, 44, 47
Deploy to Server ........................................................................................... 33
Double Grid Control ..................................................................................... 106
Dropdown List Control .................................................................................. 100
Duplicating blocks ......................................................................................... 44
Edit Mode ................................................................................................... 32
End Flow block ............................................................................................. 42
End State block ............................................................................................ 42
End the execution ......................................................................................... 36
Error ........................................................................................... 117, 120, 121
Error condition ............................................................................................. 71
Error functions ............................................................................................. 84
Error handling .............................................................................................. 81
Execution Progress Display .............................................................................. 23
Execution Viewer .......................................................................................... 35
Execution Viewer Toolbar ................................................................................ 36
Exit edit mode and resume executions ................................................................ 32
Expand All .................................................................................................. 31
Exporting flows ............................................................................................ 85
External database ......................................................................................... 79
External interaction palettes............................................................................ 17
Float variable ............................................................................. 18, 50, 125, 132
Flow ................................................................................................ 11, 12, 39
Flow control blocks ....................................................................................... 14
Flow observation ........................................................................................ 114
Flow Progress Display ..................................................................................... 87
Flows......................................................................................................... 26
Flows and States palettes ................................................................................ 17
For Each Loops ............................................................................................. 72
For Loops.................................................................................................... 71
Function blocks ............................................................................................ 14
Functions .................................................................................................. 139
Get the Master Version of this Flow .................................................................... 33
Global Variables Store .......................................................................... 12, 21, 39
Go To ........................................................................................................ 36
Grid Control .............................................................................................. 104
Group .............................................................................................. 11, 26, 57
Group hierarchy ........................................................................................... 23
Help .......................................................................................................... 28
History ....................................................................................................... 28
HTML Button Control .................................................................................... 110
HTML Literal control .................................................................................... 109
Human interaction ........................................................................................ 85
I/O errors ...................................................................................... 77, 113, 120

Cortex Ltd © 2015 All Rights Reserved Page 152


Cortex Studio V6 User Guide

Initialising variables .................................................................................. 22, 59


Inline HTML tags ......................................................................................... 145
Integer variable ........................................................................... 18, 50, 125, 132
Interface errors .......................................................................................... 117
Interface function blocks ................................................................................ 77
Interface simulation ...................................................................................... 78
Label Control ............................................................................................... 96
Lifetime of a variable ..................................................................................... 21
List manipulation .......................................................................................... 63
List variable .......................................................................................... 19, 127
Listbox Control ............................................................................................. 99
Literal Control ........................................................................................... 109
LivePortal ................................................................... 9, 10, 23, 85, 118, 121, 122
LivePortal Controls ...................................................................................... 141
Local Error Handler ....................................................................................... 82
Local Variables Store ..................................................................................... 21
Log Out ...................................................................................................... 26
Logical errors ............................................................................................. 113
Logical expressions ............................................................................. 22, 70, 132
Logical variable .......................................................................................... 132
Loops ........................................................................................................ 71
Main Display Area .......................................................................................... 32
Main Display Area Toolbar (Debug Mode) ............................................................. 33
Main Display Area Toolbar (Edit Mode) ................................................................ 32
Menu Bar .................................................................................................... 26
Miscellaneous palettes ................................................................................... 17
Moving blocks .............................................................................................. 43
Multiple connections ...................................................................................... 46
Multi-type variables ................................................................................. 20, 129
Navigation Bar ............................................................................................. 27
Next Flow ................................................................................................... 29
Notes......................................................................................................... 56
Object variable ...................................................................................... 19, 127
Operational Intelligence .................................................................................. 8
Orchestration ............................................................................................... 8
Palettes ........................................................................................... 14, 16, 42
Paste ......................................................................................................... 38
Pause the execution ...................................................................................... 36
Previous Flow .............................................................................................. 29
Property Editor Dialog .................................................................................... 50
Property types ............................................................................................. 48
Property Viewer ........................................................................................... 31
Quantity variable ......................................................................... 20, 50, 129, 132
Quick Navigation........................................................................................... 29
Redo ......................................................................................................... 32
Regex ................................................................................... 22, 42, 61, 70, 134
Regular Expression ............................................................................. 22, 70, 134
Remove all breakpoints ............................................................................. 33, 34
Remove Breakpoint ....................................................................................... 38
Routing of connections ................................................................................... 46

Cortex Ltd © 2015 All Rights Reserved Page 153


Cortex Studio V6 User Guide

Save .......................................................................................................... 33
Scope of variables ......................................................................................... 21
Semantic errors .......................................................................................... 113
Semaphores ............................................................................................ 23, 72
Seq Block Navigation Config ............................................................................. 92
Service Catalogue ................................................................................... 86, 121
Service Request Catalogue............................................................................... 23
Set Next Block to Execute ............................................................................... 38
Show in LivePortal......................................................................................... 37
Shrink Wrap ................................................................................................. 35
Signalling an error ......................................................................................... 85
Simple variable ............................................................................................ 18
Simple variable manipulation ........................................................................... 60
Simulated interaction................................................................................... 113
Single step ................................................................................................ 118
Software version ........................................................................................... 26
Start an execution .................................................................................... 32, 34
Start State block ...................................................................................... 41, 42
Start tracking .............................................................................................. 37
State ...................................................................................... 12, 39, 41, 42, 58
State Error Handler ............................................................................ 42, 83, 120
Static variable ............................................................................................. 22
Step the execution ........................................................................................ 36
Stop tracking ............................................................................................... 37
Structure manipulation ................................................................................... 65
Structure variable ................................................................................... 19, 128
Subtask ...................................................................................... 12, 42, 73, 120
Switch to Edit Mode ....................................................................................... 34
SYMBOL ...................................................................................................... 48
Table manipulation ....................................................................................... 67
Table variable ........................................................................................ 20, 128
Terminate LivePortal session ............................................................................ 89
Testing .................................................................................................... 113
TEXT ......................................................................................................... 48
Text manipulation ......................................................................................... 61
Text variable .............................................................................. 18, 50, 125, 132
Textbox Control ........................................................................................... 97
Timespan variable .............................................................................. 19, 63, 126
Token ...................................................................................................... 121
Toolbox ................................................................................................. 29, 43
Toolbox Icon Bar ........................................................................................... 30
Toolbox Search............................................................................................. 31
Tracking ................................................................................................... 115
Tree Selector Control ................................................................................... 108
TRUTH-VALUE .............................................................................................. 48
Types of variables ......................................................................................... 18
Undo ......................................................................................................... 32
User Interaction ...................................................................................... 24, 71
User Interaction palettes ................................................................................ 17
VALUE........................................................................................................ 49

Cortex Ltd © 2015 All Rights Reserved Page 154


Cortex Studio V6 User Guide

Value variable ........................................................................................ 21, 130


Variable .......................................................................................... 17, 71, 121
Variable manipulation .................................................................................... 60
Variable manipulation palettes ......................................................................... 16
Variables Store ............................................................................................. 41
Version ...................................................................................................... 26
Wireless blocks ............................................................................................. 76
Workspace .................................................................................................. 13
Workspace Path ............................................................................................ 28
Workspace Title ........................................................................................... 34
Workspace Window........................................................................................ 34
Workspace Window Toolbar ............................................................................. 34
Zoom In................................................................................................. 13, 35
Zoom Out .............................................................................................. 13, 34

Cortex Ltd © 2015 All Rights Reserved Page 155


Cortex Studio V6 User Guide

Cortex Studio V6 User Guide 23/03/2016

Cortex Ltd © 2015 All Rights Reserved Page 156

You might also like