Workflow query system
Overview
Daisy's workflow API provides a query system that allows for flexible querying of process instances, tasks and timers.
The query system allows:
- to specify a flat set of conditions on built-in properties, process variables, and task variables. A few 'special conditions' are also available. Conditions are either AND-ed or OR-ed together ('match all' or 'match any').
- results can be sorted on properties and variables.
- either the full process or task objects are returned, or a resultset (table) structure of selected properties and variables.
- the returned results can be limitted to a certain 'chunk'.
The query is not expressed in a query language but either as an object structure in the Java interface or an XML structure in the HTTP interface.
Example
Here is an example query expressed as XML, to be submitted via the HTTP API:
<?xml version="1.0"?>
<query xmlns="http://outerx.org/daisy/1.0#workflow">
<selectClause>
<select name="process.id" type="property"/>
<select name="process.definitionLabel" type="property"/>
<select name="daisy_description" type="process_variable"/>
</selectClause>
<conditions meetAllCriteria="true">
<propertyCondition name="process.end"
operator="is_null"
valueType="datetime"/>
</conditions>
<orderByClause>
<orderBy name="process.id" type="property" sortOrder="descending"/>
</orderByClause>
</query>
You can try it out using a tool such as wget. Save the query to a file (e.g. querytest.xml), and then post it to the repository using:
wget --post-file="querytest.xml"
--http-user=testuser
--http-password=testuser
--header="Content-Type: text/xml"
"http://localhost:9263/workflow/query/process?locale=en-US"
(everything should be on one line, adjust username, password, repository URL as necessary)
Syntax
This is a reference of the query XML syntax. Note that this XML doesn't mention whether it is a query on tasks or process instances, this is determined by the URL to which the XML is posted.
<query xmlns="http://outerx.org/daisy/1.0#workflow"
chunkOffset="[1-based offset]" chunkLength="...">
[ selectClause is optional, if not present full entities
will be returned ]
<selectClause>
<select name="[name of built-in prop or a variable"
type="property|task_variable|process_variable"/>
[ ...more select elements... ]
</selectClause>
<conditions meetAllCriteria="true|false">
[zero or more of the following condition-describing elements]
<propertyCondition name="[see tables of properties]"
operator="[see table of operators]"
valueType="[see tables of properties]">
[one or more of the following elements, corresponding
to the valueType and the number of operands the
operator takes]
<string>...</string>
<date>[date in XML Schema format]</date>
<dateTime>[dateTime in XML Schema format]</dateTime>
<long>...</long>
<daisyLink documentId="..." branchId="..." languageId="..." [version="..."]/>
<actor id="..." pool="true|false">
[in case of pools, a list of nested id elements can be used]
<id>...</id>
</actor>
<user>[numeric user id]</user>
<boolean>true|false</boolean>
</propertyCondition>
<taskVariableCondition [similar to property conditions] />
<processVariableCondition [similar to property conditions] />
<specialCondition name="[see list of special conditions">
[any arguments the special condition takes, the value
tags should contain type-specific tags as described
for propertyCondition, e.g. <value><string>...</string></value>]
<value>...</value>
</specialCondition>
</conditions>
<orderByClause>
[zero or more orderBy elements, these are very similar
to the selectClause but with the added possibility to
specify the sort order]
<orderBy name="..."
type="property|task_variable|process_variable"
sortOrder="ascending|descending"/>
</orderByClause>
</query>
Query reference tables
Built-in process properties
These can be used when searching for processes, tasks or timers.
|
Property name |
Data type |
Non-query |
|---|---|---|
|
process.id |
id |
|
|
process.start |
datetime |
|
|
process.end |
datetime |
|
|
process.suspended |
boolean |
|
|
process.definitionName |
string |
|
|
process.definitionVersion |
long |
|
|
process.definitionLabel |
(xml) |
X |
|
process.definitionDescription |
(xml) |
X |
Built-in task properties
These can only be used when searching for tasks.
|
Property name |
Data type |
Non-query |
Comment |
|---|---|---|---|
|
task.id |
id |
||
|
task.actor |
user |
||
|
task.description |
string |
Currently not actively used in Daisy, see the daisy_description process variable for a process-level description. |
|
|
task.create |
datetime |
||
|
task.dueDate |
datetime |
||
|
task.isOpen |
boolean |
||
|
task.priority |
long |
||
|
task.definitionLabel |
(xml) |
X |
|
|
task.definitionDescription |
(xml) |
X |
|
|
task.hasPools |
boolean |
X |
|
|
task.hasSwimlane |
boolean |
Built-in timer properties
These can only be used when searching for timers.
|
Property name |
Data type |
Non-query |
Comment |
|---|---|---|---|
|
timer.id |
id |
||
|
timer.name |
string |
||
|
timer.dueDate |
datetime |
||
|
timer.suspended |
boolean |
||
|
timer.exception |
string |
||
|
timer.failed |
boolean |
X |
To search failed timers, use "timer.exception is not null" |
Special conditions
These conditions only work for certain query types.
|
Query type |
Condtion name |
|---|---|
|
process |
relatedToDocument |
|
task |
tasksInMyPool |
|
timer |
processRelatedToDocument |
Operators
|
Description |
Name |
Argument |
Supported datatypes |
||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
id |
string |
daisy-link |
long |
date |
datetime |
user |
boolean |
actor |
|||
|
Equals |
eq |
1 |
X |
X |
X |
X |
X |
X |
X |
X |
|
|
Less than |
lt |
1 |
X |
X |
X |
X |
|||||
|
Greater than |
gt |
1 |
X |
X |
X |
X |
|||||
|
Less than or equal |
lt_eq |
1 |
X |
X |
X |
X |
|||||
|
Greater than or equal |
gt_eq |
1 |
X |
X |
X |
X |
|||||
|
Between |
between |
2 |
X |
X |
X |
X |
|||||
|
Is null |
is_null |
0 |
X |
X |
X |
X |
X |
X |
X |
X |
|
|
Is not null |
is_not_null |
0 |
X |
X |
X |
X |
X |
X |
X |
X |
|
|
Like |
like |
X |
X |
||||||||
Data types
|
Name |
Java class |
|---|---|
|
id |
java.lang.String |
|
string |
java.lang.String |
|
daisy-link |
org.outerj.daisy.workflow.WfVersionKey |
|
long |
java.lang.Long |
|
date |
java.util.Date |
|
datetime |
java.util.Date |
|
actor |
org.outerj.daisy.workflow.WfActorKey |
|
user |
org.outerj.daisy.workflow.WfUserKey |
|
boolean |
java.lang.Boolean |



There are no comments.