The query language used with Data Stewardship components and the REST API
You can use Talend Query Language (TQL) with the tDataStewardshipTaskDelete and tDataStewardshipTaskInput components or with APIs to query and filter the data you want to delete or read from Talend Cloud Data Stewardship.
Syntax in TQL queries
The query statement used to filter tasks on the server is composed of one or several conditions.
- A field name, which must be prefixed by record. when referencing records data.
- An operator.
- A value, which can be any literal value. Use simple quotes around strings, and precede quotes within the string with a backslash.
The fields you can query with TQL
Field names can be chosen among all custom and metadata fields.
The following table lists the supported metadata fields on tasks:
Metadata field | Description |
---|---|
id (string) | Task internal identifier |
externalID (string) | Task external identifier which helps to access a given task from an external system |
currentState (string) | Current state of the task in the campaign workflow |
assignee (string) | userId of the data steward currently assigned to this task |
targetTransition (string) | Name of the transition chosen by user to move the task to the next step in the campaign workflow |
completed (boolean) | true if the task is completed (it is in a final state of the workflow) |
priority (integer) | Priority level of the task, ranging from 0 (Very Low) to 4 (Very High), default is 2 (Medium) |
dueDate | Timestamp in milliseconds of the task due date |
matchScore (only for Merging and Grouping campaigns) | Decimal value which shows the highest match score of each group in the source data |
version (integer) | Integer value of the task version which is incremented whenever the task is updated |
consumed (boolean) | true if the task has already been processed (so it cannot be processed anymore - unless it is reopened) |
createdBy (string) | userId of the task creator |
creationDate (long) | Timestamp in milliseconds of this task creation date |
lastUpdatedBy (string) | userId of the data steward who did the last update on the task |
lastUpdateDate (long) | Timestamp in milliseconds of the last update done on the task |
tags (string) | List of tags entered by the user for this task |
arbitration (only for Arbitration and Grouping campaigns) | Arbitration choice selected by the data steward |
Operators supported in TQL
Operator | Description |
---|---|
= | Returns a result which matches the value entered. |
!= | Returns a result of any value other than the value entered. |
> | Returns a result which is greater than the value entered. |
>= | Returns a result which is greater than or equal to the value entered. |
< | Returns a result which is less than the value entered. |
<= | Returns a result which is less than or equal to the value entered. |
contains | Returns a result which contains the reference value. |
containsIgnoreCase | Returns a result which contains the reference value (case insensitive). |
~ | Returns a result which complies with the reference
value based on a regular expression. Example: name ~ '^[A-Z|a-z]*$' |
complies | Returns a result which complies with a character-based pattern. For more
information, check the documentation about Character-based patterns. Example: record.field1 complies 'aaaa99_aaaaa9' |
wordComplies | Returns a result which complies with a word-based pattern. For more
information, check the documentation about Word-based patterns. Example: record.field1 wordComplies '[word][number]_[word][digit] |
between | Returns a result which is within the range of values provided. |
in | Returns a result in the list of values which matches
the expression. Example: record.field1 in ['value1', 'value2'] |
For dates comparisons, use the timestamp format for reference values.
For example, you can filter tasks created after 2016-01-01 using the following query:
creationDate > 1451659712733
Boolean operators supported in TQL
You can combine or negate conditions using the boolean operators and and or, or the not operator respectively. Parentheses are supported to override default boolean precedence.
assignee='user1@talend.com' and record.firstName='John'
assignee='user2@talend.com' and record.firstName='De\'wayne'