use of io.zeebe.broker.workflow.data.DeploymentEvent in project zeebe by zeebe-io.
the class DeploymentEventWriter method writeDeploymentEvent.
/**
* Writes a follow-up event copying all properties of the source event and updating the state.
*/
public void writeDeploymentEvent(final long sourceEventPosition, DeploymentState newState) {
final TypedEvent<DeploymentEvent> event = reader.readValue(sourceEventPosition, DeploymentEvent.class);
final DeploymentEvent deploymentEvent = event.getValue().setState(newState);
actor.runUntilDone(() -> {
final long position = writer.writeFollowupEvent(event.getKey(), deploymentEvent, copyRequestMetadata(event));
if (position >= 0) {
actor.done();
} else {
actor.yield();
}
});
}
Aggregations