Workflow Sample

Workflow Sample
Workflow Sample

Contact

Search API

General Information

Responses are the same as the Process Execution API. Please see here for details.

Responses

Responses are the same as the Process Execution API. Please see here for details.

Response Objects

When data is returned, the response data will be one of the following objects or a list of these objects.
 Object  Explanation
 WorkitemEntry Object indicating Task
 ProcessInstanceEntry Object indicating process
Below are the attributes of these objects.

WorkitemEntry

Responses are the same as the Process Execution API. Please see here for details.

ProcessInstanceEntry

Responses are the same as the Process Execution API. Please see here for details.

List of Operations

Operations that can be handled by the Start API are listed below.
Replace <ContextRoot> in the URLs with the Questetra BPM Suite context root you are connecting to.
 Operation  URL
Search tasks  <ContextRoot>/API/OR/Workitem/list
Search all users' tasks  <ContextRoot>/API/PIM/Workitem/list
Search all users' process  <ContextRoot>/API/PIM/Workitem/list
Acquire Detail  <ContextRoot>/API/PIM/ProcessInstance/list

Search Tasks

This searches tasks that the authenticated user operated or is currently operating. Tasks that are currently being operated include Offer tasks and Allocated tasks.

Implemented version

7.3.0

URL

<ContextRoot>/API/OR/Workitem/list

Parameters

All are search conditions.
 Parameter names  Explanation
processModelInfoId Specifies Process Models by ID.
When this is not specified, all Process Models are applied.
option Specifies search options. Any of the below values can be specified.
Defaul value is END, when none are specified.
END
Searches completed tasks. Does not include canceled tasks
END_1WEEK
Searches tasks completed within one week. Does not include canceled tasks
END_THIS_MONTH
Searches tasks completed within one month. Does not include canceled tasks
END_LAST_MONTH
Searches tasks completed last month. Does not include canceled tasks
OPERATING
Searches currently running tasks
TIMELIMIT_PAST
Searches currently running tasks that have exceeded the deadline
TIMELIMIT_1WEEK
Searches currently running tasks that will reach the deadline within a week. Does not include tasks with already exceeded deadlines
PROCESS_STARTED
Searches tasks in currently running processes. The status of the task has no relevence, and may be completed or running
PROCESS_FAILED
Searches tasks in canceled processes. The status of the task has no relevence, and may be completed or running
ALL
Searches all tasks. version 7.4.0 or later
limit Specifies the maximum number of tasks to acquire. Minimum value is 0, maximum value is 1000. Default when unspecified is 1.
start

Specifies starting point of tasks to be acquired. The minimum value is 0, maximum value is 2147483647. The default when unspecified is 0. 
When the total number of search results is 100, the start value is 10 and the limit value is 50, the system will acquire tasks 11 to 60. 

sort Specifies key for sorting search results. Either of the below values can be specified.
Default when unspecified is offerDatetime.

offerDatetime
    Sorts by time tasks were offered
endDatetime
    Sorts by completion time of tasks
dir Specifies direction of sorting: either descending or ascending order. Default when unspecified is descending order.
ASC
Ascending order. Chronologically, earlier/older comes first
DESC
Descending order. Chronologically, later/newer comes first

Responses

 Object  Description
 count Number
 workitems List of tasks
List of WorkitemEntry

Response Example

{"count":2,
"workitems":[
{
//WorkitemEntry
"id":58399,
"allocateDatetime":"2010-08-18T14:03:18+0900",
...
}, {
//WorkitemEntry
"id":58400,
"allocateDatetime":"2010-08-18T14:03:18+0900",
...
}
]
}

Errors That May Occur

  • InvalidStart(v.7.4.0 or later)
  • InvalidLimit(v.7.4.0 or later)

Search All Users' Tasks

This allows authenticated users to search tasks of all users, according to Process Manager authorization, Process History Viewer authorization and Process Data and History Viewer authorization.

Implemented version

7.3.0

URL

<ContextRoot>/API/PIM/Workitem/list

Parameters

Same as above "Search Tasks."

Responses

Same as above "Search Tasks."

Errors That May Occur

  • InvalidStart(v.7.4.0 or later)
  • InvalidLimit(v.7.4.0 or later)


Search All Users' Process

Implemented version

7.4.0

URL

<ContextRoot>/API/PIM/ProcessInstance/list

Parameter

 Parameter name  Description
criteria

Specifies search conditions by XML.See below "Search Conditions XML" for details.
When this is not specified, the system will search all Processes of all Process Models the user has authorization for. 

limit Specifies the maximum number of tasks to acquire. Minimum value is 0, maximum value is 1000. When this is not specified, the default value is 1.
start

Specifies the starting point of tasts to acquire. Minimum is 0, maximum value is 2147483647. When this is not specified, the default value is 0.
If the entire search base in 100 tasks, start is 10 and limit is 50, the 11th to 60th tasks will be acquired.

Response

Object  Description
 count Number of items
 processInstances List of Processes
List of ProcessInstanceEntry

Response Example

{
  "count":4,
  "processInstances":[
    {"processInstanceId":1319,
     "data":
      {"1":{
        "dataType":"SELECT",
        "id":560709,
        "processDataDefinitionNumber":1,
        "subType":null,
        "value":[
          {"display":"Choice2",
           "value":"Choice2"}
        ],
        "viewOrder":3
       },
       "0":{
        "dataType":"STRING",
        "id":560708,
        "processDataDefinitionNumber":0,
        "subType":null,
        "value":"Choice1\nChoice2",
        "viewOrder":1
       }
      },
     ...
    },
    {"processInstanceId":1284,
     "data":
      {"1":{
        "dataType":"SELECT",
        "id":542679,
        "processDataDefinitionNumber":1,
        "subType":null,
        "value":null,
        "viewOrder":3
       },
       "0":{
        "dataType":"STRING",
        "id":542678,
        "processDataDefinitionNumber":0,
        "subType":null,
        "value":"Choice1\nChoice2\nChoice3",
        "viewOrder":1
       }
      },
     ...
    }
  ]
}

Possible Errors

  • InvalidStart
  • InvalidLimit

Search Conditions XML

XML will be as following. Conditions of this example are,
  • Process model ID is'33'
  • Date/time process started is 'after-equals 2011-01-01'
  • String type data item is 'not-empty'
  • Numeric type data item is 'greater than 100'
And also including Select type data item in search conditions and search results. For detail see Chart.
<process-instance-criteria>
	<process-model-info-id>33</process-model-info-id>
	<start-date-from>2011-01-01</start-date-from>
	<data>
		<string>
			<data-definition-number>0</data-definition-number>
			<not-empty />
		</string>
                <decimal>
                        <data-definition-number>1</data-definition-number>
                        <greater-equals />
                        <value>100</value>
                </decimal>
		<select>
			<data-definition-number>10</data-definition-number>
			<view />
		</select>
	</data>
</process-instance-criteria>

Element / Attribute (X Path)
 Description
/process-instance-criteria
Route element of Search Conditions XML.
Henceforward, /process-instance-criteria is omitted.
process-model-info-id Numeric IDs of Process Models
Do not specify if you wish to search all Process Models you have authorization for.
states
Specifies the status of Processes to be searched.
When not specified, all statuses will be searched. states/ 
states/state String The status of Processes is selected from below.
When selecting multiple statuses, display them in order.
STARTED
Running Processes
ENDED
Processes completed successfully
FAILED
Processes completed unsuccessfully (Canceled, etc.)
title String
When specified, searches Processes with titles that include the specified value.
start-date-from Date
When specified, searches Processes that were started on or after the specified value.
start-date-to Date When specified, searches Processes that were started on or before the specified value.
end-date-from Date When specified, searches Processes that were completed on or after the specified value. Does not include running Processes.
end-date-to Date When specified, searches Processes that were completed on or before the specified value. Does not include running Processes.
init-quser-id Numeric
ID of user.
When specified, searches Processes started by the specified user.
init-qgroup-id Numeric
ID of organization.
When specified, searches Processes started by the specified organization.
sort-property String

Select the key for sorting search results from below.
When this is not specified, the Process Start Time becomes the key.

processInstanceStartDatetime

        Process Start Time
processInstanceEndDatetime
        Process End Time

sort-direction String
Specifies the direction of sorting (acsending, descending).
When this is not specified, descending is applied.
ASC
ascending
DESC
descending
data   Specified when including Process Data Items in search conditions and acquisition of results.
Only Process Data Items specified here is included in search results. 
data/*/data-definition-number Numeric
Process Data definition number.
Specifies the Drocess Data definition number of Process Data Items to be used in search conditions and search results.
The asterisk (*) portion differs according to the data type. 
data/*/value String
Specifies the value used in searches.
The meaning differs according to the type of search. Some search types do not need this specified.
The asterisk (*) portion differs according to the data type.  
data/string   Specified when including String type Process Data Items in search conditions and search results.
data/string/empty   Specified when searching "empty" String type Process Data Items.
For this type of search, data/*/value does not need to be specified.
data/string/not-empty   Specified when searching "not empty" String type Process Data Items.
For this type of search, data/*/value does not need to be specified. 
data/string/contains
Specified when searching String type Process Data Items that contain the text specified in data/*/value
 data/discussion    Specified when including Discussion type Process Data Items in search conditions and search results.
data/discussion/empty   Specified when searching "empty" Discussion type Process Data Items.
For this type of search, data/*/value does not need to be specified.
data/discussion/not-empty   Specified when searching "not empty" Discussion type Process Data Items.
For this type of search, data/*/value does not need to be specified. 
data/discussion/contains
Specified when searching Discussion type Process Data Items that contain the text specified in data/*/value.
 data/decimal    Specified when including Numeric type Process Data Items in search conditions and search results.
data/decimal/equals  

Specified when searching Numeric type Process Data Items with a value that equals the value specified in data/*/value.

data/decimal/greater-equals   Specified when searching Numeric type Process Data Items with a value that is equal to or greater than the value specified in data/*/value.
data/decimal/less-equals   Specified when searching Numeric type Process Data Items with a value that is equal to or smaller than the value specified in data/*/value.
 data/date    Specified when including Date type Process Data Items in search conditions and search results.
data/date/equals  

Specified when searching Date type Process Data Items with a value that equals the value specified in data/*/value.

data/date/after-equals   Specified when searching Date type Process Data Items with a value that is later than the value specified in data/*/value.
data/date/before-equals
Specified when searching Date type Process Data Items with a value that is sooner than the value specified in data/*/value.
 data/datetime    Specified when including Date type Process Data Items in search conditions and search results.
data/datetime/equals
Specified when searching Date type Process Data Items with a value equals the value specified in data/*/value.
data/datetime/after-equals
Specified when searching DateTime type Process Data Items with a value that is later than the value specified in data/*/value.
data/datetime/before-equals   Specified when searching DateTime type Process Data Items with a value that is sooner than the value specified in data/*/value.
 data/select    Specified when including Select type Process Data Items in search conditions and search results.
data/select/selected   Specified when searching Select type Process Data Items in which the value specified in data/*/value is selected. 
 data/file    Specified when including File type Process Data Items in search conditions and search results.
data/file/contains   Specified when searching User type Process Data Items that include file names that contain the value specified in data/*/value
 data/quser    Specified when including User type Process Data Items in search conditions and search results.
data/quser/equals   Specified when searching User type Process Data of the User ID specified in data/*/value.
 data/table    Specified when including Table type Process Data Items in search conditions and search results.
Only able to include in search result.
data/*/view   Specifies the value used when acquiring results of the specified Process Data Item, without search conditions.
The asterisk (*) portion differs according to the data type. 
 

Acquire Process Details

This acquires Process Details. If the user has Process Data and History Viewer authorization over the targeted Process Model, the Process Data will be included.

Implemented Version

7.4.0

Parameters

 Parameter name  Description
 processInstanceId *  Process ID
 Attribute of processInstanceId of WorkitemEntry

Response

 Object  Description
 processInstance  ProcessInstanceEntry

Errors That May Occur

  • InvalidProcessInstanceId
  • ProcessInstanceDoesNotExist

Errors

 Type  Error code  Description
 Validation  10000  Validation error with a certain parameter
 InvalidStart  10012  Invalid start was specified. start must be an integer from 0 to 2147483647
 InvalidLimit  10013  Invalid limit was specified. limit must be an integer from 0 to 1000
 InvalidProcessInstanceId  10014  Invalid processInstanceId was specified. processInstanceId must be an integer from 0 to 9223372036854775807
 ProcessInstanceDoesNotExist  20016  The tasks specified by processInstanceId does not exist