REST interface for BPD-related resources - Saved Search Definition Resource - GET Method

Use this method to retrieve a saved search definition.

Sample method invocation

GET /rest/bpm/wle/v1/searches/tasks/{idOrName}

Usage Notes

The preferred access mechanism is to use the identifier of a saved search rather than the name, to avoid ambiguity with names.

Parameters

None

Request content

None

Response content

A saved search definition (SavedSearchDefinition complexType).

The default content type is application/json.

MIME type: application/json


+ View schema
{
   "title":"Saved Search Definition",
   "description":"The saved search definition JSON.  This is the JSON that is returned when a search is retrieved, and the JSON that is used for the payload when saving or updating a search.",
   "type":"object",
   "properties":{
        "id":{
           "type":"string",
           "description":"The ID of the saved search definition. This field is always returned.  When supplied as part of the payload: Create: The ID should be omitted when creating a saved search definition. Update: This field is optional and if supplied the id must match the id of the saved search definition being updated.  Adhoc execution:  This if field is optional and if supplied it is ignored.",
           "required":false
        },
        "name":{
           "type":"string",
           "description":"The name of the saved search definition. This field is always returned. When supplied as part of the payload, the requirements differ based on the method.",
           "required":false
        },
        "owner":{
           "type":"string",
           "description":"The owner of the saved search definition. This field is always returned.  If not supplied, it will default to the current user.  The owner of a saved search is always authorized to work on the saved searches they own.  Note: Shared saved searches defined prior to 8570 will not have an owner saved. Shared saved searches, including those owned by other users or without a saved owner, can be created, updated and deleted by a saved search administrators.",
           "required":false
        },
        "organization":{
           "type":"string",
           "description":"A string that indicates how the search results are organized. The value is set to either 'byTask' or 'byInstance'.  Defaults if not provided to 'byTask'.",
           "enum":[
               "byTask",
               "byInstance"
           ],
           "required":false
        },
        "shared":{
           "type":"boolean",
           "description":"Indicates whether the saved search is shared.  Defaults if not provided to false",
           "required":false
        },
        "teams": {
           "type": "array",
           "description": "The team that the saved search is shared with.  If the saved search is shared an empty teams array indicates that the shared saved search is shared globally with everybody.  The array can optionally include one team to share the saved search with.  The teamId must be a team that the user is a member of or manager of.  Saved search administrators can share with any team.  Sharing with multiple teams may be supported in future releases.",
           "required":false,
           "properties" : {
                "teamId": {"type": "string",
                     "description": "The team id."
                },
                "teamName": {"type": "string",
                     "description": "The team name. Used in returned JSON and ignored if included as part of payload."
                },
                "processAppName": {"type": "string",
                     "description": "The process app where the team was defined / modeled. Used in returned JSON and ignored if included as part of payload."
                }
            }
        },
        "size":{
           "type":"integer",
           "description":"The predefined size of items to be retrieved.  Defaults if not provided to a value set in the system configuration.",
           "required":false
        },
        "interaction":{
           "type":"string",
           "description":"The filter to target different task categories (tasks available for claiming, claimed tasks, completed tasks, etc).  Defaults if not provided to 'all'.",
           "enum":[
               "claimed",
               "available",
               "claimed_and_available",
               "completed",
               "all"
           ],
           "required":false
        },
        "fields":{
           "type":"string",
           "description":"A list of fields to be returned when the saved search is executed.",
           "required":false
        },
        "aliases": {
           "type": "array",
           "description": "The aliases for business data fields of a saved search.",
           "required":false,
           "properties" : {
                "field": {"type": "string",
                          "description": "The business data field the alias is for."
                },
                "alias": {"type": "string",
                          "description": "The alias for the field."
                }
            }
        },
        "sort": {
           "type": "array",
           "description": "The sort order of the saved search definition.",
           "required":false,
           "properties" : {
                "field": {"type": "string",
                          "description": "The field to sort on."
                },
                "order": {"type": "string",
                          "description": "The order to sort on.",
                          "enum":[
                               "ASC",
                               "DESC"
                          ]
                }
            }
        },
        "conditions": {
           "type": "array",
           "description": "Represents the conditions of a saved search definition.",
           "required":false,
           "properties" : {
                "field": {"type": "string",
                     "description": "The field the condition is based on."
                },
                "operator": {"type": "string",
                     "description": "The operation to perform. There is a set list of valid values.",
                     "enum":[
                       "Equals",
                       "NotEquals",
                       "StartsWith",
                       "Contains",
                       "GreaterThan",
                       "LessThan",
                       "FullTextSearch"
                     ]
                },
                "value": {"type": "string",
                     "description": "The value of the condition."
                }
            }
        }
   }
}
+ View example content
{
   "status": "200",
   "data": {
        "id": "1052",
        "name":"MySavedSearch",
        "interaction":"claimed_and_available",
        "fields":[
            "taskDueDate",
            "taskId",
            "taskSubject",
            "taskStatus",
            "taskPriority",
            "taskIsAtRisk",
            "taskAtRiskTime",
            "taskClosedDate",
            "taskActivityName",
            "assignedToUser",
            "assignedToRoleDisplayName",
            "instanceName",
            "instanceId",
            "instanceStatus",
            "instanceProcessApp",
            "instanceSnapshot",
            "bpdName",
            "department",
            "gmApproval",
            "hiringManager",
            "location"
        ],
        "aliases": [
            {
                "field":"bpdName",
                "alias":"Customer Specific Alias"
            }
        ],
        "sort":[
            {
                "field":"taskDueDate",
                "order":"ASC"
            }
        ],
        "conditions":[
            {
                "field":"taskDueDate",
                "operator":"LessThan",
                "value":"2016-03-02T05:00:00.000Z"
            }
        ],
        "organization":"byTask",
        "size":25,
        "shared":true,
        "teams":[
            {
                "teamId":"24.eb30156e-52c8-4ec5-9be6-02290d02f827",
                "teamName":"GeneralManagers",
                "processAppName":"Hiring Sample"
            }
        ]
   }
}

MIME type: application/xml


+ View schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/savedsearchdefinition"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema" 
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/savedsearchdefinition"
	xmlns:common="http://rest.bpm.ibm.com/v1/data/common" 
	xmlns:pref="http://rest.bpm.ibm.com/v1/data/root">


    <import schemaLocation="Common.xsd" namespace="http://rest.bpm.ibm.com/v1/data/common"/>
    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root"/>

    <!-- 
     The saved search definition. This is the format that is returned when a search is retrieved, 
     and the format that is used for the payload when saving or updating a search.
    -->
    <complexType name="SavedSearchDefinition">
	    <complexContent>
	        <extension base="pref:Data"> 
	            <sequence>
	                <!-- 
                    The ID of the saved search definition.
                    This field is always returned.  When supplied as part of the payload:
		             Create:  The ID should be blank when creating a saved search definition.
		             Update:  Optional, if supplied the id must match the id of the saved search definition being updated.
		             Adhoc execution:  This field is optional, if supplied it is ignored."
                    -->
                    <element name="id" type="string" />
                    <!-- 
                    "The name of the saved search definition. 
                    This field is always returned. When supplied as part of the payload:
		             Create:  Required and must follow the name validation rules.
		             Update:	Optional, if supplied for the purpose of renameing, must follow the name validation rules
		             Adhoc execution:  This field is optional, if supplied it is ignored."
                    -->
                    <element name="name" type="string" />
                    <!-- 
                    The owner of the saved search definition. 
                     Create:  If a value is not set, the currently logged on user is set as the owner upon save.
                     Update:  Defaulting rules are applied. (pre 8570 did not have owner)
                    -->
                    <element name="owner" type="string" nillable="true"/>
					<!-- 
					A string that indicates how the search results are organized.
					The value is set to either "byTask" or "byInstance".  Defaults if not provided.
					-->
					<element name="organization" type="string" />
					<!-- Indicates whether the saved search is shared. Defaults if not provided. -->
                    <element name="shared" type="boolean" />
                    <!-- Indicates if the saved search is shared with a team or global -->
                    <element name="teams" type="tns:SavedSearchDefnTeam" minOccurs="0" maxOccurs="unbounded"/>
                    <!-- The pre-predefined size of items to be retrieved. -->
					<element name="size" type="integer" nillable="true" />
					<!-- 
					The filter to target different Saved Searches for different task categories 
					(team tasks, claimed tasks, closed tasks, etc). 
					-->
					<element name="interaction" type="string" nillable="true"/>
					<!--  fields or columns -->
					<element name="fields" type="string" minOccurs="0" maxOccurs="unbounded"/>
					<!--  business data aliases -->
					<element name="aliases" type="tns:SavedSearchDefnAlias" minOccurs="0" maxOccurs="unbounded"/>
					<!-- sort order  -->
					<element name="sort" type="tns:SavedSearchDefnSort" minOccurs="0" maxOccurs="3"/>
					<!-- search condition  -->
					<element name="conditions" type="tns:SavedSearchDefnCondition" minOccurs="0" maxOccurs="2"/>

                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!-- 
    This type represents the meta data of a saved search definition that is returned in list of definitions.
    -->
    <complexType name="SavedSearchDefinitionMetadata">
	    <complexContent>
	        <extension base="pref:Data"> 
	            <sequence>
	                <!-- 
                    The ID of the saved search definition.
                    If a value is not set, a new saved search definition is created upon save.
                    -->
                    <element name="id" type="string" />
                    <!-- 
                    The name of the saved search definition. 
                    -->
                    <element name="name" type="string" />
                    <!-- 
                    The owner of the saved search definition. 
                    -->
                    <element name="owner" type="string" nillable="true"/>
					<!-- 
					A string that indicates how the search results are organized.
					The value is set to either "byTask" or "byInstance".
					-->
					<element name="organization" type="string" />
					<!-- Indicates whether the saved search is shared -->
                    <element name="shared" type="boolean" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>

     <!-- 
        A list of saved search definitions. 
    -->
    <complexType name="SavedSearchDefinitions">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="definitions" type="tns:SavedSearchDefinitionMetadata" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!-- This type represents the sort order of a saved search definition. -->
    <complexType name="SavedSearchDefnSort">
		<sequence>
 			<!-- The field to sort on. -->
            <element name="field" type="string" />
            <!-- This will be set to "DESC" or "ASC". -->
            <element name="order" type="string" />
        </sequence>
    </complexType>
	
	<!-- This type represents the aliases for business data fields of a saved search. -->
    <complexType name="SavedSearchDefnAlias">
		<sequence>
			<!-- The business data field the alias is for. -->
            <element name="field" type="string" />
			<!-- The alias for the field. -->
            <element name="alias" type="string" />
        </sequence>
    </complexType>

    <!-- This type represents the conditions of a saved search definition. -->
    <complexType name="SavedSearchDefnCondition">
        <sequence>
            <!-- The field the condition is based on. -->
            <element name="field" type="string" />
            <!-- The operation to perform.  There is a set list of valid values. -->
            <element name="operator" type="string" />
            <!-- The value of the condition ". -->
            <element name="value" type="string" />
        </sequence>
    </complexType>

    <!-- This type represents the teams that are authorized or can execute a shared saved search definition. -->
    <complexType name="SavedSearchDefnTeam">
        <sequence>
            <!-- The team id. -->
            <element name="teamId" type="string" />
            <!-- The team name. -->
            <element name="teamName" type="string" />
            <!-- The process app where the team was defined / modeled". -->
            <element name="processAppName" type="string" />
        </sequence>
    </complexType>

   <!-- 
     This type represents individual meta data of the type requested that can be used in a saved or adhoc search definition.
     It is used to get a list of fields and meta data about those fields. It is filtered by type of meta data requested.
     This type is also used for simple enumerations, in which case type and full_text_searchable will be null.
    -->
    <complexType name="SearchDefinitionMetaData">
        <sequence>
            <!-- The field name. -->
            <element name="name" type="string" />
            <!-- The field's type with the type being one of the following:  String , Date, Time, Integer, Decimal, Boolean. -->
            <element name="type" type="string" />
            <!-- The attribute to indicate if this field may be used in a full text search. -->
            <element name="full_text_searchable" type="boolean" maxOccurs="1" minOccurs="0"/>
        </sequence>
    </complexType>

     <!-- 
        A list of meta data filtered by type that can be used in a saved or adhoc search definition
        It is filtered by type of meta data requested and the elements returned are determined by the type of meta data requested.
    -->
    <complexType name="SearchDefintionMetaDataResultsByType">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="result" type="tns:SearchDefinitionMetaData" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>


   <!-- 
     A list of action policies or available actions a user has based on the Saved Search Definition.
    -->
    <complexType name="SavedSearchDefinitionUsersAvailableActions">
        <complexContent>
            <extension base="pref:Data">
                <sequence>
                    <element name="actions" type="string" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
</schema>
+ View example content
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bpm:ResponseData xmlns:bpm="http://rest.bpm.ibm.com/v1/data" xmlns:ex="http://rest.bpm.ibm.com/v1/data/exception" xmlns:soc="http://rest.bpm.ibm.com/v1/data/social" xmlns:sys="http://rest.bpm.ibm.com/v1/data/system" xmlns:ug="http://rest.bpm.ibm.com/v1/data/usergroup">
    <status>200</status>
    <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns8="http://rest.bpm.ibm.com/v1/data/savedSearchDefinition" xsi:type="ns8:SavedSearchDefinition">
		<id>1052</id>
		<name>SavedSearchDefinition_Example</name>
		<owner>ownerUserName</owner>
		<organization>byInstance</organization>
		<shared>true</shared>
		<teams>
			<teamId>24.da7e4d23-78cb-4483-98ed-b9c238308a03</teamId>
			<teamName>All Users</teamName>
			<processAppName>System Data</processAppName>
		</teams>
		<size>1000</size>
		<interaction>all</interaction>
		<fields>instanceName</fields>
		<fields>taskSubject</fields>
		<fields>taskStatus</fields>
		<fields>taskDueDate</fields>
		<fields>taskPriority</fields>
		<fields>taskClosedDate</fields>
		<fields>taskReceivedDate</fields>
		<fields>bpdName</fields>
		<aliases>
			<field>bpdName</field>
			<alias>Customer Specific Alias</alias>
		</aliases>
		<sort>
			<field>instanceName</field>
			<order>ASC</order>
		</sort>
		<sort>
			<field>taskStatus</field>
			<order>ASC</order>
		</sort>
		<conditions>
			<field>taskStatus</field>
			<operator>EQUAL</operator>
			<value>Received</value>
		</conditions>
    </data>
</bpm:ResponseData>

Error Response content

Detailed error information.

The default content type is application/json.

MIME type: application/json


+ View schema
{  "description": "WLE Error Response", 
   "type": "object",
   "properties":
   {  "status": {"type": "string",
         "description": "The status of the previous API call."
      },
      "exceptionType": {"type": "string",
         "description": "The classname associated with the exception."
      },
      "errorNumber": {"type": "string",
         "description": "Message ID of the exception."
      },
      "errorMessage": {"type": "string",
         "description": "Message text of the exception."
      },
      "errorMessageParameters": {"type": ["string"], "optional": true,
         "description":"Message text parameters of the exception."
      },
      "programmersDetails": {"type": "object", "optional": true,
         "description":"Additional exception details, for example, a stack trace."
      }
   }
} 

MIME type: application/xml


+ View schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/exception"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/exception"
	xmlns:dat="http://rest.bpm.ibm.com/v1/data/root">

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    
    <!--
	This type represents an error response.
    -->    
    <element name="RestRuntimeException">
	<complexType>
	    <sequence>
		<element name="status" type="string"/>
		<element name="Data" type="tns:ExceptionData">
    		</element>
	    </sequence>
	</complexType>
    </element>

    <!-- 
	 This type contains detailed error information associated with an exception.
    -->
    <complexType name="ExceptionData">
	<sequence>
	    <element name="status" type="string"/>

	    <!-- This specifies the java class name of the exception -->
	    <element name="exceptionType" type="string"/>

	    <!-- The message ID of the error message -->
	    <element name="errorNumber" type="string" minOccurs="0"/>

	    <!-- The complete error message -->
	    <element name="errorMessage" type="string"/>

	    <!-- The list of strings inserted into the error message -->
	    <element name="errorMessageParameters" type="string" minOccurs="0" maxOccurs="unbounded"/>

	    <!-- 
		 The stacktrace associated with the exception.
		 Note that this will be omitted unless the "server-stacktrace-enabled" property
		 is enabled in the server's 100Custom.xml file.
	    -->     
	    <element name="programmersDetails" type="string"></element>
	    
	    <!-- Prior responses.  Set if a bulk command was used -->
	    <element name="responses" type="dat:BulkCommandResponses" minOccurs="0"></element>

            <element name="errorData" type="tns:ErrorData" minOccurs="0" />
	</sequence>
    </complexType>

    <complexType name="ErrorData">
        <sequence>
            <element name="code" type="string" />
            <element name="data" type="string" minOccurs="0" />
        </sequence>
    </complexType>
    
</schema>

Status codes

The method returns one of the following status codes:
CodeDescription
200 OK
Successful completion.
400 Bad Request
Bad Request
403 Forbidden
The caller is not authorized to perform this operation.
404 Not Found
The saved search definition does not exist.
406 Not AcceptableThe requested content type or content encoding is not supported.
500 Internal Server Error
Internal Server Error. See the details provided.

Available since

8.5.7

Parent Topic: Saved Search Definition Resource