Views:
TypeRead/writeAuthorAvailability
Data providerReadFINBOURNEProvided with LUSID

Providing you have sufficient access control permissions, the Workflow.Task.Field provider enables you to write a Luminesce SQL query that retrieves one or more fields and their current values for tasks from the Workflow Service.

See also: Workflow.Task,  Workflow.Task.Writer 

Basic usage

select * from Workflow.Task.Field where <filter-expression>

Query parameters

Workflow.Task.Field has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Workflow.Task.Field' and FieldType = 'Parameter';

Data fields

By default, Workflow.Task.Field returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Workflow.Task.Field' and FieldType = 'Column';

Note: Fields marked 'main' are returned by queries that select a caret character, for example select ^ from Workflow.Task.Field.

Examples

Note: For more example Luminesce SQL queries, visit our Github repo.

Example 1: Retrieve all fields and their values for a particular task

select * from Workflow.Task.Field where Id = '22ffcc7c-3ab6-48cd-9c31-1c702b04a95e';

Example 2: Retrieve all tasks with a particular field value

In this example, Workflow.Task.Field is used to retrieve any data approval tasks that are currently assigned to a particular person.

select * from Workflow.Task.Field where FieldName = 'assignee' and FieldValue = 'Joe Bloggs';

Example 3: Create a notification for a particular field value

In this example, Workflow.Task.Field is used to retrieve some data to approve from a particular task. The field value is then passed into Notification.ManualEvent.Writer to trigger a notification that some new data needs approving. 

@@data_to_approve = select FieldValue from Workflow.Task.Field where FieldName = 'dataToApproveDescription' and Id = '22ffcc7c-3ab6-48cd-9c31-1c702b04a95e';

@data_to_write = select @@data_to_approve as Message, 'A new data approval task has been assigned' as Subject;
select * from Notification.ManualEvent.Writer where ToWrite = @data_to_write;