Search in sources :

Example 1 with MigratingAsyncJobInstance

use of org.camunda.bpm.engine.impl.migration.instance.MigratingAsyncJobInstance in project camunda-bpm-platform by camunda.

the class TransitionInstanceJobHandler method handle.

@Override
public void handle(MigratingInstanceParseContext parseContext, MigratingTransitionInstance transitionInstance, List<JobEntity> elements) {
    for (JobEntity job : elements) {
        if (!isAsyncContinuation(job)) {
            continue;
        }
        ScopeImpl targetScope = transitionInstance.getTargetScope();
        if (targetScope != null) {
            JobDefinitionEntity targetJobDefinitionEntity = parseContext.getTargetJobDefinition(transitionInstance.getTargetScope().getId(), job.getJobHandlerType());
            MigratingAsyncJobInstance migratingJobInstance = new MigratingAsyncJobInstance(job, targetJobDefinitionEntity, transitionInstance.getTargetScope());
            transitionInstance.setDependentJobInstance(migratingJobInstance);
            parseContext.submit(migratingJobInstance);
        }
        parseContext.consume(job);
    }
}
Also used : JobEntity(org.camunda.bpm.engine.impl.persistence.entity.JobEntity) JobDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity) MigratingAsyncJobInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingAsyncJobInstance) ScopeImpl(org.camunda.bpm.engine.impl.pvm.process.ScopeImpl)

Aggregations

MigratingAsyncJobInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingAsyncJobInstance)1 JobDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity)1 JobEntity (org.camunda.bpm.engine.impl.persistence.entity.JobEntity)1 ScopeImpl (org.camunda.bpm.engine.impl.pvm.process.ScopeImpl)1