protected void moveActivityLocalJobsTo(ExecutionEntity other) { if (activityId != null) { for (JobEntity job : getJobs()) { if (activityId.equals(job.getActivityId())) { removeJob(job); job.setExecution(other); } } } }
protected void removeActivityJobs(String reason) { if (activityId != null) { for (JobEntity job : getJobs()) { if (activityId.equals(job.getActivityId())) { job.delete(); removeJob(job); } } } }
protected void removeActivityJobs(String reason) { if (activityId != null) { for (JobEntity job : getJobs()) { if (activityId.equals(job.getActivityId())) { job.delete(); removeJob(job); } } } }
protected void moveActivityLocalJobsTo(ExecutionEntity other) { if (activityId != null) { for (JobEntity job : getJobs()) { if (activityId.equals(job.getActivityId())) { removeJob(job); job.setExecution(other); } } } }
protected ActivityImpl getCurrentActivity(CommandContext commandContext, JobEntity job) { String type = job.getJobHandlerType(); ActivityImpl activity = null; if (SUPPORTED_TYPES.contains(type)) { DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache(); ProcessDefinitionEntity processDefinitionEntity = deploymentCache.findDeployedProcessDefinitionById(job.getProcessDefinitionId()); activity = processDefinitionEntity.findActivity(job.getActivityId()); } else { // noop, because activity type is not supported } return activity; }
protected ActivityImpl getCurrentActivity(CommandContext commandContext, JobEntity job) { String type = job.getJobHandlerType(); ActivityImpl activity = null; if (SUPPORTED_TYPES.contains(type)) { DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache(); ProcessDefinitionEntity processDefinitionEntity = deploymentCache.findDeployedProcessDefinitionById(job.getProcessDefinitionId()); activity = processDefinitionEntity.findActivity(job.getActivityId()); } else { // noop, because activity type is not supported } return activity; }
public void execute(CommandContext commandContext) { if (executionId != null) { ExecutionEntity execution = getExecution(); ensureNotNull("Cannot find execution with id '" + executionId + "' referenced from job '" + this + "'", "execution", execution); } // initialize activity id getActivityId(); // increment sequence counter before job execution incrementSequenceCounter(); preExecute(commandContext); JobHandler jobHandler = getJobHandler(); JobHandlerConfiguration configuration = getJobHandlerConfiguration(); ensureNotNull("Cannot find job handler '" + jobHandlerType + "' from job '" + this + "'", "jobHandler", jobHandler); jobHandler.execute(configuration, execution, commandContext, tenantId); postExecute(commandContext); }
public void execute(CommandContext commandContext) { if (executionId != null) { ExecutionEntity execution = getExecution(); ensureNotNull("Cannot find execution with id '" + executionId + "' referenced from job '" + this + "'", "execution", execution); } // initialize activity id getActivityId(); // increment sequence counter before job execution incrementSequenceCounter(); preExecute(commandContext); JobHandler jobHandler = getJobHandler(); JobHandlerConfiguration configuration = getJobHandlerConfiguration(); ensureNotNull("Cannot find job handler '" + jobHandlerType + "' from job '" + this + "'", "jobHandler", jobHandler); jobHandler.execute(configuration, execution, commandContext, tenantId); postExecute(commandContext); }
protected void createFailedJobIncident() { final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if (processEngineConfiguration .isCreateIncidentOnFailedJobEnabled()) { String incidentHandlerType = Incident.FAILED_JOB_HANDLER_TYPE; // make sure job has an ID set: if(id == null) { id = processEngineConfiguration .getIdGenerator() .getNextId(); } else { // check whether there exists already an incident // for this job List<Incident> failedJobIncidents = Context .getCommandContext() .getIncidentManager() .findIncidentByConfigurationAndIncidentType(id, incidentHandlerType); if (!failedJobIncidents.isEmpty()) { return; } } IncidentContext incidentContext = createIncidentContext(); incidentContext.setActivityId(getActivityId()); processEngineConfiguration .getIncidentHandler(incidentHandlerType) .handleIncident(incidentContext, exceptionMessage); } }
protected void createFailedJobIncident() { final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if (processEngineConfiguration .isCreateIncidentOnFailedJobEnabled()) { String incidentHandlerType = Incident.FAILED_JOB_HANDLER_TYPE; // make sure job has an ID set: if(id == null) { id = processEngineConfiguration .getIdGenerator() .getNextId(); } else { // check whether there exists already an incident // for this job List<Incident> failedJobIncidents = Context .getCommandContext() .getIncidentManager() .findIncidentByConfigurationAndIncidentType(id, incidentHandlerType); if (!failedJobIncidents.isEmpty()) { return; } } IncidentContext incidentContext = createIncidentContext(); incidentContext.setActivityId(getActivityId()); processEngineConfiguration .getIncidentHandler(incidentHandlerType) .handleIncident(incidentContext, exceptionMessage); } }
MigrationInstruction migrationInstruction = parseContext.findSingleMigrationInstruction(job.getActivityId()); ActivityImpl targetActivity = parseContext.getTargetActivity(migrationInstruction);
MigrationInstruction migrationInstruction = parseContext.findSingleMigrationInstruction(job.getActivityId()); ActivityImpl targetActivity = parseContext.getTargetActivity(migrationInstruction);
protected void removeActivityJobs(String reason) { if (activityId != null) { for (JobEntity job : getJobs()) { if (activityId.equals(job.getActivityId())) { job.delete(); removeJob(job); } } } }
protected void moveActivityLocalJobsTo(ExecutionEntity other) { if (activityId != null) { for (JobEntity job : getJobs()) { if (activityId.equals(job.getActivityId())) { removeJob(job); job.setExecution(other); } } } }
protected ActivityImpl getCurrentActivity(CommandContext commandContext, JobEntity job) { String type = job.getJobHandlerType(); ActivityImpl activity = null; if (SUPPORTED_TYPES.contains(type)) { DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache(); ProcessDefinitionEntity processDefinitionEntity = deploymentCache.findDeployedProcessDefinitionById(job.getProcessDefinitionId()); activity = processDefinitionEntity.findActivity(job.getActivityId()); } else { // noop, because activity type is not supported } return activity; }
evt.setActivityId(jobEntity.getActivityId()); evt.setExecutionId(jobEntity.getExecutionId()); evt.setProcessInstanceId(jobEntity.getProcessInstanceId());
evt.setActivityId(jobEntity.getActivityId()); evt.setExecutionId(jobEntity.getExecutionId()); evt.setProcessInstanceId(jobEntity.getProcessInstanceId());
protected void createFailedJobIncident() { final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if (processEngineConfiguration .isCreateIncidentOnFailedJobEnabled()) { String incidentHandlerType = Incident.FAILED_JOB_HANDLER_TYPE; // make sure job has an ID set: if(id == null) { id = processEngineConfiguration .getIdGenerator() .getNextId(); } else { // check whether there exists already an incident // for this job List<Incident> failedJobIncidents = Context .getCommandContext() .getIncidentManager() .findIncidentByConfigurationAndIncidentType(id, incidentHandlerType); if (!failedJobIncidents.isEmpty()) { return; } } IncidentContext incidentContext = createIncidentContext(); incidentContext.setActivityId(getActivityId()); processEngineConfiguration .getIncidentHandler(incidentHandlerType) .handleIncident(incidentContext, exceptionMessage); } }
public void execute(CommandContext commandContext) { if (executionId != null) { ExecutionEntity execution = getExecution(); ensureNotNull("Cannot find execution with id '" + executionId + "' referenced from job '" + this + "'", "execution", execution); } // initialize activity id getActivityId(); // increment sequence counter before job execution incrementSequenceCounter(); preExecute(commandContext); JobHandler jobHandler = getJobHandler(); JobHandlerConfiguration configuration = getJobHandlerConfiguration(); ensureNotNull("Cannot find job handler '" + jobHandlerType + "' from job '" + this + "'", "jobHandler", jobHandler); jobHandler.execute(configuration, execution, commandContext, tenantId); postExecute(commandContext); }
MigrationInstruction migrationInstruction = parseContext.findSingleMigrationInstruction(job.getActivityId()); ActivityImpl targetActivity = parseContext.getTargetActivity(migrationInstruction);