本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}