Workflow Concepts

 

Documentation home

What is Ebase Workflow. 2

A Simple Example – A Loan Application. 2

Workflow Terminology. 3

Process 3

Node. 3

Task 3

Activity. 4

Routing Steps 4

Other Nodes 6

Sub-process 6

Link 6

Escalation. 6

Job. 7

Enactment 8

Resource. 8

Audit Record. 9

Task List 9

Components of the Ebase Workflow System. 9

Design-time Concepts - Processes 11

Process structure. 11

Process Properties 13

Process attributes 15

Process table attributes 15

Process In/Out Parameters 15

External Resources 16

System attributes 16

Parent attributes 18

Future configuration. 18

Versioning. 19

Activate/Quiesce. 20

Design-time Concepts – Activities 20

System Activities 20

Interactive Activities 20

ActivityType. 22

Completion State ($COMPLETION_STATE) 23

Design-time Concepts – Tasks 24

Design-time Concepts - System tasks 24

Design-time Concepts - Interactive tasks 24

Activity parameter mapping. 24

Assigning Resources to Interactive Tasks 24

Security. 26

Priorities 26

Design-time Concepts – Process Routing Steps 26

Split/Join. 26

Decisions 27

Design-time Concepts – Pause Node. 27

Runtime Concepts 28

Node Enactments 28

Enactment Lifecycles 29

Parallel Processing. 29

Escalations 29

Integration with Ebase Xi Forms 31

Invoking operations 31

Finding workflow entities 31

Job and task ids 32

Job Id. 32

Task Id. 32

 

 

See also:  Workflow Index

 

What is Ebase Workflow

 

Ebase Workflow is a standalone module which enables the automation and tracking of business processes. A business process, such as processing a loan application or answering a customer support call, is something which may involve a combination of manual and automated activities such as checking the loan request, authorizing the request, responding to the requester. The sequence in which activities are performed is important to the correct execution of the process and will often depend on the outcome of previous activities, for example, a loan can not be approved before the application has been made, and if the loan is for an amount greater then £10,000 it can only be authorized by a senior level manager. Although it is possible for a business process to be fully automated, it is often the case that one or more individuals will be required to take part in the process, for example, the manager who authorizes the loan or the customer support engineer who responds to a customer’s query.

 

The term Workflow is synonymous with a business process in that a workflow is the definition of the ways work can flow around an organization in order to achieve a specific goal.

 

A Simple Example – A Loan Application

 

The easiest way to start is to think about a simple example process. A user logs in to a web site to apply for a personal loan. The steps in the process are:

 

  1. Request – Margaret wants to buy a car. She completes an on-line loan request form entering the amount she wants to borrow and an email address she wants to be contacted at. She submits the request. This starts off the process.
  2. Is finance check required? – This is a decision step where the loan company checks whether the loan request is over £1000. If it is, the loan request has to go to the loan manager for a special manual authorization step. If it’s less than £1000 the system can automatically authorize the loan.
  3. Finance Check – This is a manual step which causes a task to appear on the loan manager’s task list. The loan manager selects the task and opens it which takes him to a loan authorization web page showing the applicant’s information. The manager can then choose to authorize or reject the application.
  4. Notification – Margaret is sent an email to notify her whether or not her loan application has been successful.

 

This is clearly a very simple example but we will continue to build on it throughout this section.

 

Workflow Terminology

 

This section introduces the terms used within the workflow system and identifies the key characteristics of the types of workflow process supported.

 

Process          

A process represents the design of a single business process, for example, handling a loan application or processing a customer order. Each process will usually consist of a number of individual tasks and may also include conditional logic. A process may also contain sub-processes. A process is created by a workflow designer using the graphical Process Designer Tool.

 

Node

A node is single “step” in the process. Nodes are linked together by Links. Nodes can be either Tasks

, Routing Steps or Sub-processes and define the sequence of events that are required to make up a valid process.

 

Task

A task represents a single unit of activity to be performed. Tasks can either be interactive (performed by a person) or system (executed automatically by the system with no human interaction). The actual activity to be performed by the task is selected from a pool of activities which can be defined separately and hence reused (see below). From the perspective of the workflow management system, tasks are atomic and cannot be sub-divided. In our loan application example, the tasks are: REQUEST, FINANCE_CHECK and NOTIFICATION. 

In the workflow designer, an interactive task is represented as:

 

 

And a system task is represented as:

 

 

Activity

This represents a specific activity to be performed. There are two types of activity:

·        Interactive Activity: An interactive activity is performed by a person and is usually implemented as an Ebase Xi form.

·        System Activity: A system activity has no human involvement and is executed automatically by the workflow engine, for example, sending an email notifying the loan applicant whether their loan has been approved. System activities are created using any supported server side scripting language.

 

Each task must be configured with a single activity of the appropriate type. Activities are defined independently of tasks to allow reuse of activity definitions across processes.

 

Note: We will use the term interactive task to refer to a task configured with an interactive activity and system task to refer to a task configured with a system activity.

 

In our example, the REQUEST task and FINANCE_CHECK task are both interactive tasks which encapsulate the loan request online form and the loan authorization on-line form respectively. The NOTIFICATION task is a system task whose activity performs the automatic sending of an email to the applicant.

 

Routing Steps

There are currently two different types of routing steps. These provide conditional routing and parallel routing capability to what would otherwise be a trivial, single path process:

 

  • Split (and Join): A split represents a point in the process execution path where two or more paths are to be executed concurrently. This is modelled as shown below. There is no decision logic associated with a split as all split paths will always be activated.  All paths leaving a split must ultimately meet at a corresponding join point. A join node will always be generated automatically when a split is added to a process and is shown linked to the split node by a dashed line.  There is no limit on the number of links coming out of a split provided that all paths leaving the split ultimately end up at its corresponding join.

 

 

 

  • Decision:  A decision represents a point in the process where one of a number of possible paths may be taken. The path chosen will be based on the decision logic provided by the process designer. There is no corresponding join for a decision as only one path can ever be followed. The ongoing path options are defined by the names on the links coming out of the decision node, for example, do a manual finance check if the loan requested is over £1000, otherwise just authorize it automatically. See Decision Scripts for more details.

 

 

 

 

Other Nodes

 

  • Pause Node: A pause node represents a point in the process where execution stops and waits for some external event to occur. When the event occurs, the node can be posted which then runs the script associated with the node. Additionally, this script can also be executed at regular intervals. The script can decide programmatically whether processing should continue or whether to continue waiting. Pause Nodes are primarily intended to be used to include external services into a workflow process that otherwise do not have the ability to connect to the workflow system, for example to periodically check a database for the existence of a record etc. See Pause Node for details.

 

 

Sub-process   

Any process can include any other process represented as a single node on the process diagram. A sub-process is represented in the designer as:

 

 

This nesting can continue to any level. This is a powerful feature that gives the ability to componentize process development. For example, an approval process could be created, then included within multiple parent processes. Note that any process can function as any or all of: a standalone process, a sub-process, or a parent process.

 

Link

Links are the arrow lines which join tasks, routing steps and sub processes together to define the flow of control through the process. Links may be labelled with a friendly name. This is optional in all cases except following a decision node. In this case, the decision logic will ultimately refer to the link to be chosen as the next step and this is done using the link’s name (See Decision Scripts for more details)

 

Escalation

Any interactive task in a workflow process may be the subject of one or more escalations. An escalation is essentially a sub-process that is automatically enacted by the Workflow Management System should some timed condition not be achieved. Typically, an escalation is used to define the required schedule for some activity. For example, it might be the case that a particular report was required to be completed within 30 working days; when this doesn’t occur an email is sent to the business process owner.

 

A task may have multiple escalations with different time requirements. For example, a first escalation could be used when half the available time has expired to raise the priority. Later, when 90% of the time has expired a warning email could be sent to the person allocated to the task to inform them that the deadline was approaching.

 

When the escalated task is completed any remaining escalations are removed. Each escalation has two workflow nodes related to it:

 

·        The trigger node, which defines when the timing for an escalator starts

·        The escalated node, which is the node that, when complete, will remove the escalator enactments.

 

For more information see escalations later in this document.

 

 

 

Job

A Job is one specific execution of a process, for example, handling Mrs. Jones’s burglary insurance claim or processing Margaret’s loan application. In discussion of workflow, the term case is sometimes used to mean the same thing; however in the context of the Ebase workflow system, the term job will be used throughout. During its lifetime, a process will have many jobs created for it, for example:

 

 

 

Enactment

An enactment is one specific execution of a node, for example, the loan manager clicking the reject button to reject Margaret’s loan application would be an enactment of the “FINANCE_CHECK” interactive task, or, the automatic sending of a rejection email to Margaret would be an enactment of the NOTIFICATION system task. During it’s lifetime a process node will have many enactments created for it, for example:

 

 

 

 

Resource                                

A resource represents the entity to whom an interactive task will be assigned and hence, the individual who will enact the activity. In our example, the resource to which the FINANCE_CHECK task will be assigned to is the person who is identified as the loan manager.

 

The concept of resource assignment is only applicable to interactive tasks since system tasks are automatically enacted by the workflow system. At design-time, the resource associated with a task may either be an explicit individual or an expression which will identify an individual at runtime, for example, “any user who belongs to the Customer Support Team” or, “the line manager of the employee requesting the car hire”. The workflow system provides a generic interface allowing organizations to plug-in their own implementations which can access their own specific HR structure. This supports a powerful and flexible capability to assign tasks to groups, teams, roles, individuals with full contextual information. See Resource Management for more information.

 

Audit Record

Audit records are generated as and when events happen within the workflow runtime which need to be recorded for historical reasons. Audit records log the event that occurred, the reason for the event (in the case where the event is user requested) and the resource name who requested the event. For example, if a job is cancelled by an administrator, the reason for cancellation and the name of that administrator are logged against the cancel action.

 

Task List        

A task list is a separate runtime application which enables end-users to see which tasks are assigned explicitly to them and which tasks are available to them for the taking (e.g. tasks to be performed by any member of their team). A sample tasklist is provided, but the Workflow API can also be used to create a customer specific task list application.

 

It is worth noting that the concepts above fall into two distinct groups:

 

·        Design-time concepts: Process, Task, Activity, Split, Join, Decision and Sub-process.
These are the terms that will be involved when designing a workflow using the graphical workflow designer tool.

·        Runtime concepts: Job, Task Enactment, Task List

These are the terms that will be involved when the workflow is executed.

 

This distinction will be carried throughout the remainder of this documentation.

 

Components of the Ebase Workflow System

 

The workflow system is made up of the following components:

 

Graphical Process Designer

This is the GUI tool which allows workflow designers to create and test processes and save these in the database.

 

Workflow Repository

This stores all workflow process and activity definitions.

 

Workflow Enactment Service

This is the heart of the workflow system and supports the creation and processing of jobs. At it’s core is a work queue which is continually running and processing task enactments as they become due.

Workflow Client Applications

These represent external applications that interface with the workflow system via the Job Management API. The most common of these are expected to be the task list application and the workflow administration application (see below). Other possible applications may be developed using the Ebase Xi forms applications developer which provides integration to the Job Management API via a scripting language.


Task List Application

This is an example client application provided with the workflow system. It presents all outstanding tasks which may be performed by an individual and allows the individual to select items from the list and complete them. This is implemented using the Job Management API. It is anticipated that the client may wish to develop a more advanced version of this application to meet their specific requirements, for example, including ability to change priority of a task, re-assigning a task etc All this capability is available from the Job Management API.

 

Workflow Administration Application

This is an example client application provided with the workflow system. It enables an administrator to browse both current and historical jobs, tasks, processes and audit records. It also allows the user to perform administration activities on these objects, for example, cancelling jobs or reassigning tasks. This application makes use of the filtered list methods on the Job Management API. (See Workflow API for more information)

 

Job Management API: This is a public interface which provides information on interactive task enactments which are sitting and waiting on the work queue for a user to take them and act on them. The implementation of this API is provided by the Workflow Enactment Service. (See Workflow API for more information)


Assignment Handler API

This controls the ability to assign task enactments to resources. The open API provides the flexibility to allow the workflow system to integrate to the client’s individual resource management solution. The implementation of this API must be provided by the client for each installation of the workflow system and will differ for each HR solution. A default implementation is provided in the form of the DefaultAssignmentHandler but it is left open to allow for organization-specific customization of role/group/team rules. (See Workflow Customization for more information)

 

Security Handler API

This controls the access to operations on the Job Management API and the visibility of results returned from these calls. This provides the flexibility to allow the workflow system to integrate to the client’s individual security management solution. A default implementation is provided in the form of the EbaseSecurityHandler which integrates into the native Ebase security solution. This can easily be replaced with a custom implementation allowing for organization-specific access and visibility rules. See Workflow Customization for more information)

 

Local calendar

Some aspects of workflow process enactment require access to the calendar used by the organization using each installation of the workflow system. (See Calendar for more information)

 

Design-time Concepts - Processes

 

This section discusses in more detail the elements involved in designing a process. It will cover processes, tasks, activities, routing steps and use of sub-processes.

 

Process structure

In order to avoid badly structured processes, the workflow system provides a process validation facility which verifies that the process meets the following criteria:

 

·        Processes:

o       A process has a single start point and a single end point which are created automatically when a new process is created. All paths in a process must ultimately originate from the same start node and culminate in the same end node. This means that it is clear when a process is finished since it is not valid to have multiple branches of a process with their own individual end points.

o       All nodes in a process are connected somehow to all other nodes. That is, there is no part of the process (sub-graph) which is disconnected from the rest of the process.

o       The only nodes allowed to have more than one output link are decisions and splits

·        Tasks:

o       A task must refer to a valid activity.

o       Input and output parameters for the activity must all be mapped to valid process attributes.

o       All tasks must have a specified assignment mode.

o       If a task has an assignment mode which refers to the resource assigned to a previous task, that task must exist in the process path before the referring task.

·        Links:

o       A link must always connect two nodes, and all nodes (other than the start and end nodes) have at least one input and one output link.

·        Splits/Joins:

o       All splits must have a matching join.

o       All process paths from a split point must rejoin at a subsequent join node without passing the original split. This means that looping back from a path resulting from a split to a node before the split is not allowed since this would result in processes where the number of times the process exits the split will not be equal to the number of times it enters the join. For example this is illegal:

 

·        Decisions:

o       A decision node must have at least two links coming out of it.

o        All links coming out of a decision node must have a non-default name. When a link is first created it is given a default name of the form “Link xx” where xx is the link number. This must be replaced by a meaningful name in the case of decision node output links so that the link names can be used in the decision logic script.

·         Pause Nodes:

o        If an event id is specified, it must be unique within the process

·        Sub-processes:

o       Sub-process nodes must refer to a sub-process that exists.

o       Input and output parameters for the sub-process must all be mapped to valid process attributes.

·        Escalations:

o       Escalations must refer to escalation sub-processes that exist

o       Escalated nodes cannot exist within a loop in the containing process structure. That is, they may not appear in a place in the process flow where a decision could cause the same escalated node to be enacted more than once.

o       If escalations inherit their assignment details from their escalated node then that node must be of a type that supports such things.

 

Process Properties

A process has the following properties associated with it:

 

·        Name: This must be unique and is used to identify a process throughout it’s lifetime.

·        Description: This is a textual description of the purpose of this process.
Note: Descriptions support multilingual text in the same manner as all other Ebase Xi forms applications.

·        Process Creator: This is the User ID of the designer who released the process last.

·        Process owner: The user Id of the person who is ultimately responsible for the design of this process although not necessarily for its implementation.

·        Job Owner assignment: This defines how the ownership of an individual job opened on this process will be decided. A job may well need to have a person defined who is ultimately responsible for that specific job. In our example, the job owner may be the person to whom Margaret is referred when she phones the bank to contest why her loan has not been approved. There are two modes for assigning Job ownership:

 

§        Static assignment - This is where the job owner is assigned explicitly at the start of a job. In this case the assignment will persist throughout the life of the job.

§        Dynamic assignment - This is where an assignment expression is defined for the job owner, for example, “the current loan manager”. This is then re-evaluated each time a task enactment refers to the job owner via the integration to the resource management system. The benefit of dynamic job ownership is that if the current loan manager changes job and a new loan manager is appointed, the dynamically evaluated job owner continues to be a valid individual.

 

·        Security:  This defines who is authorized to perform the various activities on any given job for this process. For example, any user who can see task enactments on their task list may be allowed to open a task but only someone with “administrator” privileges may be allowed to cancel an entire job. Process security also controls visibility of task enactments for a job since some tasks may contain sensitive information and may only be visible to individuals with higher access privileges, for example, anyone with “basic loans manager” privileges may be allowed to view all loan applications for up to £50,000 but only those with “senior loan manager” status are allowed to view applications for more than £50,000.

·        Error recovery process: The process designer has the option of specifying an error recovery process which will be executed at the time when a task fails during enactment. The error recovery process is just another process but will automatically be passed a number of input parameters to allow it to notify the relevant person that something bad has happened. The parameters available are:

 

§        FAILEDPROCESSNAME – the name of the process for which a task enactment has just failed.

§        FAILEDTASKNAME – the task enactment which has just failed.

§        FAILUREREASON – a text string describing the reason for failure. This will typically be the error message generated by the workflow system.

§        TARGETEMAIL – an email address which can be globally configured (see Workflow Designer Preferences) to which all system failure notifications should be sent.

 

If these are to be used in the error recovery process, they need to be declared as its process attributes.

 

Process attributes

Process attributes are variables that can have explicit values for each job; they are analogous to Ebase form fields and can be used in exactly the same way. For example, a process to handle insurance claims might have an attribute claim_number. Any number of such attributes can be defined by the process designer.

 

Values for these attributes can be passed to task enactments as they are started, read and written by task enactments or by scriptable process routing steps as they are executed for example, they could be used to determine branching logic within decision nodes. As each workflow step completes, these attribute values are persisted to the database.

 

Data types supported for process attributes are: character, numeric, integer, date, boolean, currency, datetime, time, object.

Process attributes can be:

 

·        Read and written in decision and system task scripts (see decisions and system activities).

·        Imported from a resource configured in the Resources View and mapped to resource fields.

 

Process table attributes

Process table attributes are similar to process attributes but support the storage and manipulation of tabular data; they are analogous to tables used in Ebase forms and can be used in exactly the same way.

 

Table data can be accessed and manipulated in system activity and decision scripts. They can be mapped to any tabular Ebase resources (such as Database Resources or XML Resources) and then initialised from and saved to those resources using the fetchtable and updatetable commands (see External Resources). As for simple process attributes, their runtime data is specific to each job.

 

Note: If an external resource mapped to a process table attribute is to be kept up-to-date with changes made during the execution of a job, each activity script which makes changes to that table attribute MUST call updatetable to commit the changes to that resource at the end of the script.

 

Table attributes can also be treated as completely local data (not mapped to any resource) in which case the tables must be initialized using activity scripts, adding rows and setting column values, and this data will then be available to other activities within the job context.

 

Process In/Out Parameters

Process attributes can be declared as IN (process input) or OUT (process output) or both. The IN designation has meaning for all process types, whereas the OUT designation is only applicable for attributes of sub-processes (see sub processes). A value for an IN attribute can be supplied when a new job is created.

 

The process attributes of a sub-process are ‘private’ to that process and cannot be accessed by a calling process. Similarly, the process attributes of a calling process cannot be accessed by a called process. Hence, when a process is included as a sub-process of another process, the process designer will be requested to map the IN and OUT attributes of the sub-process to attributes in the parent process. The workflow system will automatically populate values for these attributes as applicable when the sub-process starts and ends.

 

Process table attributes may also be designated IN or OUT parameters in a similar way to simple process attributes but with a few differences:

1.      Process table attributes can not be passed as IN parameters on job creation.

2.      When mapping process table attributes onto the IN/OUT parameters of a sub-process, the table structures must be identical i.e. they must have the same set of columns with the same names and same column types. This is checked by the process validation facility and an error will be reported if the table structures do not match.

 

External Resources

A process can use external resources by adding these to the process’s Resources View. This is analogous to the use of external resources in Ebase Xi forms. Resource fields can be imported into the process to create process attributes (essentially form fields) which map to the resource fields. If the resource is fetched, the data is loaded from the resource based on populated key fields. If the resource is updated, the attribute values will be propagated down to the resource fields, for example, to populate an email resource.

 

Resources can be manipulated from system task and decision scripts in the same manner as for Ebase Xi forms.

 

System attributes

In addition to explicitly declared process attributes, a number of system supplied attributes are also available. These supply information on aspects of a job as it executes and can also be used to control job behaviour for example, if an approval step needs to be assigned to the manager of the person who initiated the job the system attribute which refers to the job opener would be used which is: $OPENER_RESOURCE.

System attribute names begin with a $, and hence it is illegal for non-system attributes to begin with a $.

 

System attributes can be either read-only or read-write as shown in the table below:

 

Attribute

Description

Read

Write

Job level attributes:

$NEXT_STEP

The name of the next step to be executed on the current path of a job. This is used in decision scripts to set the next step (see Decision Scripts)

Yes

Yes (only in a decision step)

$PAUSE_COMPLETED

Set to 'Y' indicate that a Pause Node should complete (see Pause Nodes).

Yes

Yes (only in a Pause Node)

$CREATION_RESOURCE

The resource (user) that created the job.

Yes

No

$OWNER_RESOURCE

The resource that currently owns the job

Yes

Yes

$OPENER_RESOURCE

The resource that opened the job

Yes

No

$COMPLETION_STATE

The completion state for the current task.

Yes

Yes (can only be set by system tasks and sets the completion state for the currently executing task)

$CREATION_DATE

Job creation date

Yes

No

$CREATION_TIME

Job creation time

Yes

No

$JOB_ID

Job id.

Yes

No

Task level attributes: following attributes apply to each task where xxxx is the task name. If the task is executed more than once, they apply to the most recently executed instance of the task.

$WF_xxxx_RESOURCE

The resource that executed the most recent enactment of this  task on the current stream

Yes

Yes (this is a future configuration)

$WF_xxxx_COMPLETION_STATE

The completion state of the most recent enactment of this  task

Yes

No

$WF_xxxx_STATE

The workflow state of the most recent enactment of this  task

Yes

No

$WF_xxxx_PRIORITY

The priority of the most recent enactment of this  task on the current stream

Yes

Yes (this is a future configuration)

$WF_xxxx_CREATION_DATE

The creation date of the most recent enactment of this  task

Yes

No

$WF_xxxx_CREATION_TIME

The creation time of the most recent enactment of this  task

Yes

No

 

Parent attributes

For processes with sub processes, particularly in the case of escalation processes, it may be necessary for the sub process to access process or system attributes from the parent process. For example, an escalation process may well want to increase the priority of a task in the parent process. This involves getting the task’s current priority value, incrementing it by one and setting it back on the parent process. This can be done in FPL using the PARENT. prefix for any process or system attribute. In our example, to increment the priority of a task in the parent process you would write:

 

      SET PARENT.$WF_xxxx_PRIORITY = PARENT.$WF_xxxx_PRIORITY + 1

 

Where xxxx is the name of the task who’s priority is to be set (see System attributes)

 

This mechanism can also be used with any process attribute, for example, to make a check based on the value of the AMOUNT attribute of the parent process you would write:

 

      if [ PARENT.Amount > 1000 ]

 

Although, for simple process attributes, this could also be achieved by specifying an Amount attribute on the sub process, specifying it as an input parameter and mapping it to the Amount attribute of the parent process.

 

Future configuration

 

Note that this functionality is only available using the FPL programming language.

 

Setting the value of either $WF_xxxx_RESOURCE or $WF_xxxx_PRIORITY results in a future configuration being stored for the named task on the current stream. This configuration will be applied to the next enactment encountered for the named task on the same stream.

 

 

In the following example, the process contains an interactive task, DO_SOMETHING, followed by an ESCALATE task which, if the priority is greater than 1 (1 being the most severe) will increase the priority for the next occurrence of the DO_SOMETHING task and set a more senior resource to whom that task will be assigned next time it comes around. This is a fairly pathological example but is useful to demonstrate these attributes. The LOOP_BACK decision node will return to the DO_SOMETHING task if the priority is greater than 1.

 

 

When the DO_SOMETHING task is first enacted, lets assume its priority is 5. The enactment is opened by the resource to whom it is assignable and subsequently completed. The ESCALATE task is then enacted. It sets up a future configuration for the next enactment of the DO_SOMETHING task which will set it’s priority to 2 and assign it to Alan. The LOOP_BACK decision is then enacted and returns to the DO_SOMETHING task since the last priority of that task was 5.

 

The next task to enact is DO_SOMETHING so the future configuration which was previously set up is applied to this enactment. This means that the enactment’s priority is set to 2 and it is automatically assigned to Alan. Once Alan completes this task, the ESCALATE task will set up a new future configuration for the DO_SOMETHING task which will set it’s priority to 1 and assign it to Berol (the head honcho!). The LOOP_BACK decision is then enacted again. This time it checks the priority of the last enactment of DO_SOMETHING and finds that it was 2. This is greater than 1 so again it loops back and returns to the DO_SOMETHING task.

This time the future configuration is applied to the DO_SOMETHING task its priority is set to 1 and it is automatically assigned to Berol. When Berol completes the task, the ESCALATE task finds that there is nothing to do and processing goes on to the LOOP_BACK task, This time the priority of the last enactment of the DO_SOMETHING task is 1 so the LOOP_BACK task steps on to the end node.

 

 

Versioning

Versioning is performed automatically by the workflow system and is largely transparent to the designer. The purpose of versioning is to ensure that the version of all the entities used by a job during its life-time (which may be weeks or months) is effectively locked when the job started. So if, for example, a job is started for the LoanApplication process, then subsequently a change is made to a System Activity used by this process, this change will not be visible to the job.

 

Each time a new job is started, the latest version of all required entities will be used, and a new version will be created if necessary.

 

Activate/Quiesce

There may be cases where an administrator wishes to stop any jobs being opened for a process. This can be achieved by quiescing the process. When in the quiescent state, no jobs may be opened for the process. To clear this state, the process should be activated. The active state is the default state for a process. Quiescing or activating a process can be done from the Workflow administration application.

 

Design-time Concepts – Activities

 

An activity represents the actual item of work that is to be performed by a task. Activities are defined independently of processes and can be shared across processes (with some limitations, see below). The workflow system defines two types of activities, System Activities which are performed by the workflow system in their entirety and Interactive Activities which require user interaction in order to be completed.

 

System Activities

System activities are defined by server side scripts. Each system activity contains a single script which is loosely bound to the process definition. This has the following implications:

 

·        A script can refer directly to any process attributes within its logic and these can be both read and written.

·        A script’s knowledge of process attribute names is implicit. No mapping is provided. This knowledge is implied rather than enforced since activities can be shared.

·        If a script makes a reference to a process attribute that does not exist or performs any other type of illegal operation, a process runtime failure will occur. Therefore script development is an integral part of process development.

 

The ability to execute a script as a part of a process provides a lot of power. For example, a script could perform any or all of the following:

 

·        Send an email

·        Read or write data to or from a database

·        Call a web service

·        Perform complex logic which can then be fed back into the process and used to control conditional process steps

 

Some of these may require access to Ebase Xi external resources and mappings between the resource fields and the process attributes. This is done in exactly the same way as for Ebase Xi form fields using resources added to the process’s Resources View.

 

In addition to the script, a system activity can also define a set of Completion States. A system activity can set the completion state from its implementing script by setting the value of the $COMPLETION_STATE system attribute.

 

Interactive Activities

Interactive activities are typically implemented as Ebase Xi forms and are typically started by an application such as the Task List. For example, Albert the loans manager has a task list application running which shows him the loan applications which have reached the FINANCE_CHECK task and require his authorization. He can pick one of these tasks off the list and open it which should take him automatically into an authorization form. This form is the interactive activity.

 

There can be many different types of interactive task such as: running an Ebase Xi, form, running an in-house web application, running a third party application and so on. Each of these will require a potentially very different set of information to even get connected to the external system on which the activity will be performed. For example, for an Ebase form the form name is required. This information is encapsulated by an ActivityType implementation. Each activity is defined based on a selected ActivityType which provides it’s startup parameters by default.

 

In addition to the startup information, an interactive activity also encapsulates the following information:

 

·        Input parameters – Data that needs to be supplied to an activity when it starts up.

·        Output parameters – Data which is set as a result of the completion of an activity.

·        Completion states – As for system activities, this is the list of state names which can be set to let the process know how this task completed. See Completion States for more details. In the case of interactive activities, the completion state must be set, along with the output parameters, when the task completion is signalled back to the workflow system via the Workflow Management API.

 

Both input and output parameter names are local to an activity definition. These will be mapped to process attributes when the activity is configured on a task in a process (see Interactive Tasks).

 

If the application on which the activity is to be performed is not accessible programmatically (i.e. it can not be launched automatically from another application), a manual ActivityType can be used which simply provides textual instructions to the user as to how to manually start up the third party application, perform the task and then enter the output parameter values and select a completion state.

 

The following diagram illustrates the interactions between the workflow system, the Task List application, and an example target application which, in this case, is an Ebase Xi form (Note: This interaction is described in much more detail in the Workflow form integration section).

 

 

 

All interactions between the Task List application (or for that matter, any external application) and the workflow system are via the Workflow Management API.

 

ActivityType

Activity types are provided by implementing the ActivityType Java interface, declaring the implementing class in designer preferences and adding it to the designer and server classpaths.

 

ActivityType definitions also have the option to pre-define the input parameters, output parameters and completion states for an activity if they are constrained by (and available from) the target application. It may also provide a pre-configured or dynamically populated choice for values to be set in the startup parameters list.

 

The workflow system provides three default ActivityTypes:

 

·        CustomActivityType – this is the simplest possible implementation of the ActivityType interface and allows the activity designer to define whatever they wish with no restrictions.

·        EbaseActivityType - this defines an activity which is based on an Ebase Xi form. It defines the following:

·         The startup parameters required: namely the form id. 

·         The input parameters, output parameters and completion states as defined on the workflow-enabled form. These are used to automatically populate the input/output/completions lists when a form is selected in the activity designer.

 

·        ManualActivityType – This defines a more generic activity which can be presented using the WF_MANUAL_TASK Ebase Xi form. This form will display an instruction to the user at the top of the page. This will be followed by a read-only table showing all input parameters.

 

Below this are two tables showing the output parameters and completion states (as defined in the activity). The individual enacting the activity can then manually set values or each of the output parameters, select a completion state and click the Finished button to complete the activity.

 

 

The workflow designer uses the ActivityType definitions to customize the activity designer screens according to the startup parameter definitions in the ActivityType.

 

Additional activity types can be provided by implementing the ActivityType interface and declaring the implementation in the system configuration file. (See Workflow Customization for more information)

 

Completion State ($COMPLETION_STATE)

A completion state serves as an indication to the remainder of the process of how this task completed. This could be as simple as “Succeeded” and “Failed” or more detailed, for example, “authorized”, “rejected”, “referred” etc. Subsequent tasks will have access to the completion state of this activity (via the $COMPLETION_STATE system attribute) and can make decisions based upon it.

 

Note: Completion state is not the same as the processing status of an enactment. These are discussed in more detail in Task Enactment Lifecycle.

 

When a completion state is set as a result of a task enactment being completed, the state is logged in the audit log and can be viewed using the workflow administration application.

 

Design-time Concepts – Tasks

 

There are two types of task: System Tasks and Interactive Tasks. They have the following properties in common:

 

1.      Name – This is used to identify a task in the case it needs to be referred to in a script. It is not compulsory for all tasks to have names and neither must they be unique. In the majority of cases, the name is purely for ease of reference when viewing the process in the designer.

2.      Description – This is a textual description used to aid identification of a particular task enactment. The description may contain embedded references to process attributes which will be populated at the time the description is read. For example, the FINANCE_CHECK interactive task in our original example could have the following description:

Loan finance check dated &&APPLICATION_DATE for &&APPLICANT_NAME requesting a loan of £&&AMOUNT

The &&APPLICATION_DATE , &&APPLICANT_NAME and &&AMOUNT are references to process attributes and will be substituted when the description is fetched and displayed in the task list application. So for Margaret’s application it would appear as:

Loan finance check dated 02/01/2015 for Margaret Wainright requesting a loan of £12,000

The loan manager browsing the task list can therefore identify the loan request easily.

 

Note: Descriptions also support multilingual text in the same manner as all other Ebase Xi forms applications.

 

Design-time Concepts - System tasks

 

System tasks are simple in the sense that they are little more than the activity which defines them. For more details on the runtime behaviour of system tasks, see Task Enactments.

 

Design-time Concepts - Interactive tasks

 

Interactive tasks require considerably more configuration than System tasks. Aside from the task name, description, the actual activity with which they are associated, interactive tasks also require the following configuration:

 

Activity parameter mapping

Since activity input and output parameters are local to the activity, these need to be mapped to process attributes. Once this is set up, the workflow system will automatically pass the values of the mapped process attributes into the activity on initialization and then save the values of the activity’s output parameters into the corresponding mapped process attributes on completion.

 

Assigning Resources to Interactive Tasks

Since, by definition, an interactive task is one which is performed by a person, it is necessary to define who will be allowed to perform any given task. This is likely to depend on a company’s internal HR (human resources) structure, for example, perhaps any loan advisor in the Loans department is allowed to authorize a loan of less than £50,000 but for loans over £50,000 a further authorization is required from that particular loan advisor’s manager. This could be defined using roles in a process as follows:

 

The assignment constraint defines which tasks will be visible on each individual’s task list. For example, if Gilbert is a member of the Loans department and has the Loans role, tasks assignable to the Loans department will be visible on his task list and he will be allowed to open a task and enact it. Whereas Derek in the Savings department will not even see the BASIC_AUTHORISATION tasks as they are created.

 

The assignment configuration for a task offers some standard assignment modes. These are:

 

·        Public – this is a non-authenticated assignment mode. It may only be used for the first task in any process and represents, say an application form submitted by a member of the general public.

·        Job opener – this automatically assigns the task to the same resource who opened the job.

·        Resource from previous task – this automatically assigns the task to the same individual who completed the selected previous task.

·        Process attribute – this automatically assigns the task to a resource named in a process attribute.

·        Named resource – this automatically assigns the task to the resource named in the configuration.

·        Follow-on task – this automatically assigns the task to the resource who completed the previous task in the same stream.

·        Custom – this assigns the task either to an individual resource or to a pool of resources identified by a custom assignment expression. In the default system, custom assignment is implemented using roles but this can be changed.

 

The custom assignment mode is special in that it can work in two different ways:

 

1.      Assignment to an individual – In this case the custom assignment expression resolves to an individual resource to which the task can be immediately assigned.

2.      Assignment to a pool – In this case the custom assignment expression resolves to a collection (or pool) of resources. This could be the name of a department, a role or just a list of possible individuals. In this case, when a person who belongs to the pool views their task list, they will not only see tasks which are explicitly assigned to them but also tasks which are available to them as a member of the pool. The person may then “take” the task which means that the task will then be assigned to them and will no longer be visible on the task lists of other pool members.

 

Security

In addition to task assignment, it is also important to be able to check whether a person actually has the authority to perform, or even to view a specific task. For example, Gerald, a loan manager may only be allowed to view tasks or jobs regarding loans for which he is registered as the job owner. If Gerald uses the workflow administration application to try to view all loan application task enactments, only those tasks which are visible to him as the job owner will be displayed. Alternatively, Gerald may be allowed to view all loan application task enactments but only be allowed to modify, assign, cancel etc, task enactments for which he is the job owner.

 

A security constraint can be defined for an entire process but may be overridden at the task level where required.

 

Defining task security is another customization activity and is defined by a Java implementation of the SecurityHandler interface. This is discussed in more detail in the Workflow Customization section.

 

Priorities

Each task has a priority represented by an integer. This priority is not used in job execution by the workflow system and is provided only to assist client applications to prioritize tasks. For example, the Task List application may wish to present task enactments in descending order of priority. An initial (default) priority can be assigned to the task via the process designer. Thereafter it can be adjusted using Workflow API calls to meet the requirement of client applications. The default workflow administration application also allows for task priorities to be modified.

Design-time Concepts – Process Routing Steps

As well as tasks - described in the previous section, a process can also contain routing steps that are used to control the execution paths of a process. Any conditional logic associated with routing steps is implemented as a server side script. This provides a means of both supplying the conditional logic and resolving references to process context variables.

 

Split/Join

A split represents a point in the process execution path where two or more paths are to be executed concurrently. There is no scripted logic associated with a split as all split paths will always be activated.

All paths of a split must meet at a corresponding join point (See Process Structure Restrictions).

 

Decisions

Decisions are controlled using server side scripts. The only difference from a regular script as used in the system activity definitions is that the goal of a decision script is to set the value of the $NEXT_STEP system variable to the name of one of the links coming out of the decision node.

 

The logic used to decide which value to set $NEXT_STEP to can be dependent on any of the process attributes or system attributes available on the process.

 

If an error is found during execution of the decision script or, for some reason, the value of $NEXT_STEP has not been set, the node will be put in the failed state. There is no option to correct a decision script during runtime since this would involve using a new version of the decision script. It is therefore very important to test each decision thoroughly before releasing a process into the live environment.

 

Design-time Concepts – Pause Node

A Pause Node causes the process execution path to stop until some external event completes e.g. a database table contains a certain value, external file exists etc. Pause Nodes are primarily intended to be used to integrate external services that do not have the ability to connect to the workflow system; but they can also be used to integrate with forms, workflow sub-processes, other workflow jobs etc within an Ebase Xi system.

 

A Pause Node can be posted complete in one of two ways:

 

·         Using a scheduled script: the node’s script is executed at regular intervals which can be specified as daily or a specific number of hours or minutes. This allows the script to repeatedly check for some external event. To set the node as completed, the script should set system variable $PAUSE_COMPLETED to value 'Y'. If this variable is not set, the script will be scheduled to re-execute after the specified interval.

 

When setting the scheduling interval, it should be borne in mind that the script will be executed for each active job in the system. So if there are 200 active jobs and the scheduling interval is the minimum – 1 minute – the script will be executed 200 times each minute. This might result in an unacceptable load on an external system. Please also see the paragraph below discussing errors when checking external systems.

 

·         Explicitly by command: using one of the Javascript post() methods on the workflow API, or the FPL workflow post command. These statements provide two variants, each one requires the event id associated with the Pause Node. The first variant requires a job id, whereas the second variant allows specification of process attribute values that uniquely identify a particular job. When a Pause Node is explicitly posted in this way, the node’s script is not executed. See workflow API.post() or workflow FPL command for examples.

 

If an error is found during execution of a Pause Node’s script, the node will be put in the failed state and will then require manual intervention to reactivate it which is a situation to be avoided if possible. Therefore, when checking external systems, precautions should be taken against intermittent failures such as inaccessibility of a database system. This can be achieved in a Javascript script by enclosing the relevant code within try {} catch {} syntax, or in an FPL script by using the NOFAIL option.

 

Runtime Concepts

 

This section discusses in more detail the elements involved when running a process. It will cover Node Enactments, jobs and sub-jobs.

 

Node Enactments

A node enactment is a single execution of a process node. Enactments are created for all node types: tasks, routing steps and sub-processes. Each enactment goes through a lifecycle of states which depend on the type of node.

 

The following states are supported by all node enactments:

 

Live states (those which may occur while an enactment is still live)

 

  • Active: the task is in the process of being run by the workflow system or has been opened by a person who is enacting it manually.

 

End states (those which signal the end of an enactment’s lifecycle)

 

  • Completed: indicates that the task has been enacted through to completion successfully.
    Note: This is not the same as saying that the task has completed with a successful completion state. The completion state is independent of the lifecycle state and shows the outcome of the task activity, for example, the loan has been approved.
  • Failed: indicates that a technical problem has occurred during execution of the task. Once the cause of the problem has been corrected, the task can be re-executed. This is the only time it is possible to return from an end state.
  • Skipped: this state is set if an enactment has failed irrecoverably and the administrator wants to just force the process to continue regardless of the failure.
  • Cancelled: indicates that the task has been cancelled from active state. Note that it is possible to cancel either an individual task or an entire job. Cancelling an individual task is only possible if the task is marked as cancellable at design time – job execution then continues with the next task or condition. Cancelling a job is always possible, even when the active task is not marked as cancellable.

 

Interactive task enactments may additionally take on any of the following states:

 

Live states

 

  • Unassigned: the enactment has been created but a resource has not yet been assigned.
  • Waiting: a resource has been assigned. The task is now ready to be opened.
  • Paused: a state that allows the user to pause an activity and then resume. For a Pause Node, this is a normal state and indicates that the node is waiting. For other node types, this is more of a marker to show to an administrator that the task has been intentionally paused.

 

 

Enactment Lifecycles

The lifecycle for all enactments other than interactive task enactments is very simple. An enactment is normally created by the workflow system with state Active and is executed immediately. The normal sequence of state transitions will be:

 

            Active -> Any valid end state

 

Once the activity has completed, the workflow system will automatically transition the enactment to the appropriate end state.

Since Interactive tasks are executed by a person, possibly with the assistance of an IT application, when the workflow system creates an instance of a task as part of job execution, the task will initially be put in state Waiting or Unassigned depending on whether or not a resource has been automatically assigned. All subsequent state transitions are signalled through the Workflow API. The normal sequence of state transitions will be:

 

Unassigned -> Waiting -> Active -> Any valid end state

 

In both cases, the workflow system monitors invoked enactments for technical failures (such as loss of database connectivity) and will set the task state to Failed if this occurs. If this happens, in general, the problem causing the failure will need to be corrected and the task re-executed.

 

Any activity associated with an interactive task must be workflow aware in that it must signal transition to an appropriate end state by means of the Workflow Management API.

 

Parallel Processing

If a job contains a split node which splits the processing into multiple paths which each result in the execution of system tasks, these tasks will be executed in parallel by the workflow system and the order of execution will not be predictable. Therefore there can be no interdependencies between such tasks. Processing beyond the Join node will not continue until all incoming paths have completed.

 

Escalations

 

Escalations are provided so that a workflow process can be annotated with actions that should be taken if some part of the process has not completed within some desired timescale. Each individual escalation is actually just another workflow sub-process (see Sub-processes). The workflow designer can include whatever is needed in escalation sub-processes but the most likely actions are such things as:

 

  • A system task that raises the priority of the associated task in the main process
  • A system task that alerts the owner of the Job that some task has not been completed.

 

Each escalation includes three important pieces of information:

 

  • The escalated node which is the workflow node, completion of which will cancel any future enactment of the escalation process.
  • The trigger node which is the workflow node whose enactment will start the process of timing of an escalation. The escalation may be triggered by the trigger node either being started or completed.
  • The time that should elapse before the escalation process is enacted.

 

The timeout for an escalation process may be expressed in a number of different ways and may represent an absolute time (e.g. 10 days) or a day relative to a local calendar (e.g. 15 working days). It can also be set dynamically using a process attribute.

 

Apart from the fact that an escalation sub-process is automatically enacted by the workflow system when necessary, there is nothing special about such enactments: they’re mostly like ordinary sub-processes. The escalation itself, though, has a slightly different lifecycle from that used by conventional enactments and which has already been described.

 

The state model for escalator enactments looks like this:

 

 

 

·        When an escalator enactment is created, it is in the waiting state. An escalator is assigned in the same manner as a normal interactive task enactment and it is the responsibility of the defined Assignment Handler to do this assignment. The assigned actor for an escalator is the person who will see the pending escalators in their task list as the escalator counts down its timeout period before firing.

  • In the case where the escalated node is an interactive task, it is possible to declare that the assignment details for an escalator are inherited from the escalated node. In this way the target actor and assignment expression are declared to be simply the same as those for the escalated node. This is not possible for other types of node so explicit assignment criteria need to be specified.
  • When an escalators fires (that is, its timeout expires) it transitions to the active state when the associated sub-process is enacted in the usual way.
  • Once the subprocess completes the escalator enactment transitions to completed.
  • If the escalated node, or its containing job, is cancelled then any outstanding escalator enactments (those existing in either the waiting or the active states) are also placed into the cancelled state.
  • If the escalated node completes, any extant escalators for that node are placed into the skipped state.

 

Integration with Ebase Xi Forms

 

The workflow system provides full integration with Ebase Xi forms to allow forms applications to be used to open a job on a process or act as interactive activities. There are two aspects to this integration: invoking operations and finding workflow entities to invoke the operations on.

 

Invoking operations

In order to open jobs, assign tasks, complete tasks and so on, it is necessary to be able to invoke operations on workflow entities. This is done using an extensive set of workflow scripting statements including:

 

·        open job

·        open task

·        assign task

·        complete task

 

(See Workflow Form Integration for the complete set of commands)

 

Finding workflow entities

To assist in finding outstanding tasks, jobs and processes, a set of custom resources have been implemented which make use of the filtering methods available on the Workflow Management API. To demonstrate the use of these resources, two sample applications are provided:

 

·        the task list application:  this displays a list of outstanding task enactments which are assigned or assignable to the user logged in to the application. This uses the WorkflowTaskList custom resource implementation in the workflow custom resources package. It enables the user to select a task and assign it to themselves or open it.

·        the workflow administration application: this is a more complex application which displays fully filterable lists of processes, jobs, task enactments and audit records. Along with the WorkflowTaskList custom resource, this application also makes use of the WorkflowProcessesList, WorkflowJobsList and WorkflowAuditList custom resource implementations. For each workflow entity type, the application enables the user to perform all available actions on that entity, for example, quiesce or activate a process, re-assign a task enactment, re-execute a failed node enactment or cancel a job.

 

For further details on general development using Ebase see Working with Forms

 

For further details on the use of custom resources see Working with Custom Resources.

 

Job and task ids

Throughout the workflow system, job ids and task ids are used to uniquely identify a job or a node enactment respectively. The formats of these ids is shown below.

Job Id

“JOB” : Process Name  : Process Version : Job Sequence

 

Where..

Process Name is the name of the process

Process Version is the version of the process used for the job i.e. the latest released version when the job was created

Job Sequence is a sequential number incremented each time a new job is created

 

e.g.

JOB:LOAN_APPLICATION:25:11

JOB:HIRE_CAR_PROCESS:5:101

 

When a job is created with FPL command workflow open job or workflow start job, the job id is available as system variable $WF_JOB_ID. The job id is returned by the corresponding API methods Workflow.openJob() and Workflow.openJobAndCompleteFirstTask().

 

When a job is executing, the job id is available to system tasks or decision nodes as system variable $JOB_ID.

Task Id

“JOB” : Process Name  : Process Version : Job Sequence: Node Enactment Sequence

 

Where..

Process Name is the name of the process

Process Version is the version of the process used for the job i.e. the latest released version when the job was created

Job Sequence is a sequential number incremented each time a new job is created

Node Enactment Sequence is a sequential number incremented each time a new node is created for the job

 

e.g.

TASK:LOAN_APPLICATION:25:11:1

TASK:HIRE_CAR_PROCESS:5:101:16

 

When a form is running under workflow control, the task id is available as system variable $WF_TASK_ID.