public void setExecution(ExecutionEntity execution) { if (execution != null) { executionId = execution.getId(); processInstanceId = execution.getProcessInstanceId(); execution.addIncident(this); } else { ExecutionEntity oldExecution = getExecution(); if (oldExecution != null) { oldExecution.removeIncident(this); } executionId = null; processInstanceId = null; } }
public void setExecution(ExecutionEntity execution) { if (execution != null) { executionId = execution.getId(); processInstanceId = execution.getProcessInstanceId(); execution.addIncident(this); } else { ExecutionEntity oldExecution = getExecution(); if (oldExecution != null) { oldExecution.removeIncident(this); } executionId = null; processInstanceId = null; } }
protected void handleIncident(MigratingInstanceParseContext parseContext, IncidentEntity incident) { MigratingActivityInstance owningInstance = parseContext.getMigratingActivityInstanceById(incident.getExecution().getActivityInstanceId()); if (owningInstance != null) { parseContext.consume(incident); MigratingIncident migratingIncident = new MigratingIncident(incident, owningInstance.getTargetScope()); owningInstance.addMigratingDependentInstance(migratingIncident); } }
protected void handleIncident(MigratingInstanceParseContext parseContext, IncidentEntity incident) { MigratingActivityInstance owningInstance = parseContext.getMigratingActivityInstanceById(incident.getExecution().getActivityInstanceId()); if (owningInstance != null) { parseContext.consume(incident); MigratingIncident migratingIncident = new MigratingIncident(incident, owningInstance.getTargetScope()); owningInstance.addMigratingDependentInstance(migratingIncident); } }
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); }
/** Instantiate recursive a new incident a super execution * (i.e. super process instance) which is affected from this * incident. * For example: a super process instance called via CallActivity * a new process instance on which an incident happened, so that * the super process instance has an incident too. */ protected void createRecursiveIncidents(String rootCauseIncidentId, List<IncidentEntity> createdIncidents) { final ExecutionEntity execution = getExecution(); if(execution != null) { ExecutionEntity superExecution = execution.getProcessInstance().getSuperExecution(); if (superExecution != null) { // create a new incident IncidentEntity newIncident = create(incidentType); newIncident.setExecution(superExecution); newIncident.setActivityId(superExecution.getCurrentActivityId()); newIncident.setProcessDefinitionId(superExecution.getProcessDefinitionId()); newIncident.setTenantId(superExecution.getTenantId()); // set cause and root cause newIncident.setCauseIncidentId(id); newIncident.setRootCauseIncidentId(rootCauseIncidentId); // insert new incident (and create a new historic incident) insert(newIncident); // add new incident to result set createdIncidents.add(newIncident); newIncident.createRecursiveIncidents(rootCauseIncidentId, createdIncidents); } } }
/** Instantiate recursive a new incident a super execution * (i.e. super process instance) which is affected from this * incident. * For example: a super process instance called via CallActivity * a new process instance on which an incident happened, so that * the super process instance has an incident too. */ protected void createRecursiveIncidents(String rootCauseIncidentId, List<IncidentEntity> createdIncidents) { final ExecutionEntity execution = getExecution(); if(execution != null) { ExecutionEntity superExecution = execution.getProcessInstance().getSuperExecution(); if (superExecution != null) { // create a new incident IncidentEntity newIncident = create(incidentType); newIncident.setExecution(superExecution); newIncident.setActivityId(superExecution.getCurrentActivityId()); newIncident.setProcessDefinitionId(superExecution.getProcessDefinitionId()); newIncident.setTenantId(superExecution.getTenantId()); // set cause and root cause newIncident.setCauseIncidentId(id); newIncident.setRootCauseIncidentId(rootCauseIncidentId); // insert new incident (and create a new historic incident) insert(newIncident); // add new incident to result set createdIncidents.add(newIncident); newIncident.createRecursiveIncidents(rootCauseIncidentId, createdIncidents); } } }
public void setExecution(ExecutionEntity execution) { if (execution != null) { executionId = execution.getId(); processInstanceId = execution.getProcessInstanceId(); execution.addIncident(this); } else { ExecutionEntity oldExecution = getExecution(); if (oldExecution != null) { oldExecution.removeIncident(this); } executionId = null; processInstanceId = null; } }
ExecutionEntity execution = incidentEntity.getExecution(); if (execution != null) { evt.setRootProcessInstanceId(execution.getRootProcessInstanceId());
protected void handleIncident(MigratingInstanceParseContext parseContext, IncidentEntity incident) { MigratingActivityInstance owningInstance = parseContext.getMigratingActivityInstanceById(incident.getExecution().getActivityInstanceId()); if (owningInstance != null) { parseContext.consume(incident); MigratingIncident migratingIncident = new MigratingIncident(incident, owningInstance.getTargetScope()); owningInstance.addMigratingDependentInstance(migratingIncident); } }
ExecutionEntity execution = incidentEntity.getExecution(); if (execution != null) { evt.setRootProcessInstanceId(execution.getRootProcessInstanceId());
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); }
/** Instantiate recursive a new incident a super execution * (i.e. super process instance) which is affected from this * incident. * For example: a super process instance called via CallActivity * a new process instance on which an incident happened, so that * the super process instance has an incident too. */ protected void createRecursiveIncidents(String rootCauseIncidentId, List<IncidentEntity> createdIncidents) { final ExecutionEntity execution = getExecution(); if(execution != null) { ExecutionEntity superExecution = execution.getProcessInstance().getSuperExecution(); if (superExecution != null) { // create a new incident IncidentEntity newIncident = create(incidentType); newIncident.setExecution(superExecution); newIncident.setActivityId(superExecution.getCurrentActivityId()); newIncident.setProcessDefinitionId(superExecution.getProcessDefinitionId()); newIncident.setTenantId(superExecution.getTenantId()); // set cause and root cause newIncident.setCauseIncidentId(id); newIncident.setRootCauseIncidentId(rootCauseIncidentId); // insert new incident (and create a new historic incident) insert(newIncident); // add new incident to result set createdIncidents.add(newIncident); newIncident.createRecursiveIncidents(rootCauseIncidentId, createdIncidents); } } }
ExecutionEntity execution = incidentEntity.getExecution(); if (execution != null) { evt.setRootProcessInstanceId(execution.getRootProcessInstanceId());