protected void remove(boolean resolved) { ExecutionEntity execution = getExecution(); if(execution != null) { // Extract possible super execution of the assigned execution ExecutionEntity superExecution = null; if (execution.getId().equals(execution.getProcessInstanceId())) { superExecution = execution.getSuperExecution(); } else { superExecution = execution.getProcessInstance().getSuperExecution(); } if (superExecution != null) { // get the incident, where this incident is the cause IncidentEntity parentIncident = superExecution.getIncidentByCauseIncidentId(getId()); if (parentIncident != null) { // remove the incident parentIncident.remove(resolved); } } // remove link to execution execution.removeIncident(this); } // always delete the incident Context .getCommandContext() .getDbEntityManager() .delete(this); // update historic incident HistoryEventType eventType = resolved ? HistoryEventTypes.INCIDENT_RESOLVE : HistoryEventTypes.INCIDENT_DELETE; fireHistoricIncidentEvent(eventType); }
protected void remove(boolean resolved) { ExecutionEntity execution = getExecution(); if(execution != null) { // Extract possible super execution of the assigned execution ExecutionEntity superExecution = null; if (execution.getId().equals(execution.getProcessInstanceId())) { superExecution = execution.getSuperExecution(); } else { superExecution = execution.getProcessInstance().getSuperExecution(); } if (superExecution != null) { // get the incident, where this incident is the cause IncidentEntity parentIncident = superExecution.getIncidentByCauseIncidentId(getId()); if (parentIncident != null) { // remove the incident parentIncident.remove(resolved); } } // remove link to execution execution.removeIncident(this); } // always delete the incident Context .getCommandContext() .getDbEntityManager() .delete(this); // update historic incident HistoryEventType eventType = resolved ? HistoryEventTypes.INCIDENT_RESOLVE : HistoryEventTypes.INCIDENT_DELETE; fireHistoricIncidentEvent(eventType); }
protected void remove(boolean resolved) { ExecutionEntity execution = getExecution(); if(execution != null) { // Extract possible super execution of the assigned execution ExecutionEntity superExecution = null; if (execution.getId().equals(execution.getProcessInstanceId())) { superExecution = execution.getSuperExecution(); } else { superExecution = execution.getProcessInstance().getSuperExecution(); } if (superExecution != null) { // get the incident, where this incident is the cause IncidentEntity parentIncident = superExecution.getIncidentByCauseIncidentId(getId()); if (parentIncident != null) { // remove the incident parentIncident.remove(resolved); } } // remove link to execution execution.removeIncident(this); } // always delete the incident Context .getCommandContext() .getDbEntityManager() .delete(this); // update historic incident HistoryEventType eventType = resolved ? HistoryEventTypes.INCIDENT_RESOLVE : HistoryEventTypes.INCIDENT_DELETE; fireHistoricIncidentEvent(eventType); }