Find Workflows
Finds Workflows that match your criteria. The Workflows.find
method supports a fluent style where you can chain together your search criteria.
Permissions Required
You must have Find permissions to the Workflow in order to for this request to succeed.
Method Signature
WorkflowsPage find();
WorkflowsPage find(Filter filter);
WorkflowsPage find(String pageToken);
WorkflowsPage find(Filter filter, String pageToken);
WorkflowsPage find(Filter filter, String pageToken, Integer pageSize);
Parameters
Parameter | Type | Description |
---|---|---|
filter | Filter | The filter criteria to search by, or null to fetch all Workflows. |
pageToken | String | The token of the page to fetch |
pageSize | Integer | The number of Workflows to return per page |
You can search for matches among the following attributes of the Where
class.
Name | Type | Description |
---|---|---|
text | String | Fuzzy matches text attributes of an Instance, including Name and Description. |
owner | String | Search for Instances owned by a specific team member. The email address of the owner of the Instance must match exactly, apart from casing. |
category | String | Find all Instances in a specific category |
Example
/*
* This example demonstrates finding all Workflows owned by a
* particular user and having a name that matches particular text.
* This also demonstrates paging through results to collect all
* matches into a single list.
*/
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.Workflow;
import org.catalytic.sdk.entities.WorkflowsPage;
import java.util.List;
import java.util.ArrayList;
public class Program {
public static void main(String[] args) throws Exception {
// Create and initialize the Catalytid SDK Client
CatalyticClient catalytic = new CatalyticClient();
List<Workflow> workflows = new ArrayList<>();
Where where = new Where().text().matches("SDK Example")
.and().owner().is("[email protected]");
// Find Workflows that are owned by Alice with the name SDK Example
WorkflowsPage results = catalytic.workflows().find(where);
// Add the results to the workflows array
workflows.addAll(results.getWorkflows());
// Loop through all the pages and add them to the workflows array
while(results.getNextPageToken() != null) {
results = catalytic.workflows().find(where, results.getNextPageToken());
workflows.addAll(results.getWorkflows());
}
}
}
Updated almost 3 years ago