public class InternalProcInstQueryHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ResourceBase |
resourceBase |
| Constructor and Description |
|---|
InternalProcInstQueryHelper(ResourceBase resourceBase) |
| Modifier and Type | Method and Description |
|---|---|
static void |
badParameter(String paramName) |
void |
businessAdmin(String[] data) |
protected void |
createAndSetQueryBuilders(String identity)
Create the
RemoteServicesQueryCommandBuilder instances used by the particular Query Helper implementation. |
void |
deploymentId(String[] data) |
protected boolean |
determineWorkFlowInstanceVariableUse(Map<String,String[]> queryParams)
Figure out whether or not we're getting audit variable logs or workflow instance variables.
|
void |
dispose() |
JaxbQueryProcessInstanceResult |
doQueryAndCreateResultObjects(boolean onlyRetrieveLastVarLogs,
boolean workFlowInstanceVariables,
int[] pageInfo)
Use the created
RemoteServicesQueryCommandBuilder instances to execute the query via the backend. |
void |
endDate(Date[] dateData) |
void |
endDateMax(Date date) |
void |
endDateMin(Date date) |
protected Queue<org.kie.remote.services.rest.query.QueryAction> |
fillQueryActionQueueFromQueryParams(Map<String,String[]> queryParams,
Map<String,String> varValueMap,
Map<String,String> varRegexMap)
Parse the given query parameters to create an
ArrayDeque of QueryAction. |
protected static int |
getOffset(int[] pageInfo)
Calculates and returns the offset and max results information to be used in the query.
|
protected org.kie.remote.services.rest.query.RemoteServicesQueryCommandBuilder[] |
getQueryBuilders() |
void |
initiator(String[] data) |
void |
potentialOwner(String[] data) |
void |
processId(String[] data) |
void |
processInstanceId(long[] longData) |
void |
processInstanceIdMax(long[] longData) |
void |
processInstanceIdMin(long[] longData) |
void |
processInstanceStatus(int[] intData) |
protected void |
processQueryActionQueue(Queue<org.kie.remote.services.rest.query.QueryAction> queryActionQueue,
Map<String,String> varValueMap,
Map<String,String> varRegexMap,
boolean workFlowInstanceVariables)
This is the main core of logic for the query helper classes.
|
void |
processVersion(String[] data) |
R |
queryTaskOrProcInstAndAssociatedVariables(String identity,
Map<String,String[]> queryParams,
int[] pageInfo)
This method is the internal logic that
preprocesses the list of query parameters passed to the
.. |
R |
queryTasksOrProcInstsAndVariables(Map<String,String[]> queryParams,
int[] pageInfo) |
protected static void |
setPaginationParameters(int[] pageInfo,
org.kie.remote.services.rest.query.RemoteServicesQueryCommandBuilder determiningQueryBuilder)
Set the pagination parameters on the query builder that determines the number of results (the task query builder, in this case)
|
protected void |
setQueryBuilders(org.kie.remote.services.rest.query.RemoteServicesQueryCommandBuilder... queryBuilders) |
void |
stakeHolder(String[] data) |
void |
startDate(Date[] dateData) |
void |
startDateMax(Date date) |
void |
startDateMin(Date date) |
void |
taskId(long[] longData) |
void |
taskIdMax(long longData) |
void |
taskIdMin(long longData) |
void |
taskOwner(String[] data) |
void |
taskStatus(org.kie.api.task.model.Status[] statuses) |
void |
value(String[] data) |
protected boolean |
variableCriteriaInQuery(org.kie.internal.query.data.QueryData queryData) |
void |
variableId(String[] data) |
void |
variableValue(String varId,
String value) |
void |
workItemId(long[] longData) |
protected ResourceBase resourceBase
public InternalProcInstQueryHelper(ResourceBase resourceBase)
protected void createAndSetQueryBuilders(String identity)
RemoteServicesQueryCommandBuilder instances used by the particular Query Helper implementation.identity - The identity of the user doing the REST call, needed when querying Taskspublic JaxbQueryProcessInstanceResult doQueryAndCreateResultObjects(boolean onlyRetrieveLastVarLogs, boolean workFlowInstanceVariables, int[] pageInfo)
RemoteServicesQueryCommandBuilder instances to execute the query via the backend.JaxbQueryProcessInstanceResult or JaxbQueryTaskResult) with the
information from the results of the queriesonlyRetrieveLastVarLogs - Whether toworkFlowInstanceVariables - (UNFINISHED FEATURE) whether to use the information from variable instance logs
or from the process instance variables themselves.pageInfo - pagination informationprotected static void setPaginationParameters(int[] pageInfo,
org.kie.remote.services.rest.query.RemoteServicesQueryCommandBuilder determiningQueryBuilder)
pageInfo - Pagination informationdeterminingQueryBuilder - The query builder that determines the number of resultspublic void taskId(long[] longData)
public void initiator(String[] data)
public void stakeHolder(String[] data)
public void potentialOwner(String[] data)
public void taskOwner(String[] data)
public void businessAdmin(String[] data)
public void taskStatus(org.kie.api.task.model.Status[] statuses)
public static void badParameter(String paramName)
public void dispose()
protected static int getOffset(int[] pageInfo)
pageInfo - Pagination information ([0] is page number, [1] is page size)public R queryTaskOrProcInstAndAssociatedVariables(String identity, Map<String,String[]> queryParams, int[] pageInfo)
../rest/query/runtime/{task,process} operationJaxbQueryTaskResult or JaxbQueryProcessInstanceResult instanceQueryAction instances
to the actual QueryData, instead of directly translating REST query parameters to QueryData information. This
effectively decouples the REST query parameters from the query builders, giving us more flexibility/maintainability in the code.identity - The identity of the caller, needed when doing task queriesqueryParams - The query parameters map returned by the JAX-RS logicpageInfo - The pagination informationmaxResults - The maximum number of results to be returned, determined by the pagination informationJaxbQueryTaskResult or JaxbQueryProcessInstanceResult containing a list of entities containing task
and process variable informationpublic R queryTasksOrProcInstsAndVariables(Map<String,String[]> queryParams, int[] pageInfo)
protected boolean determineWorkFlowInstanceVariableUse(Map<String,String[]> queryParams)
queryParams - The map of (REST operation) query parametersprotected Queue<org.kie.remote.services.rest.query.QueryAction> fillQueryActionQueueFromQueryParams(Map<String,String[]> queryParams, Map<String,String> varValueMap, Map<String,String> varRegexMap)
ArrayDeque of QueryAction.
The Queue of QueryAction is then acted upon by the {#processQueryActionQueue(ArrayDeque, Map, Map, boolean)
method, which applies the different query actions to build the query requested via the query builder instances.protected boolean variableCriteriaInQuery(org.kie.internal.query.data.QueryData queryData)
protected void processQueryActionQueue(Queue<org.kie.remote.services.rest.query.QueryAction> queryActionQueue, Map<String,String> varValueMap, Map<String,String> varRegexMap, boolean workFlowInstanceVariables)
Deque
of QueryAction instances.
We're using a Queue instead of a List because I may eventually want to add new QueryAction elements
to the queue during processing: once I'm sure that I won't be doing that, I'll move this back to a List which is
more efficient and performant.
In this method, we go through each element (in the order that it was added) and translate the REST query parameter to a
action on the query builder(s) so that the requested query can be built an executed.queryActionQueue - An ordered collection of QueryAction instancesvarValueMap - A Map mapping the variable name to the variable's valuevarRegexMap - A Map mapping the variable name to a regex for the variable's valueworkFlowInstanceVariables - Whether or not variable values should be retrieved from the audit logs or the process instanceprotected void setQueryBuilders(org.kie.remote.services.rest.query.RemoteServicesQueryCommandBuilder... queryBuilders)
protected org.kie.remote.services.rest.query.RemoteServicesQueryCommandBuilder[] getQueryBuilders()
public void processInstanceId(long[] longData)
public void processInstanceIdMin(long[] longData)
public void processInstanceIdMax(long[] longData)
public void processId(String[] data)
public void workItemId(long[] longData)
public void deploymentId(String[] data)
public void taskIdMin(long longData)
public void taskIdMax(long longData)
public void processInstanceStatus(int[] intData)
public void processVersion(String[] data)
public void startDateMin(Date date)
public void startDateMax(Date date)
public void startDate(Date[] dateData)
public void endDateMin(Date date)
public void endDateMax(Date date)
public void endDate(Date[] dateData)
public void variableId(String[] data)
public void value(String[] data)
Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.