Search in sources :

Example 1 with QueryWorkflowRequest

use of com.uber.cadence.QueryWorkflowRequest in project cadence-client by uber-java.

the class GenericWorkflowClientExternalImpl method queryWorkflow.

@Override
public byte[] queryWorkflow(QueryWorkflowParameters queryParameters) {
    QueryWorkflowRequest request = new QueryWorkflowRequest();
    request.setDomain(domain);
    WorkflowExecution execution = new WorkflowExecution();
    execution.setWorkflowId(queryParameters.getWorkflowId()).setRunId(queryParameters.getRunId());
    request.setExecution(execution);
    WorkflowQuery query = new WorkflowQuery();
    query.setQueryArgs(queryParameters.getInput());
    query.setQueryType(queryParameters.getQueryType());
    request.setQuery(query);
    try {
        QueryWorkflowResponse response = service.QueryWorkflow(request);
        return response.getQueryResult();
    } catch (TException e) {
        throw CheckedExceptionWrapper.wrap(e);
    }
}
Also used : TException(org.apache.thrift.TException) WorkflowQuery(com.uber.cadence.WorkflowQuery) QueryWorkflowResponse(com.uber.cadence.QueryWorkflowResponse) WorkflowExecution(com.uber.cadence.WorkflowExecution) QueryWorkflowRequest(com.uber.cadence.QueryWorkflowRequest)

Aggregations

QueryWorkflowRequest (com.uber.cadence.QueryWorkflowRequest)1 QueryWorkflowResponse (com.uber.cadence.QueryWorkflowResponse)1 WorkflowExecution (com.uber.cadence.WorkflowExecution)1 WorkflowQuery (com.uber.cadence.WorkflowQuery)1 TException (org.apache.thrift.TException)1