public KieWorkbenchFormRenderingSettings generateRenderingContext(T settings) {
    if (!StringUtils.isEmpty(settings.getFormContent())) {

      try {
        MapModelRenderingContext renderingContext = new MapModelRenderingContext();

        initializeContextForms(settings, renderingContext);

        if (!isValid(renderingContext.getRootForm())) {
          return null;
        }

        Map<String, Object> rawData = generateRawFormData(settings, renderingContext);

        BackendFormRenderingContext context =
            contextManager.registerContext(
                renderingContext, rawData, settings.getMarshallerContext().getClassloader());

        Map<String, Object> formData = generateFormData(rawData, context);

        renderingContext.setModel(formData);

        prepareContext(settings, renderingContext);

        return new KieWorkbenchFormRenderingSettings(context.getTimestamp(), renderingContext);

      } catch (Exception ex) {
        getLogger().debug("Unable to generate render form: ", ex);
      }
    }

    return null;
  }
  public Map<String, Object> generateRuntimeValuesMap(
      long timestamp, Map<String, Object> formValues) {

    BackendFormRenderingContext context = contextManager.getContext(timestamp);

    if (context != null) {

      FormDefinition form = context.getRenderingContext().getRootForm();

      if (isValid(form)) {
        contextManager.removeContext(timestamp);
        return getOutputValues(
            formValuesProcessor.writeFormValues(form, formValues, context.getFormData(), context),
            form);
      }
    }
    throw new IllegalArgumentException(
        "Unable read form values for context '" + timestamp + "'. Form Values: " + formValues);
  }