FlowModelHolder flowModelHolder = new DefaultFlowModelHolder(flowModelBuilder);
FlowBuilder flowBuilder = new FlowModelFlowBuilder(flowModelHolder);
FlowBuilderContext builderContext = new FlowBuilderContextImpl(
resource.getId(), resource.getAttributes(), flowRegistry, this.flowBuilderServices);
FlowAssembler assembler = new FlowAssembler(flowBuilder, builderContext);
DefaultFlowHolder flowHolder = new DefaultFlowHolder(assembler);
flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), flowModelHolder);
flowRegistry.registerFlowDefinition(flowHolder);
}