class FormEditorServiceImpl extends KieService<FormModelerContent> implements FormEditorService {

    @Override
    protected FormModelerContent constructContent(Path path, Overview overview) {

        FormModelerContent formModelConent = new FormModelerContent();

        try {
            org.uberfire.java.nio.file.Path kiePath = Paths.convert(path);

            FormDefinition form = findForm(kiePath);

            formModelConent.setDefinition(form);
            formModelConent.setPath(path);
            formModelConent.setOverview(overview);

            FormEditorRenderingContext context = createRenderingContext(form, path);

            formModelConent.setRenderingContext(context);

            if (Optional.ofNullable(form.getModel()).isPresent()) {

                FormModel formModel = form.getModel();

                Optional<FormModelHandler> modelHandlerOptional = getHandlerForForm(form);

                if (modelHandlerOptional.isPresent()) {

                    try {
                        FormModelHandler formModelHandler = modelHandlerOptional.get();

                        formModelHandler.init(formModel, path);

                        formModelHandler.checkSourceModel();

                        FormModelSynchronizationResult synchronizationResult = formModelHandler.synchronizeFormModel();

                        formModel.getProperties().forEach(property -> {
                            Optional<FieldDefinition> fieldOptional = Optional.ofNullable(form.getFieldByBinding(property.getName()));
                            if (!fieldOptional.isPresent()) {
                                synchronizationResult.resolveConflict(property.getName());
                            }
                        });

                        formModelConent.setSynchronizationResult(synchronizationResult);
                    } catch (SourceFormModelNotFoundException ex) {
                        formModelConent.setError(new FormModelerContentError(ex.getShortKey(), ex.getShortKeyParams(), ex.getLongKey(), ex.getLongKeyParams(), ex.getModelSourceKey()));
                    }
                }
            }
        } catch (Exception e) {
            StringWriter writer = new StringWriter();
            e.printStackTrace(new PrintWriter(writer));
            formModelConent.setError(new FormModelerContentError(SHORT_KEY, null, LONG_KEY, new String[] {writer.toString()}, null));
            log.warn("Error loading form " + path.toURI(), e);
        }

        resourceOpenedEvent.fire(new ResourceOpenedEvent(path, sessionInfo));

        return formModelConent;
    }

    @Inject public  FormEditorServiceImpl(@Named("ioStrategy") IOService ioService,
                                 SessionInfo sessionInfo,
                                 Event<ResourceOpenedEvent> resourceOpenedEvent,
                                 FieldManager fieldManager,
                                 FormModelHandlerManager modelHandlerManager,
                                 KieModuleService moduleService,
                                 FormDefinitionSerializer formDefinitionSerializer,
                                 ModuleFormFinderService moduleFormFinderService,
                                 DeleteService deleteService,
                                 CommentedOptionFactory commentedOptionFactory,
                                 RenameService renameService,
                                 CopyService copyService);

}