Example #1
0
        public virtual void testCreateRecursiveHistoricIncidents()
        {
            startProcessInstance("process");

            ProcessInstance pi1 = runtimeService.createProcessInstanceQuery().processDefinitionKey("process").singleResult();

            assertNotNull(pi1);

            ProcessInstance pi2 = runtimeService.createProcessInstanceQuery().processDefinitionKey(PROCESS_DEFINITION_KEY).singleResult();

            assertNotNull(pi2);

            HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();

            HistoricIncident rootCauseHistoricIncident = query.processInstanceId(pi2.Id).singleResult();

            assertNotNull(rootCauseHistoricIncident);

            // cause and root cause id is equal to the id of the root incident
            assertEquals(rootCauseHistoricIncident.Id, rootCauseHistoricIncident.CauseIncidentId);
            assertEquals(rootCauseHistoricIncident.Id, rootCauseHistoricIncident.RootCauseIncidentId);

            HistoricIncident historicIncident = query.processInstanceId(pi1.Id).singleResult();

            assertNotNull(historicIncident);

            // cause and root cause id is equal to the id of the root incident
            assertEquals(rootCauseHistoricIncident.Id, historicIncident.CauseIncidentId);
            assertEquals(rootCauseHistoricIncident.Id, historicIncident.RootCauseIncidentId);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByInvalidProcessInstanceId()
        public virtual void testQueryByInvalidProcessInstanceId()
        {
            HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();

            assertEquals(0, query.processInstanceId("invalid").list().size());
            assertEquals(0, query.processInstanceId("invalid").count());

            try
            {
                query.processInstanceId(null);
                fail("It was possible to set a null value as processInstanceId.");
            }
            catch (ProcessEngineException)
            {
            }
        }