Help Center>Foundation Help

Process API

This API enables you to get details about process data. These details are tabulated below.

Name Description Data Type Restrictions Indexed
ProcessID ID mapped to the primary key of the source table (WFProcess) in the Workflow database. Integer Primary Key Y  
DBStoreID ID to identify the database of Foundation. Integer Primary Key Y
Name Name of the instance of Workflow. String    
CreationDate Creation date of the instance of Workflow. datetime Format - YYYY-MM-DDTHH:mm:ss.fff 24 hour time format up to 3 digit milliseconds.    
DueDate Due Date of the instance of Workflow. String    
SolutionKey Solution Dimension Key Integer   Y
SolutionName(DefName) Solution Name String    
SolutionID(DefID) Solution Name ID Integer    
Originator Process's originator user's login ID. Format: domain\username String    
OriginatorFullName The process originator's full name from the UserProfileDW table. Format: FirstName MiddleName LastName String    
OriginatorManagerID The Manager ID from the UserProfileDW table. Integer    
CompletionDate Completion date of the Workflow instance. datetime Format - YYYY-MM-DDTHH:mm:ss.fff 24 hour time format up to 3 digit milliseconds.    
Status Process status value Integer   Y
Code Description
0 - Undefined
1 - Draft
2 - Running
3 - Completed
4 - Canceled
5 - Approved
6 -  Rejected
7 - Blocked
ReferenceID A combination of the List ID and List Item ID corresponding to the workflow instance. String    
ParentProcessID ID of the parent process. Integer    
Inactive Value is 1 for a process marked inactive. Integer   Y
Note A string consisting of the System Generated Comment during a forceful completion of a process and the comment provided by users while doing so. String    
IsForced Yes, if the process ended with force approval\force rejection. Otherwise the value is No. Yes/No   Y
TaskItemTitle Title column of the SharePoint List item on which the process is working.   String    
InheritanceLabel This is data value of process’s property “Inheritance label”. String    
SPWebID Field from Solution Name Dimension or SharePoint Web GUID. String   Y
Context field from WFProcDefDW.
SPSiteID SiteID from the Solution Name Dimension that stores the SharePoint site GUID data. String   Y
Reporting database table: SolNameDim, Column:site_guid
WebName Name of SharePoint site's web. String   Y
WebPath Field from Solution Name dimension or Relative path of the SharePoint web site. String   Y
Reporting database Table: SolNameDim, Column: relative path
WebAppID GUID of the Web app. String   Y
WebAppName Name of the SharePoint web application. String   Y
SolutionDuration Solution Duration value in hours. Integer    
SolutionCreationDate Solution Publish DateTime datetime format - YYYY-MM-DDTHH:mm:ss.fff 24 hour time format up to 3 digit milliseconds.    

Endpoints and Methods

HTTP Method only GET is implemented.

  • Route: /v1/processes – Get all processes.

  • Route: /v1/processes/getcount – Get only the count of processes.

  • Route: /v1/processes/{dbstoreid}/{processid} – Get one process.

URL

The URL is as follows: <<host>>/dwapi/v1/processes

Query Parameters, Descriptions, and Examples

Select

$select: This query option specifies that only the requested properties are returned. Use commas to specify multiple properties.

For example -

You can get only the ProcessID and Name properties from process data by the following: /dwapi/v1/processes?$select=ProcessID,Name

You can get process data with specified properties such as ProcessID, SolutionName, OriginatorFullName, Name, Status, and CreationDate by the following: /dwapi/v1/processes?$select=ProcessID,SolutionName,OriginatorFullName,Name,Status,CreationDate

If you don't use a property which is supported (mentioned in the earlier table) you will get an error: /dwapi/v1/processes?$select=ProcessID,Name,DefName

Filter

$filter: This query option restricts the data to be returned for the requested resource.

You can use the following to further specify your results:

  • Built-in Filter Operations
    • Comparison operators – eq Equal, ne Not equal etc.
    • Logical operators – and Logical and, or Logical or, not Logical negation.
    • Arithmetic operators – add Addition, sub Subtraction etc.
    • Grouping operators – () Precedence grouping
  • Built-in Query Functions
    • String Functions – contains, endswith etc.
    • Date Functions – year, month, day etc.
    • Match Functions – round, floor etc.

For example -

You can restrict to get the processes originated by a particular user only by the following: /dwapi/v1/processes?$filter=OriginatorFullName eq 'John Doe'

You can restrict to get process data originated by a particular user where the ProcessID is greater than 4 by the following:

/dwapi/v1/processes?$filter=OriginatorFullName eq 'John Doe' and ProcessId gt 4

You can get solutionkey 3 processes, that either got created in 6th month and are running, or created in the 7th month but in any status by the following:

/dwapi/v1/processes?$filter=(SolutionKey eq 3) and ((month(CreationDate) eq 6 and status eq 2) or (month(CreationDate) eq 7))

You can use $select and $filter together. Use & to add another parameter by the following: /dwapi/v1/processes?$filter=OriginatorFullName eq 'John Doe'&$select=ProcessID,SolutionName,OriginatorFullName,Name,Status,CreationDate

Orderby

$orderby: This query option requests the service to return the result set in the specified order requested.

This parameter can include asc for asending or desc for descending. Default is ascending if not specified.

For Example -

You can get the process date in ascending order on creationdateby the following: /dwapi/v1/processes?$orderby=creationdate

You can get process data first in descending order on SolutionKey and then in ascending order of creationdateby the following:

/dwapi/v1/processes?$orderby=solutionkey desc,creationdate

$top and $skip

$top: This query option limits the items from result set.

$skip: This query option excludes the first n items from the result set.

Using $orderyby with $top and $skip results in more consistent data.

For example -

You can choose to get the top 10 processes only by the following:

/dwapi/v1/processes?$top=10

You can choose to get all processes but skip the first 10 by the following:

/dwapi/v1/processes?$skip=10

You can choose to skip 30 processes and return the next 10 processes by the following: This could be helpful for pagination. In this example if the page size is 10, then this query will return 4th page. /dwapi/v1/processes?$top=10&$skip=30

getcount

/getcount: This gets the count of result set or data queried. $filter can be used with getcount to know the count of filters result set.

This is not an Odata standard operation, it is only for the Foundation APIs.

For example -

You can choose to get a count of processes by the following:

/dwapi/v1/processes/getcount

You can choose to get a count of all the running processes by the following:

/dwapi/v1/processes/getcount?$filter=Status eq 2