/** 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 static IncidentEntity createAndInsertIncident(String incidentType, IncidentContext context, String message) { // create new incident IncidentEntity newIncident = create(incidentType); newIncident.setIncidentMessage(message); // set properties from incident context newIncident.setConfiguration(context.getConfiguration()); newIncident.setActivityId(context.getActivityId()); newIncident.setProcessDefinitionId(context.getProcessDefinitionId()); newIncident.setTenantId(context.getTenantId()); newIncident.setJobDefinitionId(context.getJobDefinitionId()); if (context.getExecutionId() != null) { // fetch execution ExecutionEntity execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(context.getExecutionId()); if (execution != null) { // link incident with execution newIncident.setExecution(execution); } else { LOG.executionNotFound(context.getExecutionId()); } } // insert new incident (and create a new historic incident) insert(newIncident); return newIncident; }
public static IncidentEntity createAndInsertIncident(String incidentType, IncidentContext context, String message) { // create new incident IncidentEntity newIncident = create(incidentType); newIncident.setIncidentMessage(message); // set properties from incident context newIncident.setConfiguration(context.getConfiguration()); newIncident.setActivityId(context.getActivityId()); newIncident.setProcessDefinitionId(context.getProcessDefinitionId()); newIncident.setTenantId(context.getTenantId()); newIncident.setJobDefinitionId(context.getJobDefinitionId()); if (context.getExecutionId() != null) { // fetch execution ExecutionEntity execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(context.getExecutionId()); if (execution != null) { // link incident with execution newIncident.setExecution(execution); } else { LOG.executionNotFound(context.getExecutionId()); } } // insert new incident (and create a new historic incident) insert(newIncident); return newIncident; }
/** 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 static IncidentEntity createAndInsertIncident(String incidentType, IncidentContext context, String message) { // create new incident IncidentEntity newIncident = create(incidentType); newIncident.setIncidentMessage(message); // set properties from incident context newIncident.setConfiguration(context.getConfiguration()); newIncident.setActivityId(context.getActivityId()); newIncident.setProcessDefinitionId(context.getProcessDefinitionId()); newIncident.setTenantId(context.getTenantId()); newIncident.setJobDefinitionId(context.getJobDefinitionId()); if (context.getExecutionId() != null) { // fetch execution ExecutionEntity execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(context.getExecutionId()); if (execution != null) { // link incident with execution newIncident.setExecution(execution); } else { LOG.executionNotFound(context.getExecutionId()); } } // insert new incident (and create a new historic incident) insert(newIncident); return newIncident; }