
This topic shows some examples of how to use uniform resource identifiers (URI) to access BPM tasks or perform an operation on a task.
For collections of tasks, the supported operators for filter expressions are: eq, ne, lt, le, gt, ge, and, or, not, (). The supported function is substringof.
You can optimize task filtering by ensuring that the following conditions are met:
Tasks are filtered by one or all of the following properties: Status, Priority, CreatedBy, TaskDefinitionID, CreatedOn, CompletionDeadLine, SubstitutedUser.
The or operator is used to logically connect expressions for the same property.
Example: Status eq 'READY' or Status eq 'RESERVED'
The and operator is used to logically connect expressions for different properties, or expressions for the same property if they create a date range.
Example: Status eq 'READY' and Priority eq 'HIGH'
Example: CreatedOn ge datetime'2014-01-01T00:00:00' and CreatedOn le datetime'2014-12-31T23:59:59'
The following comparison operators are used: eq, ge, le.
GET
/bpmodata/tasks.svc/TaskCollection?$filter=Status eq 'READY'GET
/bpmodata/tasks.svc/TaskCollection?$filter=Status eq 'READY'and TaskTitle eq 'DefaultTask'GET
/bpmodata/tasks.svc/TaskCollection?$filter=CustomAttributeData/price ge '1000'When ordering tasks you can specify the order direction. The default order direction is ascending (asc).
GET
/bpmodata/tasks.svc/TaskCollection?$filter=Status eq 'READY'&$orderby=TaskDefinitionNameGET
/bpmodata/tasks.svc/TaskCollection?$filter=Status eq 'READY'&$orderby=TaskDefinitionName,
CustomAttributeData/priceGET
/bpmodata/tasks.svc/TaskCollection?$filter=Status eq 'READY'&$orderby=TaskTitle asc, Priority descGET
/bpmodata/tasks.svc/TaskCollection?$filter=Status eq 'READY'&$orderby=CustomAttributeData/price desc,
CustomAttributeData/rate ascGET
/bpmodata/tasks.svc/SearchUsers?SearchPattern='John*'&MaxResults=10You create substitution rules via a POST on the SubstitutionRuleCollection. You need to pass input data according to the SubstitutionRule entity.
POST
/bpmodata/tasks.svc/SubstitutionRuleCollection/InputDataTo get a number of tasks, you must specify the $filter query option in the service request URL. The service only considers filter expressions for the Status property of the Task entity type with the value of the $filter query option. The service ignores filter expressions for other properties of the Task entity type without returning an error.
GET
/bpmodata/tasks.svc/TaskCollection/$count?$filter=Status eq 'READY' or Status eq 'RESERVED'