當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。