// implementing flow execution key factory
public FlowExecutionKey getKey(FlowExecution execution) {
CompositeFlowExecutionKey key = (CompositeFlowExecutionKey) execution.getKey();
if (key == null) {
Conversation conversation = beginConversation(execution);
ConversationId executionId = conversation.getId();
return new CompositeFlowExecutionKey(executionId, nextSnapshotId(executionId));
} else {
if (alwaysGenerateNewNextKey) {
return new CompositeFlowExecutionKey(key.getExecutionId(), nextSnapshotId(key.getExecutionId()));
} else {