use of io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent in project zeebe by camunda.
the class BpmnStreamProcessor method processRecord.
@Override
public void processRecord(final TypedRecord<ProcessInstanceRecord> record, final TypedResponseWriter responseWriter, final TypedStreamWriter streamWriter, final Consumer<SideEffectProducer> sideEffect) {
// initialize
sideEffectQueue.clear();
sideEffect.accept(sideEffectQueue);
final var intent = (ProcessInstanceIntent) record.getIntent();
final var recordValue = record.getValue();
context.init(record.getKey(), recordValue, intent);
final var bpmnElementType = recordValue.getBpmnElementType();
final var processor = processors.getProcessor(bpmnElementType);
final ExecutableFlowElement element = getElement(recordValue, processor);
stateTransitionGuard.isValidStateTransition(context).ifRightOrLeft(ok -> {
LOGGER.trace("Process process instance event [context: {}]", context);
processEvent(intent, processor, element);
}, violation -> rejectionWriter.appendRejection(record, RejectionType.INVALID_STATE, violation.getMessage()));
}
use of io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent in project zeebe by zeebe-io.
the class BpmnStreamProcessor method processRecord.
@Override
public void processRecord(final TypedRecord<ProcessInstanceRecord> record, final TypedResponseWriter responseWriter, final TypedStreamWriter streamWriter, final Consumer<SideEffectProducer> sideEffect) {
// initialize
sideEffectQueue.clear();
sideEffect.accept(sideEffectQueue);
final var intent = (ProcessInstanceIntent) record.getIntent();
final var recordValue = record.getValue();
context.init(record.getKey(), recordValue, intent);
final var bpmnElementType = recordValue.getBpmnElementType();
final var processor = processors.getProcessor(bpmnElementType);
final ExecutableFlowElement element = getElement(recordValue, processor);
stateTransitionGuard.isValidStateTransition(context).ifRightOrLeft(ok -> {
LOGGER.trace("Process process instance event [context: {}]", context);
processEvent(intent, processor, element);
}, violation -> rejectionWriter.appendRejection(record, RejectionType.INVALID_STATE, violation.getMessage()));
}
use of io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent in project zeebe by camunda-cloud.
the class BpmnStreamProcessor method processRecord.
@Override
public void processRecord(final TypedRecord<ProcessInstanceRecord> record, final TypedResponseWriter responseWriter, final TypedStreamWriter streamWriter, final Consumer<SideEffectProducer> sideEffect) {
// initialize
sideEffectQueue.clear();
sideEffect.accept(sideEffectQueue);
final var intent = (ProcessInstanceIntent) record.getIntent();
final var recordValue = record.getValue();
context.init(record.getKey(), recordValue, intent);
final var bpmnElementType = recordValue.getBpmnElementType();
final var processor = processors.getProcessor(bpmnElementType);
final ExecutableFlowElement element = getElement(recordValue, processor);
stateTransitionGuard.isValidStateTransition(context).ifRightOrLeft(ok -> {
LOGGER.trace("Process process instance event [context: {}]", context);
processEvent(intent, processor, element);
}, violation -> rejectionWriter.appendRejection(record, RejectionType.INVALID_STATE, violation.getMessage()));
}
Aggregations