protected internal virtual void Remove(bool resolved) { ExecutionEntity execution = Execution; if (execution != null) { // Extract possible super execution of the assigned execution ExecutionEntity superExecution = null; if (execution.Id == execution.ProcessInstanceId) { superExecution = (ExecutionEntity)execution.SuperExecution; } else { //superExecution = execution.getProcessInstance().getSuperExecution(); superExecution = (ExecutionEntity)execution.ProcessInstance.SuperExecution; } if (superExecution != null) { // get the incident, where this incident is the cause IncidentEntity parentIncident = superExecution.GetIncidentByCauseIncidentId(Id); if (parentIncident != null) { // remove the incident parentIncident.Remove(resolved); } } // remove link to execution execution.RemoveIncident(this); } // always delete the incident context.Impl.Context.CommandContext.IncidentManager.Delete(this);//.DbEntityManager.Delete(this); // update historic incident HistoryEventTypes eventType = resolved ? HistoryEventTypes.IncidentResolve : HistoryEventTypes.IncidentDelete; FireHistoricIncidentEvent(eventType); }