当前位置: 首页>>代码示例>>Java>>正文


Java QueryParameters类代码示例

本文整理汇总了Java中org.camunda.bpm.cockpit.db.QueryParameters的典型用法代码示例。如果您正苦于以下问题:Java QueryParameters类的具体用法?Java QueryParameters怎么用?Java QueryParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QueryParameters类属于org.camunda.bpm.cockpit.db包,在下文中一共展示了QueryParameters类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProcessInstanceCounts

import org.camunda.bpm.cockpit.db.QueryParameters; //导入依赖的package包/类
@GET
public InstanceCountChart getProcessInstanceCounts() {
  HashMap<String, String> parameters = new HashMap<String, String>();
  parameters.put("processDefinitionKey", processDefinitionKey);

  QueryParameters<InstanceCountDto> queryParameters = new QueryParameters<InstanceCountDto>();
  queryParameters.setParameter(parameters);
  
  List<InstanceCountDto> result = getQueryService().executeQuery("cockpit.kpi.selectProcessInstanceCountPerHourForLast7Days", queryParameters);    
  return new InstanceCountChart(result);    
}
 
开发者ID:camunda-consulting,项目名称:camunda-webapp-plugins,代码行数:12,代码来源:ProcessInstanceCountResource.java

示例2: getCycleTimePerHour

import org.camunda.bpm.cockpit.db.QueryParameters; //导入依赖的package包/类
@GET
// @Produces()
public CycleTimeDto getCycleTimePerHour() {
  CycleTimeDto result = new CycleTimeDto();

  HashMap<String, String> parameters = new HashMap<String, String>();
  parameters.put("processDefinitionKey", processDefinitionKey);

  ProcessDefinition processDefinition = getProcessEngine().getRepositoryService().createProcessDefinitionQuery().processDefinitionKey(processDefinitionKey)
      .latestVersion().singleResult();
  InputStream bpmnXml = getProcessEngine().getRepositoryService().getProcessModel(processDefinition.getId());
  Document bpmn = ExtenstionElementReader.parseBpmnXml(bpmnXml);

  result.setName(ExtenstionElementReader.findProperty(bpmn, "KPI-Cycle-Start"));

  parameters.put("activityIdStart", ExtenstionElementReader.findActivityIdForProperty(bpmn, "KPI-Cycle-Start"));
  result.setStartName(ExtenstionElementReader.findActivityNameForProperty(bpmn, "KPI-Cycle-Start"));

  parameters.put("activityIdEnd", ExtenstionElementReader.findActivityIdForProperty(bpmn, "KPI-Cycle-End"));
  result.setEndName(ExtenstionElementReader.findActivityNameForProperty(bpmn, "KPI-Cycle-End"));

  QueryParameters<CountPerDurationDto> queryParameters = new QueryParameters<CountPerDurationDto>();
  queryParameters.setParameter(parameters);

  if (parameters.get("activityIdStart") == null || parameters.get("activityIdEnd") == null) {
    // use whoe process cycle time
    result.setName(processDefinition.getName());
    result.setStartName("START");
    result.setEndName("END");
    result.setTimesPerDuration(getQueryService().executeQuery("cockpit.kpi.selectCycleTimeForPDInHours", queryParameters));
  } else {
    result.setTimesPerDuration(getQueryService().executeQuery("cockpit.kpi.selectCycleTimeInHours", queryParameters));
  }
  return result;
}
 
开发者ID:camunda-consulting,项目名称:camunda-webapp-plugins,代码行数:36,代码来源:CycleTimePerHourResourceResource.java

示例3: getProcessInstanceCounts

import org.camunda.bpm.cockpit.db.QueryParameters; //导入依赖的package包/类
@GET
  public List<CountPerOptionDto> getProcessInstanceCounts() {
    HashMap<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("processDefinitionKey", processDefinitionKey);

    ProcessDefinition processDefinition = getProcessEngine().getRepositoryService().createProcessDefinitionQuery().processDefinitionKey(processDefinitionKey)
        .latestVersion().singleResult();
    InputStream bpmnXml = getProcessEngine().getRepositoryService().getProcessModel(processDefinition.getId());
    Document bpmn = ExtenstionElementReader.parseBpmnXml(bpmnXml);
    
    List<String> activityIds = ExtenstionElementReader.findActivityIdsForProperty(bpmn, "KPI-Ratio");
//    List<String> activityNames = ExtenstionElementReader.findActivityNamesForProperty(bpmn, "KPI-Ratio");
    List<String> propertyNames = ExtenstionElementReader.findPropertyValues(bpmn, "KPI-Ratio");

    if (activityIds.size()==0) {
      activityIds = ExtenstionElementReader.findEndEventActivities(bpmn, ExtenstionElementReader.ID);
      propertyNames = ExtenstionElementReader.findEndEventActivities(bpmn, ExtenstionElementReader.NAME);
    }

    parameters.put("activityIds", activityIds);

    QueryParameters<CountPerOptionDto> queryParameters = new QueryParameters<CountPerOptionDto>();
    queryParameters.setParameter(parameters);
    List<CountPerOptionDto> result = getQueryService().executeQuery("cockpit.kpi.selectCountPerActivityId", queryParameters);
    
    for (CountPerOptionDto countPerOptionDto : result) {
      int i = activityIds.indexOf(countPerOptionDto.getOptionId());
      countPerOptionDto.setOptionName(propertyNames.get(i));
    }
    return result;    
  }
 
开发者ID:camunda-consulting,项目名称:camunda-webapp-plugins,代码行数:32,代码来源:RatioResource.java

示例4: getProcessInstanceCounts

import org.camunda.bpm.cockpit.db.QueryParameters; //导入依赖的package包/类
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<FlowNodeInstanceCountDto> getProcessInstanceCounts() {

  return getQueryService()
      .executeQuery(
        "cockpit.flow-node-instance-counter-plugin.selectFlowNodeInstanceCountPerMonth",
        new QueryParameters<FlowNodeInstanceCountDto>());
}
 
开发者ID:camunda,项目名称:camunda-cockpit-plugins,代码行数:10,代码来源:FlowNodeInstanceResource.java

示例5: getProcessInstanceCounts

import org.camunda.bpm.cockpit.db.QueryParameters; //导入依赖的package包/类
@GET
public List<ProcessInstanceCountDto> getProcessInstanceCounts() {

  return getQueryService()
      .executeQuery(
        "cockpit.sample.selectProcessInstanceCountsByProcessDefinition",
        new QueryParameters<ProcessInstanceCountDto>());
}
 
开发者ID:nikku,项目名称:cockpit-sample-plugin,代码行数:9,代码来源:ProcessInstanceResource.java

示例6: testSampleQueryWorks

import org.camunda.bpm.cockpit.db.QueryParameters; //导入依赖的package包/类
@Test
public void testSampleQueryWorks() {

  QueryService queryService = getQueryService();

  List<ProcessInstanceCountDto> instanceCounts =
    queryService
      .executeQuery(
        "cockpit.sample.selectProcessInstanceCountsByProcessDefinition",
        new QueryParameters<ProcessInstanceCountDto>());

  Assert.assertEquals(0, instanceCounts.size());
}
 
开发者ID:nikku,项目名称:cockpit-sample-plugin,代码行数:14,代码来源:SamplePluginsTest.java


注:本文中的org.camunda.bpm.cockpit.db.QueryParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。