Package org.kie.services.client.serialization.jaxb.impl.query

Examples of org.kie.services.client.serialization.jaxb.impl.query.JaxbQueryTaskResult


        Map<String, String[]> params = makeKeysLowerCase(getRequestParams());
        int[] pageInfo = getPageNumAndPageSize(params, oper);
        int maxNumResults = getMaxNumResultsNeeded(pageInfo);

        InternalTaskQueryHelper queryHelper = new InternalTaskQueryHelper(this);
        JaxbQueryTaskResult result
            = queryHelper.queryTaskOrProcInstAndAssociatedVariables(identityProvider.getName(), params, pageInfo, maxNumResults);
        queryHelper.dispose();
       
        return createCorrectVariant(result, headers);
    }
View Full Code Here


        int maxResults = 1000;
        Map<String, String[]> queryParams = new HashMap<String, String[]>();
       
        // simple (everything)

        JaxbQueryTaskResult result = queryTaskHelper.queryTaskOrProcInstAndAssociatedVariables(USER_ID, queryParams, pageInfo, maxResults);
        assertNotNull( "null result", result );
        assertFalse( "empty result", result.getTaskInfoList().isEmpty() );
        assertTrue( "empty result", result.getTaskInfoList().size() > 2 );
        for( JaxbQueryTaskInfo taskInfo : result.getTaskInfoList() ) {
           long procInstId = taskInfo.getProcessInstanceId();
           assertEquals( procInstId, taskInfo.getTaskSummaries().get(0).getProcessInstanceId().longValue() );
        }
     
        roundTripJson(result);
        roundTripXml(result);
       
        // complicated
        long procInstId = result.getTaskInfoList().get(0).getProcessInstanceId();
        long taskId = result.getTaskInfoList().get(0).getTaskSummaries().get(0).getId();
    
        addParams(queryParams, "processinstanceid", procInstId + "");
        addParams(queryParams, "processid_re", PROCESS_STRING_VAR_ID.substring(0, 10) + "*");
        addParams(queryParams, "taskid_min", taskId + "");
        addParams(queryParams, "taskid_max", taskId + "");
        addParams(queryParams, "taskowner", USER_ID );
        addParams(queryParams, "tst", "Completed" );
      
        Calendar cal = GregorianCalendar.getInstance();
        cal.roll(Calendar.DAY_OF_YEAR, +2);
        String tomorowStr = QUERY_PARAM_DATE_FORMAT.format(cal.getTime()).substring(0, 8);
        addParams(queryParams, "edt_max", tomorowStr);
        String yesterdayStr = "00:00:01";
        addParams(queryParams, "startdate_min", yesterdayStr);
        addParams(queryParams, "vid", "inputStr");
        addParams(queryParams, "vv_re", "check*");
       
        result = queryTaskHelper.queryTaskOrProcInstAndAssociatedVariables(USER_ID, queryParams, pageInfo, maxResults);
        assertNotNull( "null result", result );
        assertFalse( "empty result", result.getTaskInfoList().isEmpty() );
        assertTrue( "more than 1 result", result.getTaskInfoList().size() == 1 );
        JaxbQueryTaskInfo taskInfo = result.getTaskInfoList().get(0);
        assertEquals( "more than 1 task sum", 1, taskInfo.getTaskSummaries().size() );
        assertEquals( "more than 1 variable", 1, taskInfo.getVariables().size() );
        TaskSummary taskSum = taskInfo.getTaskSummaries().get(0);
        assertNotNull( taskSum );
        assertEquals( taskId, taskSum.getId().longValue() );
View Full Code Here

                // TODO: retrieve process instance variables instead of log string values
            }
        }

        // create result
        JaxbQueryTaskResult result = createQueryTaskResult(taskSummaries, varLogs, procVars);
       
        return result;
    }
View Full Code Here

     * @param processVariables A list of {@link JaxbVariableInfo} instances
     * @return A {@link JaxbQueryTaskResult}
     */
    private static JaxbQueryTaskResult createQueryTaskResult( List<TaskSummary> taskSummaries, List<VariableInstanceLog> varLogs,
            List<JaxbVariableInfo> processVariables ) {
        JaxbQueryTaskResult result = new JaxbQueryTaskResult();

        Map<Long, JaxbQueryTaskInfo> procInstIdTaskInfoMap = new HashMap<Long, JaxbQueryTaskInfo>();
        for( TaskSummary taskSum : taskSummaries ) {
            long procInstId = taskSum.getProcessInstanceId();
            JaxbQueryTaskInfo taskInfo = createJaxbQueryTaskInfo(procInstId, procInstIdTaskInfoMap);
            taskInfo.getTaskSummaries().add(new JaxbTaskSummary(taskSum));
        }
        for( VariableInstanceLog varLog : varLogs ) {
            long procInstId = varLog.getProcessInstanceId();
            JaxbQueryTaskInfo taskInfo = createJaxbQueryTaskInfo(procInstId, procInstIdTaskInfoMap);
            taskInfo.getVariables().add(new JaxbVariableInfo(varLog));
        }

        result.getTaskInfoList().addAll(procInstIdTaskInfoMap.values());
        return result;

    }
View Full Code Here

TOP

Related Classes of org.kie.services.client.serialization.jaxb.impl.query.JaxbQueryTaskResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.