Search in sources :

Example 1 with JobHandlerConfiguration

use of org.camunda.bpm.engine.impl.jobexecutor.JobHandlerConfiguration in project camunda-bpm-platform by camunda.

the class JobEntity method execute.

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);
}
Also used : JobHandler(org.camunda.bpm.engine.impl.jobexecutor.JobHandler) JobHandlerConfiguration(org.camunda.bpm.engine.impl.jobexecutor.JobHandlerConfiguration)

Example 2 with JobHandlerConfiguration

use of org.camunda.bpm.engine.impl.jobexecutor.JobHandlerConfiguration in project camunda-bpm-platform by camunda.

the class AbstractSetStateCmd method scheduleSuspensionStateUpdate.

protected void scheduleSuspensionStateUpdate(CommandContext commandContext) {
    TimerEntity timer = new TimerEntity();
    JobHandlerConfiguration jobHandlerConfiguration = getJobHandlerConfiguration();
    timer.setDuedate(executionDate);
    timer.setJobHandlerType(getDelayedExecutionJobHandlerType());
    timer.setJobHandlerConfigurationRaw(jobHandlerConfiguration.toCanonicalString());
    commandContext.getJobManager().schedule(timer);
}
Also used : TimerEntity(org.camunda.bpm.engine.impl.persistence.entity.TimerEntity) JobHandlerConfiguration(org.camunda.bpm.engine.impl.jobexecutor.JobHandlerConfiguration)

Aggregations

JobHandlerConfiguration (org.camunda.bpm.engine.impl.jobexecutor.JobHandlerConfiguration)2 JobHandler (org.camunda.bpm.engine.impl.jobexecutor.JobHandler)1 TimerEntity (org.camunda.bpm.engine.impl.persistence.entity.TimerEntity)1