private FlowDefinition buildFlowDefinition(FlowBuilderInfo builderInfo) {
try {
Class<?> flowBuilderClass = loadClass(builderInfo.getClassName());
FlowBuilder builder = (FlowBuilder) flowBuilderClass.newInstance();
AttributeMap<Object> flowAttributes = getFlowAttributes(builderInfo.getAttributes());
FlowBuilderContext builderContext = new FlowBuilderContextImpl(builderInfo.getId(), flowAttributes,
flowRegistry, flowBuilderServices);
FlowAssembler assembler = new FlowAssembler(builder, builderContext);
return assembler.assembleFlow();
} catch (IllegalArgumentException e) {
throw new FlowDefinitionConstructionException(builderInfo.getId(), e);