use of io.camunda.zeebe.protocol.impl.record.value.job.JobRecord in project zeebe by camunda.
the class BrokerFailJobRequest method toResponseDto.
@Override
protected JobRecord toResponseDto(final DirectBuffer buffer) {
final JobRecord responseDto = new JobRecord();
responseDto.wrap(buffer);
return responseDto;
}
use of io.camunda.zeebe.protocol.impl.record.value.job.JobRecord in project zeebe by camunda.
the class BrokerThrowErrorRequest method toResponseDto.
@Override
protected JobRecord toResponseDto(final DirectBuffer buffer) {
final JobRecord responseDto = new JobRecord();
responseDto.wrap(buffer);
return responseDto;
}
use of io.camunda.zeebe.protocol.impl.record.value.job.JobRecord in project zeebe by camunda.
the class PartitionTestClient method completeJob.
public JobRecord completeJob(final long jobKey, final JobRecord request) {
final ExecuteCommandResponse response = executeCommandRequest(ValueType.JOB, JobIntent.COMPLETE, request, jobKey);
assertThat(response.getRecordType()).isEqualTo(RecordType.EVENT);
assertThat(response.getIntent()).isEqualTo(JobIntent.COMPLETED);
return response.readInto(new JobRecord());
}
use of io.camunda.zeebe.protocol.impl.record.value.job.JobRecord in project zeebe by camunda.
the class Records method job.
public static JobRecord job(final long instanceKey, final String processId) {
final JobRecord record = new JobRecord();
record.setProcessInstanceKey(instanceKey);
record.setType("test");
record.setBpmnProcessId(processId);
return record;
}
use of io.camunda.zeebe.protocol.impl.record.value.job.JobRecord in project zeebe by camunda.
the class ResponseMapper method toActivateJobsResponse.
public static ActivateJobsResponse toActivateJobsResponse(final long key, final JobBatchRecord brokerResponse) {
final ActivateJobsResponse.Builder responseBuilder = ActivateJobsResponse.newBuilder();
final Iterator<LongValue> jobKeys = brokerResponse.jobKeys().iterator();
final Iterator<JobRecord> jobs = brokerResponse.jobs().iterator();
while (jobKeys.hasNext() && jobs.hasNext()) {
final LongValue jobKey = jobKeys.next();
final JobRecord job = jobs.next();
final ActivatedJob activatedJob = ActivatedJob.newBuilder().setKey(jobKey.getValue()).setType(bufferAsString(job.getTypeBuffer())).setBpmnProcessId(job.getBpmnProcessId()).setElementId(job.getElementId()).setProcessInstanceKey(job.getProcessInstanceKey()).setProcessDefinitionVersion(job.getProcessDefinitionVersion()).setProcessDefinitionKey(job.getProcessDefinitionKey()).setElementInstanceKey(job.getElementInstanceKey()).setCustomHeaders(bufferAsJson(job.getCustomHeadersBuffer())).setWorker(bufferAsString(job.getWorkerBuffer())).setRetries(job.getRetries()).setDeadline(job.getDeadline()).setVariables(bufferAsJson(job.getVariablesBuffer())).build();
responseBuilder.addJobs(activatedJob);
}
return responseBuilder.build();
}
Aggregations