use of io.camunda.zeebe.msgpack.value.ValueArray in project zeebe-process-test by camunda-cloud.
the class GrpcToLogStreamGateway method deployResource.
@Override
public void deployResource(final DeployResourceRequest request, final StreamObserver<DeployResourceResponse> responseObserver) {
final Long requestId = gatewayRequestStore.registerNewRequest(request.getClass(), responseObserver);
final RecordMetadata recordMetadata = prepareRecordMetadata().requestId(requestId).valueType(ValueType.DEPLOYMENT).intent(DeploymentIntent.CREATE);
final DeploymentRecord deploymentRecord = new DeploymentRecord();
final ValueArray<DeploymentResource> resources = deploymentRecord.resources();
request.getResourcesList().forEach((resource -> resources.add().setResourceName(resource.getName()).setResource(resource.getContent().toByteArray())));
writer.writeCommandWithoutKey(deploymentRecord, recordMetadata);
}
use of io.camunda.zeebe.msgpack.value.ValueArray in project zeebe-process-test by camunda-cloud.
the class GrpcToLogStreamGateway method deployProcess.
@Override
public void deployProcess(final DeployProcessRequest request, final StreamObserver<DeployProcessResponse> responseObserver) {
final Long requestId = gatewayRequestStore.registerNewRequest(request.getClass(), responseObserver);
final RecordMetadata recordMetadata = prepareRecordMetadata().requestId(requestId).valueType(ValueType.DEPLOYMENT).intent(DeploymentIntent.CREATE);
final DeploymentRecord deploymentRecord = new DeploymentRecord();
final ValueArray<DeploymentResource> resources = deploymentRecord.resources();
request.getProcessesList().forEach((processRequestObject -> {
resources.add().setResourceName(processRequestObject.getName()).setResource(processRequestObject.getDefinition().toByteArray());
}));
writer.writeCommandWithoutKey(deploymentRecord, recordMetadata);
}
use of io.camunda.zeebe.msgpack.value.ValueArray in project zeebe-process-test by camunda.
the class GrpcToLogStreamGateway method deployProcess.
@Override
public void deployProcess(final DeployProcessRequest request, final StreamObserver<DeployProcessResponse> responseObserver) {
executor.submit(() -> {
final Long requestId = registerNewRequest(responseObserver);
prepareRecordMetadata().requestId(requestId).valueType(ValueType.DEPLOYMENT).intent(DeploymentIntent.CREATE);
final DeploymentRecord deploymentRecord = new DeploymentRecord();
final ValueArray<DeploymentResource> resources = deploymentRecord.resources();
request.getProcessesList().forEach((processRequestObject -> {
resources.add().setResourceName(processRequestObject.getName()).setResource(processRequestObject.getDefinition().toByteArray());
}));
writeCommandWithoutKey(recordMetadata, deploymentRecord);
});
}
Aggregations