use of io.zeebe.broker.workflow.data.WorkflowEvent in project zeebe by zeebe-io.
the class WorkflowDeleteProcessor method updateState.
@Override
public void updateState(TypedEvent<WorkflowEvent> event) {
final long workflowKey = event.getKey();
final WorkflowEvent workflowEvent = event.getValue();
for (int partitionId : partitionIds) {
pendingWorkflows.remove(workflowKey, partitionId);
}
final PendingDeployment pendingDeployment = pendingDeployments.get(workflowEvent.getDeploymentKey());
// reset the workflow's version which is incremented on creation
workflowVersions.setLatestVersion(pendingDeployment.getTopicName(), workflowEvent.getBpmnProcessId(), workflowEvent.getVersion() - 1);
}
use of io.zeebe.broker.workflow.data.WorkflowEvent in project zeebe by zeebe-io.
the class WorkflowCreateProcessor method processEvent.
@Override
public void processEvent(TypedEvent<WorkflowEvent> event) {
partitionIds.clear();
final WorkflowEvent workflowEvent = event.getValue();
final PendingDeployment pendingDeployment = pendingDeployments.get(workflowEvent.getDeploymentKey());
ensureNotNull("pending deployment", pendingDeployment);
final DirectBuffer topicName = pendingDeployment.getTopicName();
final TopicPartitionIterator iterator = topicPartitions.iterator();
while (iterator.hasNext()) {
final TopicPartition topicPartition = iterator.next();
if (BufferUtil.equals(topicName, topicPartition.getTopicName())) {
partitionIds.add(topicPartition.getPartitionId());
}
}
ensureGreaterThan("partition ids", partitionIds.size(), 0);
}
Aggregations