Skip to content

Commit

Permalink
feat(engine): Populating process instance id in jobs
Browse files Browse the repository at this point in the history
related to camunda#4205
  • Loading branch information
punitdarira committed May 13, 2024
1 parent 96c1bf3 commit 4e97dc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ protected void createJobEntities(BatchEntity batch, T configuration, String depl
ByteArrayEntity configurationEntity = saveConfiguration(byteArrayManager, jobConfiguration);

JobEntity job = createBatchJob(batch, configurationEntity);

if (jobConfiguration.getIds() != null && jobConfiguration.getIds().size() == 1) {
job.setProcessInstanceId(jobConfiguration.getIds().get(0));
}

job.setDeploymentId(deploymentId);
postProcessJob(configuration, job, jobConfiguration);
jobManager.insertAndHintJobExecutor(job);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ protected MessageCorrelationBatchConfiguration createJobConfiguration(MessageCor

@Override
protected void postProcessJob(MessageCorrelationBatchConfiguration configuration, JobEntity job, MessageCorrelationBatchConfiguration jobConfiguration) {
// if there is only one process instance to adjust, set its ID to the job so exclusive scheduling is possible
if (jobConfiguration.getIds() != null && jobConfiguration.getIds().size() == 1) {
job.setProcessInstanceId(jobConfiguration.getIds().get(0));
}

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ public String getType() {

@Override
protected void postProcessJob(BatchConfiguration configuration, JobEntity job, BatchConfiguration jobConfiguration) {
// if there is only one process instance to adjust, set its ID to the job so exclusive scheduling is possible
if (jobConfiguration.getIds() != null && jobConfiguration.getIds().size() == 1) {
job.setProcessInstanceId(jobConfiguration.getIds().get(0));
}

}

protected ByteArrayEntity findByteArrayById(String byteArrayId, CommandContext commandContext) {
Expand Down

0 comments on commit 4e97dc1

Please sign in to comment.