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


Java IncidentQuery.singleResult方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.runtime.IncidentQuery.singleResult方法的典型用法代码示例。如果您正苦于以下问题:Java IncidentQuery.singleResult方法的具体用法?Java IncidentQuery.singleResult怎么用?Java IncidentQuery.singleResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.runtime.IncidentQuery的用法示例。


在下文中一共展示了IncidentQuery.singleResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSimpleQueryWithMultiple

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testSimpleQueryWithMultiple() {
  // given
  String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
  createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);
  createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);

  // when
  IncidentQuery query = runtimeService.createIncidentQuery();

  // then
  verifyQueryResults(query, 1);

  Incident incident = query.singleResult();
  assertNotNull(incident);
  assertEquals(processInstanceId, incident.getProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:IncidentAuthorizationTest.java

示例2: testQueryWithReadPermissionOnProcessInstance

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testQueryWithReadPermissionOnProcessInstance() {
  // given
  startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
  startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
  String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();

  startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
  startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
  startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
  startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);

  createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);

  // when
  IncidentQuery query = runtimeService.createIncidentQuery();

  // then
  verifyQueryResults(query, 1);

  Incident incident = query.singleResult();
  assertNotNull(incident);
  assertEquals(processInstanceId, incident.getProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:IncidentAuthorizationTest.java

示例3: testDoNotCreateNewIncident

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/api/mgmt/IncidentTest.testShouldCreateOneIncident.bpmn"})
public void testDoNotCreateNewIncident() {
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");

  executeAvailableJobs();

  IncidentQuery query = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId());
  Incident incident = query.singleResult();
  assertNotNull(incident);

  JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult();

  // set retries to 1 by job definition id
  managementService.setJobRetriesByJobDefinitionId(jobDefinition.getId(), 1);

  // the incident still exists
  Incident tmp = query.singleResult();
  assertEquals(incident.getId(), tmp.getId());

  // execute the available job (should fail again)
  executeAvailableJobs();

  // the incident still exists and there
  // should be not a new incident
  assertEquals(1, query.count());
  tmp = query.singleResult();
  assertEquals(incident.getId(), tmp.getId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:29,代码来源:IncidentTest.java

示例4: testSimpleQueryWithReadPermissionOnProcessInstance

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testSimpleQueryWithReadPermissionOnProcessInstance() {
  // given
  String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
  createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);

  // when
  IncidentQuery query = runtimeService.createIncidentQuery();

  // then
  verifyQueryResults(query, 1);

  Incident incident = query.singleResult();
  assertNotNull(incident);
  assertEquals(processInstanceId, incident.getProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:IncidentAuthorizationTest.java

示例5: testSimpleQueryWithReadPermissionOnAnyProcessInstance

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testSimpleQueryWithReadPermissionOnAnyProcessInstance() {
  // given
  String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
  createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);

  // when
  IncidentQuery query = runtimeService.createIncidentQuery();

  // then
  verifyQueryResults(query, 1);

  Incident incident = query.singleResult();
  assertNotNull(incident);
  assertEquals(processInstanceId, incident.getProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:IncidentAuthorizationTest.java

示例6: testSimpleQueryWithReadInstancesPermissionOnOneTaskProcess

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testSimpleQueryWithReadInstancesPermissionOnOneTaskProcess() {
  // given
  String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
  createGrantAuthorization(PROCESS_DEFINITION, ONE_INCIDENT_PROCESS_KEY, userId, READ_INSTANCE);

  // when
  IncidentQuery query = runtimeService.createIncidentQuery();

  // then
  verifyQueryResults(query, 1);

  Incident incident = query.singleResult();
  assertNotNull(incident);
  assertEquals(processInstanceId, incident.getProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:IncidentAuthorizationTest.java

示例7: testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition() {
  // given
  String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
  createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);

  // when
  IncidentQuery query = runtimeService.createIncidentQuery();

  // then
  verifyQueryResults(query, 1);

  Incident incident = query.singleResult();
  assertNotNull(incident);
  assertEquals(processInstanceId, incident.getProcessInstanceId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:16,代码来源:IncidentAuthorizationTest.java

示例8: testQueryByInvalidIncidentType

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidIncidentType() {
  IncidentQuery query = runtimeService.createIncidentQuery().incidentType("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例9: testQueryByInvalidIncidentMessage

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidIncidentMessage() {
  IncidentQuery query = runtimeService.createIncidentQuery().incidentMessage("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例10: testQueryByInvalidProcessDefinitionId

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidProcessDefinitionId() {
  IncidentQuery query = runtimeService.createIncidentQuery().processDefinitionId("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例11: testQueryByProcessInstanceId

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
public void testQueryByProcessInstanceId() {
  IncidentQuery query = runtimeService.createIncidentQuery().processInstanceId(processInstanceIds.get(0));

  assertEquals(1, query.count());

  List<Incident> incidents = query.list();
  assertFalse(incidents.isEmpty());
  assertEquals(1, incidents.size());

  Incident incident = query.singleResult();
  assertNotNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例12: testQueryByInvalidProcessInstanceId

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidProcessInstanceId() {
  IncidentQuery query = runtimeService.createIncidentQuery().processInstanceId("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例13: testQueryByInvalidIncidentId

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidIncidentId() {
  IncidentQuery query = runtimeService.createIncidentQuery().incidentId("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例14: testQueryByInvalidExecutionId

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidExecutionId() {
  IncidentQuery query = runtimeService.createIncidentQuery().executionId("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java

示例15: testQueryByInvalidActivityId

import org.camunda.bpm.engine.runtime.IncidentQuery; //导入方法依赖的package包/类
@Test
public void testQueryByInvalidActivityId() {
  IncidentQuery query = runtimeService.createIncidentQuery().activityId("invalid");

  assertEquals(0, query.count());

  List<Incident> incidents = query.list();
  assertTrue(incidents.isEmpty());

  Incident incident = query.singleResult();
  assertNull(incident);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:IncidentQueryTest.java


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